-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Built-in minifying vs. supported minifier package extension #253
Comments
Thanks a lot! I need to think a bit about your suggestions; it'd be great to have users able to leverage |
sorry I haven't replied here in a while. I'm supportive of this as long as it's opt-in. I suggest doing it the following way so that this JLL does not unnecessarily become a dependency of Xranklin:
the process for a user to use it would then be:
it might not be as ergonomic as you might like but the advantage is that it is not limited to minifying (e.g. the user might decide to add a call to whatever image crushing program they might have on their machine or god knows what else they might want to do prior to deployment). Eventually, I'd like for such things to be small plugin packages that a user could call from their what do you think? |
I had originally submitted a PR request to the original Franklin.jl repo (Replace html-css-js-minify with minify_jll, eliminate Python3 dependency) for eliminating Python3 as an external dependency in lieu of using the recently ported minify_jll package for Taco de Wolff's Minify tool written in Go. I'd be more than happy to include it here so it can be ready for the next big Franklin release!
Advantages
Current Ideas
minify_jll as an included dependency
I advocate for this option as the advantages of minimizing code for the web are numerous (reduce page load, increase performance,...) and should be an enabled option by default. The package is loaded transparently to the user since it would be bundled with Xranklin and not exposed, thus could be more easily changed in the future if warranted. My current thinking is to integrate the minification step into the
full_pass
function which already tracks files.minify_jll in a package extension
A second option would be to integrate minify_jll as a weak dependency that is manually loaded when the user wishes to enable minification. It could be as simple as redefining the
full_pass
function like so:If we can discuss it further and head towards a consensus, I can see about submitting a draft PR by the end of the week barring exceptional circumstances.
The text was updated successfully, but these errors were encountered: