RFC: Transpilation #147
Closed
magic-akari
started this conversation in
RFC
Replies: 2 comments 1 reply
-
Let me jot down something briefly:
I briefly talked to @magic-akari, and we are going to study how LLVM / Go handles these two layers. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I did some research today, I plan to port how its written in typescript. #915 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, SWC has designed two entrances, one is processed based on the ES version, and the other is processed based on the env target.
Along with this, SWC also exports a translation module for each ES version, which, in my opinion, adds some complexity.
I prefer esbuild's approach, but it can be improved.
two feature sets can be defined, one is the target feature set (referred to as
target
below), and the other is the current feature set (referred to ascurrent
below).Users write the latest code with features that may not always be supported by the target platform. Therefore we need to transpile it.
In general, the
target
range will be smaller than thecurrent
range.During the transpilation process, we continually modify the
current
to make it closer to thetarget
.This approach avoid some problems and bring several benefits:
current
, and make assertions.class
features are scattered across several ES versionsBeta Was this translation helpful? Give feedback.
All reactions