minify-html
minify-html copied to clipboard
Add bindings for dart
This pull request adds Dart bindings to this library. The bindings will allow Dart to load and interact with the library using C-Interop.
I've also included an example file, example/minify_html_example.dart
, in the example folder to demonstrate how to use your library with Dart.
TODO: Documentation
Run
Move into dart directory
cd dart
Run the following command to build and move the library to an accessible place
cargo build -r --manifest-path native/Cargo.toml && mv native/target/release/libminifyhtml.so .dart_tool/minifyhtml
Run the example
dart run example/minify_html_example.dart
This is looking great, thanks @m-haisham. Don't worry about the docs, I'll add those and do some more general package cleanup tasks myself once it's merged, including structuring the project, some minor reformatting, and setting up CI.
How will the native binary be distributed? It looks like we can publish to the official pub.dev, but does that allow for bundling binary files? Alternatively, we'll need a post-install script that downloads the appropriate binary for the platform.
How will the native binary be distributed?
The easiest solution would be to have it download the appropriate library files for each platform during build
Hello m-haisham,
Thank you for your contribution to the library by adding Dart bindings! It's great to see the community working together to improve the library.
The example file you included in the example folder is helpful and makes it easier for developers to use the library with Dart. However, as you mentioned, it would be great to have documentation to go along with the bindings.