Git Product home page Git Product logo

Comments (7)

sindresorhus avatar sindresorhus commented on June 22, 2024

Nah, peerDeps is a mess. It's also most likely being removed eventually: npm/npm#5080

This makes it so that if I need to require regenerator, I have to do require('gulp-regenerator/node_modules/regenerator')

Have regenerator as a direct dependency if you need it: require('regenerator')

from gulp-regenerator.

jlongster avatar jlongster commented on June 22, 2024

peerDeps has undesirable edge cases, but until npm has a better way to support plugins, I think it's good enough. Lots of other plugins use it fine. It would be a bigger problem to install regenerator as a direct dependency, as I now have two versions, and both could be wildly different versions!

I'm open to options other than peerDeps, like not even listing the dependency, but I don't see how it's not far worse to have 2 different versions installed.

from gulp-regenerator.

sindresorhus avatar sindresorhus commented on June 22, 2024

Why do you need this? What's the use-case for needing this plugin and require the same version of regenerator directly?

from gulp-regenerator.

jlongster avatar jlongster commented on June 22, 2024

It's core to how regenerator works: it has runtime that I need to import in node. I need to do var wrapGenerator = require("regenerator/runtime/min").wrapGenerator at the top of each file (automated by a build process, of course).

from gulp-regenerator.

sindresorhus avatar sindresorhus commented on June 22, 2024

So you use gulp-regenerator to transpile your Node code and then in that code require the runtime?

If so, couldn't you just use the https://github.com/sindresorhus/gulp-regenerator#optionsincluderuntime option?

from gulp-regenerator.

jlongster avatar jlongster commented on June 22, 2024

If I did that a copy of the runtime would be prepended on every single node source file, which is not desirable at all (not to mention breaks semantics if the runtime depends on any global state).

from gulp-regenerator.

jlongster avatar jlongster commented on June 22, 2024

Ok, it does look like the "right" way to do it is to keep this as a dependency, and after installing plugins run npm dedupe. I'll try that out from here, thanks.

from gulp-regenerator.

Related Issues (2)

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.