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
feat: New Build System based on esbuild #12883
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
surajshetty3416
changed the title
feat: New Build System based on esbuild
build: New Build System based on esbuild
Apr 17, 2021
netchampfaris
changed the title
build: New Build System based on esbuild
feat: New Build System based on esbuild
Apr 17, 2021
- Deprecate use of build.json - *.bundle.js files placed anywhere in the public folder are bundled - Built files are created in public/build folder which is gitignored WIP
- add support for multiple file types
Previously email.css files were explicitly picked from hardcoded path like public/css/email.css for all apps
Ignore the commit which replaces use of Class.extend with native class in git blames
Jinja helpers to load js, css assets
+1 for this 🎉 |
- Promisify frappe.require
- Separate file to import jquery and bootstrap - Remove separate jquery bundle from app as well as web - Load jquery from node_modules
- basic watch mode - Node paths include all app node_modules and app folders - rename output directory to "dist" - output files in flat directories: dist/js and dist/css
- For better HTTP caching and cache busting - assets.json is created under [app]/dist folder which contains the map of input file and output file name, this is used to get the correct path for bundled assets
surajshetty3416
approved these changes
May 18, 2021
@centaur78 Thanks for reporting. Fixed frappe/erpnext#25753 |
My preliminary issues with
|
@netchampfaris Hello! Are there plans to backport this to v13? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A new build system based on the Go-based Javascript bundler https://github.com/evanw/esbuild.
Files types supported: .js, .ts, .css, .scss, .sass, .less, .styl
public/dist
folder which is gitignoredThis means every JS/CSS asset will always be under it's respective app folder in the assets folder. For e.g., desk.js will be at
/assets/frappe/dist/js/desk.bundle.js
. Previously, it was at/assets/js/desk.min.js
.Build Stats
Macbook Pro 15 inch 2019, 2.6 GHz 6-Core Intel Core i7, 16GB RAM
Build using rollup: 48.31s
Build using esbuild: 3.948s (~12x faster)
~/Projects/benches/frappe-bench/apps/frappe esbuild 55s ❯ node esbuild frappe/public/build/js/controls.bundle.js 1087.445 Kb frappe/public/build/js/desk.bundle.js 995.973 Kb frappe/public/build/js/desk.bundle.css 423.239 Kb frappe/public/build/js/form.bundle.js 1173.14 Kb frappe/public/build/js/frappe-web.bundle.js 439.292 Kb frappe/public/build/js/libs.bundle.js 981.026 Kb frappe/public/build/js/list.bundle.js 169.587 Kb frappe/public/build/js/report.bundle.js 170.955 Kb Build time: 3.948s
DigitalOcean $5 Droplet, 1vCPU, 1GB RAM
Build using rollup: 386.77s
Build using esbuild: 15.510s (~25x faster)
frappe@frappe-esbuild-test:~/frappe-bench/apps/frappe$ node esbuild frappe/public/build/js/controls.bundle.js 1088.901 Kb frappe/public/build/js/desk.bundle.js 997.065 Kb frappe/public/build/js/desk.bundle.css 421.238 Kb frappe/public/build/js/form.bundle.js 1175.061 Kb frappe/public/build/js/frappe-web.bundle.js 438.942 Kb frappe/public/build/js/libs.bundle.js 981.026 Kb frappe/public/build/js/list.bundle.js 171.251 Kb frappe/public/build/js/report.bundle.js 170.798 Kb Build time: 15.510s
Features
CLI Output
Build Events in browser
WIP
Other changes
[app]/public/email.css
Documentation