-
Notifications
You must be signed in to change notification settings - Fork 1
To Build or Not to Build
Frédéric Jouault edited this page Dec 15, 2022
·
1 revision
AnimUML can currently be used either built (all .js files merged into a single one by webpack, and possibly rewritten and minified by Babel) or not, both on the Web and in Node.js. Almost all modules can be loaded as is in the browser.
- no need to build after a modification, just reloading the page works
- slightly simpler debugging (no need to deal with source maps)
- less efficient to load
- but we can still use a built minified version for public deployments
- for workers (e.g., module AnalysisWorker), some browsers (e.g., Firefox) do not allow ECMAScript modules yet (see the MDN module documentation)
- worker code must therefore be built (at least transformed into non-ECMAScript modules) for these browsers
- but it is still possible to use the non-minified versions in Chrome, for instance, while debugging
- building has many advantages, which we do not get without building
- language translation, for instance:
- for parsers:
- for TypeScript support, which is not currently used in AnimUML
- faster transfer from server to browser
- packing everything in a single js file
- minification
- wider compatibility
- newer JavaScript features can be translated down to features supported by older JavaScript versions
- language translation, for instance: