-
Notifications
You must be signed in to change notification settings - Fork 351
Move to esbuild and update npm packages #1605
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
Conversation
I didn't get anywhere with the two available esbuild Handlebars loaders, so the assets build script instead precompiles the Handlebars templates. https://handlebarsjs.com/installation/precompilation.html The HTML formatter's digest function has been updated to produce 8- character uppercase hashes in order to match those generated by esbuild. The ESLint config was re-initiated and now uses its default parser (Espree), so Babel is no longer required. This commit does not update the formatters directory. When the formatters directory is updated with the results of the new build process, the 'formatters/html/fonts' directory should be deleted as the font file is now placed in the dist directory along with the JS and CSS. For the Elixir-based tests to result in up-to-date build dist contents I found I had to empty the _build directory.
Hopefully the Elixir tests will pass once the esbuild arch issue in the CI pipeline has been sorted; they're passing for me locally. |
Amazing work!
As long as they are running, I think we are good. :)
It seems CI is failing because we have to rebuild the assets. Can you please do it this time exceptionally as part of your PR? Then I can rebuild after merge. :) Thank you! |
assets/package.json
Outdated
"karma-chai-plugins": "^0.9.0", | ||
"karma-chrome-launcher": "^3.1.1", | ||
"karma-esbuild": "^2.2.5", | ||
"karma-firefox-launcher": "^2.1.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may no longer need this, looking at:
Line 20 in 5929958
browsers: [process.env.TRAVIS ? 'Firefox' : 'Chrome'], |
I assume TRAVIS
is not set anywhere :)
Beautiful!! 🐱 |
@josevalim, yes, the karma tests run and pass for me okay.
I can add the built results in
|
@josevalim, @jonatanklosko, should we also update to Node.js 16 LTS in the Github checks? It was released 2021-04-20 and is what I'm running locally with successful results. Come to think of it, I wonder if that might be worth trying to see if it solves the CI esbuild installation issue? |
@josevalim, I think using a newer version of Node.js may be the way to go: evanw/esbuild#1707 I'll add a commit updating |
Sounds like a good idea to me! |
Hopefully this will allow for the esbuild package to be installed. actions/checkout also updated to v3. Step names are also removed for consistency.
@DavidOliver I think the Elixir suite will require the precompiled assets. :) |
Thanks! :) I think it's just the question of whether or not include Firefox in the JS tests left. Let me know either way and I'll simplify the karma config accordingly. Edit: the remaining check seems to have hung on a post-run action, but the tests passed. Edit 2: the check has finished after a good few minutes. |
Should I also update the checkout action from v2 to v3 for the mix_test job? |
It is your call :)
Sure! |
A few more commits pushed. Please check you're happy with the change to LICENSE. I plan to add a development/watch task, but will come back to that another day. |
💚 💙 💜 💛 ❤️ |
MASSIVE effort, thank you! |
And building it is so much faster! |
Thank you so much! |
Works also perfectly fine with latest Node version (18.9.0). |
No problem. I don't yet have any Elixir libraries to document, but I'm glad to have been able to help simplify here. Thanks to you and everyone who provides tools and docs! @cw789, great - good to know. |
Regarding #1542
Please note that when the formatters directory is updated with the results of the new build process, the
formatters/html/fonts
directory should be deleted as the font file is now placed in the dist directory along with the JS and CSS.I didn't get anywhere with the two available esbuild Handlebars loaders, so the assets build script instead precompiles the Handlebars templates.
The HTML formatter's digest function has been updated to produce 8- character uppercase hashes in order to match those generated by esbuild.
The ESLint config was re-initiated and now uses its default parser (Espree), so Babel is no longer required.
For the Elixir-based tests to result in up-to-date build dist contents I found I had to empty the
_build
directory.Karma-run tests
I found that simply swapping out webpack for esbuild in
karma.conf.js
resulted in all tests continuing to pass. I haven't provided any advanced configuration or details of build config for esbuild here, which I was (erroneously?) expecting I'd have to. 🚨 Please check you're happy with this config before merging. 🚨npm packages
Before
After
Build task
Before
After
Build results
Before
After