tramvai
tramvai copied to clipboard
Have you considered building via ebuild or swc?
Hello!
About code transpiling, we have a two targets:
-
babel
as default transpiler -
swc
as experimental transpiler
At this moment, unfortunately you can't use swc
transpiler, because of our File-system routing depends on loadable-components
babel plugin.
There is no official swc
plugin - https://github.com/gregberge/loadable-components/issues/529, exists only custom Next.js
implementation.
Our future plans, when swc
plugin system will be more stable (e.g. https://github.com/swc-project/swc/issues/2175 problem will be solved), to convert our important babel plugin to swc
and present this loader officially.
About bundling, we also have a two targets:
-
webpack
as default bundler -
vite
as alternative
But unlike swc
case, we have no implementation with vite
.
For today, we just completed some preparation to made our @tramvai/cli
bundler-agnostic.
@SuperOleg39 I like vite, can u provide an example?
We don't have examples, only ticket in our backlog)
As a preparation, webpack was separated to builder
abstraction - https://github.com/Tinkoff/tramvai/tree/main/packages/cli/src/builder/webpack, this is all what we have at this moment.
There is no official swc plugin - https://github.com/gregberge/loadable-components/issues/529, exists only custom Next.js implementation.
It's not a custom next.js
implementation. Next.js doesn't do anything new to SWC per se, it's just that that plugin is packaged inside a next.js repository, nothing else.
It's even published on npm and available for download and usage.
https://npmjs.com/package/@swc/plugin-loadable-components
Oh, I did not look at the dates 😄
Pardon me
Yes, @swc/plugin-loadable-components
is new and shiny)
Anyway, next has their own plugin - https://github.com/vercel/next.js/blob/canary/packages/next-swc/crates/core/src/next_dynamic.rs - port of Babel version, which was fork of loadable Babel plugin))
Soon we will finish our swc
integration, and already fork this new @swc/plugin-loadable-components
- https://github.com/Tinkoff/tramvai/tree/main/packages/swc/plugins/lazy_component
Full swc
support is finished, and last changes shipped in v2.49.3
version!
After enabling swc loader, cold start for develompent build will be improved significantly.
Warm start and rebuild have a some small improvements, because of webpack@5 file-system caches