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

Consider setting up a Webpack JS toolchain that supports Babel, minification, ... #22

Open
sheesania opened this issue Mar 2, 2021 · 0 comments

Comments

@sheesania
Copy link
Contributor

sheesania commented Mar 2, 2021

Currently, Centrallix JavaScript does not use any kind of compilation process or transpiling, minification, etc. Drivers for different kinds of widgets, for instance, just have their raw JS files linked directly in the HTML.

image

Building Centrallix JS with a tool like Webpack instead could allow for various benefits:

  • Babel transpilation, which lets you use modern ES6 JavaScript features while still retaining high browser compatibility. Having ES6 available means code can be much cleaner as well as more accessible to modern JS developers.
  • Minification, which can drastically reduce JS file sizes and thus make requests for them much faster.
  • Bundling, which can reduce the number of requests for JS files that need to be made to the server.
  • More extensive compilation with a tool like Google Closure, which can compress JS files even further.
  • It could be possible to start using TypeScript incrementally.
  • These are all very standard, widely used modern JS practices that would be familiar to any reasonably experienced JS developer.

However, implementing a Webpack toolchain could also have some downsides:

  • I'm not familiar with all the ins and outs of how Centrallix JS works, and wouldn't be surprised if some way it's set up would be difficult to integrate with Webpack and the kinds of JS architectures it's designed for.
  • As such, it might take a fair bit of work to get a Webpack toolchain working reliably.
  • Even though all of these tools are used and trusted widely, any kind of npm-based development involves complex dependency trees that some people see as security liabilities.
  • Using a toolchain like this always adds some complexity - more potential points of failure, more things to learn, more onboarding necessary for new developers.

More research on the pros and cons is needed, as well as more consideration of how high-priority a project like this would be.

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

No branches or pull requests

1 participant