Comments (2)
Thoughts
From my point of view libraries should not be transpiled, only if written in Typescript (then transpiled to ES version supported by our Node version (currently ES2022
)), as I would always recommend transpiling all dependencies to make sure there is no compatibility issue.
This way we could provide smaller bundles as we only need to include polyfills once in the apps and do not have them duplicated within all dependencies / libraries.
Moreover I would recommend simply using ESBuildMinifyPlugin
on Apps, which is a lot faster then running babel-loader
on every dependency, of cause one would need to include polyfills as well, but this can be handled by webpack-plugin-corejs
.
See build time and size comparison data below.
But on a long term I would love to see nextcloud support ES6 modules as scripts, all of out target browser support ES6 natively, the only problem is nextcloud-server which does not support adding ES6 scripts (missing type="module"
on script tag).
See also comparison data below why this would yield much better performance.
Build time and size comparison
Tools | Build time | Output filesize (sum) |
---|---|---|
current webpack + babel (only own source) + terser |
21065 ms | 26580 KiB |
webpack + babel (everything) + terser | 25375 ms | 22356 KiB |
webpack + esbuild + terser | 20581 ms | 26688 KiB |
webpack + esbuild | 12811 ms | 28260 KiB |
webpack + swc | 13753 ms | 27500 KiB |
vite (ES6) | 7564 ms | 11476 KiB |
from standards.
From my point of view libraries should not be transpiled, only if written in Typescript (then transpiled to ES version supported by our Node version (currently ES2022)), as I would always recommend transpiling all dependencies to make sure there is no compatibility issue.
I second that.
It will also cleanup our code and libraries boilerplate
But on a long term I would love to see nextcloud support ES6 modules as scripts, all of out target browser support ES6 natively, the only problem is nextcloud-server which does not support adding ES6 scripts (missing type="module" on script tag).
A different discussion, but seeing the table you posted, oh man, sign me up for webpack+swc already! 😱
The difference with what we do is really manageable I'd say
from standards.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from standards.