Code Monkey home page Code Monkey logo

Comments (4)

LinusU avatar LinusU commented on June 19, 2024

I think that transpiling code is something that must be done by the end user in this case, since there is no way for us to know exactly which browsers/environments they are targeting. It's my opinion that it's better for all code on npm to use the latest language features, and then someone building a website can configure their build process to transpile accordingly...

from clipboard-copy.

Yankovsky avatar Yankovsky commented on June 19, 2024

Usual babel setup only transpiles project's source code and doesn't touch node_modules. Most of the libraries target ES5 as a base case and sometimes they also provide additional target like esnext.
I understand what you are saying, but in my opinion it is unexpected of library not to support ES5.

from clipboard-copy.

LinusU avatar LinusU commented on June 19, 2024

Transpiling async/await syntax comes with a very large overhead, which will probably balloon the size of this library way over the 508 B gzipped that this library currently comes in at. It would be interesting to test and see the difference...

It seems like a bad approach that all newer browsers should pay the price of running older code, even on websites that aren't even supporting older browsers?

from clipboard-copy.

Yankovsky avatar Yankovsky commented on June 19, 2024

I thought of something like this https://github.com/xobotyi/scrollbar-width/blob/master/package.json#L33
Here you have 3 targets, one of them "main" is es5.

from clipboard-copy.

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.