GithubHelp home page GithubHelp logo

Comments (6)

nicolo-ribaudo avatar nicolo-ribaudo commented on May 18, 2024

Defaulting to per-file will produce an enormous output for some polyfills like es-shims, but I can:

  • Reduce the delay from 1s to maybe 100ms
  • Remove the delay for core-js, where it's mostly not needed.
  • Only delay if there is actually a missing dependency to log.

from babel-polyfills.

ljharb avatar ljharb commented on May 18, 2024

Can you elaborate more on per-file and why its impact varies by polyfill provider?

from babel-polyfills.

nicolo-ribaudo avatar nicolo-ribaudo commented on May 18, 2024

When there is a missing dependency, this package logs about it.
We collect all the missing polyfills, and then log something like

Please run
  npm install polyfill-a polyfill-b polyfill-c polyfill-d

If we'd do that per-file, we cannot create a single command to copy-paste. It would look more like

Please run
  npm install polyfill-a polyfill-b
Please run
  npm install polyfill-c
Please run
  npm install polyfill-d

Where every log comes from a different file. core-js is a single package so it logs almost once, but for es-shims (which is a collection of a lot of different packages), it can log a very long list of commands to run (in the worst case, max(number of files, number of polyfills)).

from babel-polyfills.

ljharb avatar ljharb commented on May 18, 2024

gotcha. i guess i'm not sure why this needs to be debounced here instead of just ran once after everything's finished?

from babel-polyfills.

nicolo-ribaudo avatar nicolo-ribaudo commented on May 18, 2024

Because Babel plugins don't have the concept of "after compiling the project" but only "in this file" (this might change in the future, but not soon).

from babel-polyfills.

ljharb avatar ljharb commented on May 18, 2024

ah, that's a painful limitation :-/

from babel-polyfills.

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.