Skip to content
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

Add initial example of using esbuild #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

garrettjstevens
Copy link
Collaborator

From pairing with @cmdcolin today.

For the simple template plugin, using esbuild seems to work just fine. This needs to be tested with more types of pluggable elements and generalized (e.g. don't hardcode globalName in the build file).

Initial results show that building a single development mode output file using template takes 2.39s for rollup and 0.09s for esbuild.

With this build file, esbuild will also watch and rebuild files as well as serve the output.

Example:

$ yarn node esbuild.mjs 
yarn node v1.22.19
Serving at http://localhost:9000
Watching files...
Built in 8 ms with 0 error(s) and 0 warning(s)
Wrote 5.17 kB to dist/out.js
...
Built in 15 ms with 0 error(s) and 0 warning(s)
Wrote 5.17 kB to dist/out.js

Resolves #43

@cmdcolin
Copy link
Contributor

can confirm this example also works with the proteinview3d. do you think this example would be good to have in a separate repo or integrated here? i sometimes like the idea of having a variety of setups

@garrettjstevens
Copy link
Collaborator Author

I like the idea of having a couple different options, although it might be good to think about how we want to keep the code in src synchronized if we have multiple repos.

Also, the esbuild option here only produces a web bundle, it doesn't produce something that could be published to and installed from NPM by an app using the embedded components.

@cmdcolin
Copy link
Contributor

random data point: i have been using the esbuild setup with some good success in the msaview and proteinview plugins. turns out, the rollup production build is like, 4% and 2% larger respectively for both.

this almost makes me question a little bit whether it's worth spending extensive time on the rollup config, as much as i love even small bundle size savings, as i was even unable to use jbrowse-development-tools rollup config to compile nullish coalescing (i believe that is what i observed at least in GMOD/jbrowse-plugin-msaview#36)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add example of using esbuild
2 participants