Comments (4)
If I understood it right, 6to5 doesn't require loading any JavaScript in your project (browser or node) to operate. It generates pure ES5 code which can run in environments that do not support ES6 yet.
For example this ES6 code will get converted to the following code that can run in Node and browser without requiring --harmony
in Node or ES6 flags enabled in the browser
ES6
let arr = [1, 2, 3].map((item) => item * item);
generated ES5
(function () {
var arr = [
1,
2,
3
].map(function (item) {
return item * item;
});
}());
from babel.
@mohsen1 If it’s “that easy” to transpile ES6 to ES5, why does Traceur require a 75KB runtime to do the “same thing”. That’s what I’m trying to understand. I’m assuming there’s some advanced stuff in those 75KB that 6to5 is lacking, hence my inquiry.
from babel.
Traceur includes a mess of polyfills and emulates modules with a loader, store etc so it has to include a runtime because of these requirements. You can see an example of the fully built runtime here.
from babel.
Looks like, it’s mostly polyfills. Ok then.
from babel.
Related Issues (20)
- [Bug]: `using` in `switch` is not compiled
- [Bug](Typescript): Duplicate declaration error happens when a imported type and function has a same name HOT 4
- Yarn failing on CI on Windows HOT 6
- [Bug]: Cannot find package '@babel/plugin-preset-env' imported HOT 3
- [Bug]: babel compile `proposal-explicit-resource-management` different from `tsc` HOT 6
- Node.js require(esm) and __esModule
- Cleanup `NodePath` methods
- [Bug]: Babel is loading globals ^11.1.0 which breaks eslint ^9.0.0 (current version of globals is 15.0.0) HOT 4
- [Bug]: Fragment child elements are not transformed correctly when using @babel/plugin-transform-react-constant-elements HOT 2
- [Bug]: Incorrect tree-shaking during production build when using decorators with webpack HOT 2
- [Bug]: asyncToGenerator insert after comments of the next function HOT 1
- path remove fail HOT 2
- [babel 8] Cleanup parser plugins HOT 3
- [Bug]: @babel/register does not load ESM modules from node_modules in node v22 HOT 1
- [Bug]: Error parsing TypeScript generics on left-hand side HOT 1
- [Bug]: Object rest, side effect order and function scope HOT 1
- [parser] Expose somehing like `program.extra.async` to easily know if a module uses top-level await HOT 3
- `BatchRenamer`, 100x faster `scope.rename` when you have many identifiers to rename HOT 5
- [Bug]: Crash with decorators on anonymous class expression HOT 1
- [Bug]: Auto-accessors should use `this` rather than the class name HOT 1
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 babel.