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

Editor front end build process update #781

Closed
ellthompson opened this issue Jun 1, 2022 · 1 comment
Closed

Editor front end build process update #781

ellthompson opened this issue Jun 1, 2022 · 1 comment
Assignees

Comments

@ellthompson
Copy link

ellthompson commented Jun 1, 2022

The editor build process currently involves concatenating a set of front end scripts together, which is output here. These scripts contain a mix of ES6 and ES5 syntax and any script dependencies are shared using the browsers global namespace.

I am proposing that we introduce a JS bundler to the editors build process, giving us more control over how we build it's front end. It would enable us to make the following changes to the build:

  • Compress the front end code to reduce the editor download size (should also include source maps to enable in browser debugging)
  • Integrate the editor front end more closely with our open source projects (import dependencies directly from the engine / pcui / observer etc as and when needed)
  • Enhance the development process with watch tasks / build analytics / transpiler checks
  • Introduce ESModules into the front end codebase, allowing us to explicitly define what each scripts imports / exports

To keep the editor consistent with our open source projects, rollup can be used as the bundler.

The introduction of this build process should not drastically change the output of the editor.js file as I imagine the initial update would maintain the current structure of the code base, with scripts depending on globally defined variables. However with the introduction of ESModules, it will be possible to slowly remove all of these global dependencies from the codebase over time. This could have an impact on external editor scripts / extensions which depend on certain global variables. It would be important during this transition that any extensions use only on our open source offerings (editor-api / pcui etc), where any breaking changes can be tracked.

@ellthompson
Copy link
Author

Closing this issue as the editor front end now utilises ESModules and a rollup based build process.

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

No branches or pull requests

3 participants