Code Monkey home page Code Monkey logo

Comments (4)

mohsen1 avatar mohsen1 commented on May 6, 2024

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.

simevidas avatar simevidas commented on May 6, 2024

@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.

sebmck avatar sebmck commented on May 6, 2024

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.

simevidas avatar simevidas commented on May 6, 2024

Looks like, it’s mostly polyfills. Ok then.

from babel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.