Comments (2)
Findings
Currently, when using swc
for typescript projects, we are still required to run tsc
to generate the .d.ts
files. This is the most time-consuming part of the build (taking around 40 sec to finish). The swc
compiler takes only half a second to finish.
âšī¸ Our current build structure takes 110 seconds to generate the
dist
folder.
swc
is planning to generate the .d.ts
files by itself as it's mentioned in this article (and this issue) which will allow users to get rid of tsc
. It will also be able to bundle the files, so it may replace rollup
itself.
On the other hand, the Typescript team seems to be aware that there's room to improve the tsc
building/type-checking speed, they just don't seem to prioritize that right now, but there's a possibility that they do something about it in the future.
Test results
I was able to build the lib using swc
+ tsc
.
The whole process took 45s.
Caveat
SWC doesn't seem to support Tree Shaking right now (detected by inspecting the .next
dir of the target app), and it's a mandatory point to allow us to go forward on it, once we currently have this optimization.
According to the
swc
project it should be implemented (ref 1, ref 2 - via spack), but this package doesn't exist at this moment (IDK if existed already or if it's still to be done).
Conclusion
From here, we should:
- Keep the current build structure (maybe just upgrade the libs used) and wait for
swc
to be ready to support Tree Shaking and generate.d.ts
files. Use combination ofswc
+tsc
to have the build working 2,5x faster, having in mind thatswc
is under heavy development.
from faency.
Closing with conclusions validated
from faency.
Related Issues (20)
- [Firefox] Button styles are not applied in the expected order HOT 1
- [Table] Tr interactive, add focus feedback
- [React] upgrade to react 18 HOT 1
- [Skeleton] inferred height is bigger than expected
- Improve package quality with package-check
- Semantic release: rate limited HOT 2
- Cannot upgrade Storybook: storybook dark mode is bugged
- [IconButton] Add cursor pointer behavior when hovering
- [Badge] "as" prop does not exist on type for Badge HOT 1
- [Study] `outline` HOT 3
- Ensure interactive elements are tabbable and focus is visible for UX
- V4 release is not compatible with jest tests HOT 1
- [RFC][Study] Vite for bundling and storybook
- [Card] interactive: pressed behavior broken HOT 1
- [Progress] Add progress component HOT 1
- Tabs component
- [docs] Right documentation for the usage of FaencyProvider
- Navigation tree component
- Implement collapsible table row component
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 faency.