Git Product home page Git Product logo

Comments (25)

rstacruz avatar rstacruz commented on May 13, 2024

ahh... i think i found a bug on Promise.all that bluebird fixed, hence the need for bluebird. i'll have to investigate a little more on that.

I'd still like to keep bluebird as a devdependency though. its stack traces are super useful.

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

the object-assign makes sense!

actually, i've been thinking on whether it should support legacy node.js versions too... not sure on that. being able to use arrow functions really cleans up the source considerably.

from pnpm.

davej avatar davej commented on May 13, 2024

My $0.02 is to keep the source clean for the moment and use the ES6 features that are available. Could always do a babelified mirror for older versions of node if there's a demand for it.

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

actually i can probably do something like this:

{
  "prepublish": /* convert lib/ to babel-ified versions */
  "postpublish": /* reset lib/ */
}

in which case it makes sense to keep bluebird/object-assign.

from pnpm.

davej avatar davej commented on May 13, 2024

Yup, I prefer the idea of doing this for a node 0.x fork though, and keeping the main lib unbabelified.

from pnpm.

davej avatar davej commented on May 13, 2024

Babel can polyfill Promises and Object.assign too by the way. Although perhaps it's best to keep bluebird for the reasons you mentioned.

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

Babel can polyfill Promises and Object.assign too by the way

using require('babel-polyfill'), afaik. I'd rather keep that out :)

from pnpm.

davej avatar davej commented on May 13, 2024

using require('babel-polyfill'), afaik. I'd rather keep that out :)

With Babel6, you selectively choose the polyfills so it's not much different than the object-assign polyfill currently being used. https://babeljs.io/docs/plugins/transform-object-assign/

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

okay, that's quite handy.

from pnpm.

davej avatar davej commented on May 13, 2024

Just going to lodge a πŸ‘Ž on babelifying the main lib. :-)

I'd prefer to keep the node 0.x version as a fork. Babel adds a layer of abstraction (albeit lightweight) to debugging and stacktraces.

from pnpm.

davej avatar davej commented on May 13, 2024

I suppose sourcemaps negate that a little bit but I still prefer the idea of keeping the main lib without it.

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

I'd prefer to keep the node 0.x version as a fork.

wouldn't a hard fork present a problem?

how about publishing a babelified version as "pnpm-legacy"?

from pnpm.

davej avatar davej commented on May 13, 2024

how about publishing a babelified version as "pnpm-legacy"?

Yup, that's what I meant. Fork was probably a confusing word to use. :-)

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

oh there's also --retain-lines, how aboout that one?

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

also, there's an idea of something like

install = isNodeVersion4orAbove
  ? require('lib/cmd/install')
  : require('lib.es5/cmd/install')

from pnpm.

davej avatar davej commented on May 13, 2024

oh there's also --retain-lines, how aboout that one?

I'd prefer to just use sourcemaps over --retain-lines, if it was between the two.

install = isNodeVersion4orAbove
  ? require('lib/cmd/install')
  : require('lib.es5/cmd/install')

Are you bundling two versions of the lib in that case (es5 and es6)? My preference would still be to have a separate pnpm-legacy module.

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

yeah. my only concern with publishing a pnpm-legacy module is that it isn't putting the users ahead first: it's essentially pushing the burden on the user.

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

I'd prefer to just use sourcemaps over --retain-lines, if it was between the two.

Does (modern) node.js support source maps?

from pnpm.

davej avatar davej commented on May 13, 2024

Does (modern) node.js support source maps?

Yup

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

#73 now adds inline source maps as part of the babel experiment. No idea if it works, haha.

from pnpm.

davej avatar davej commented on May 13, 2024

yeah. my only concern with publishing a pnpm-legacy module is that it isn't putting the users ahead first: it's essentially pushing the burden on the user.

Yeah, I look at it another way. You would be treating node >= 4 as a first class citizen, while still providing a path for Node 0.x users. The marketshare for 0.x will only continue to diminish over time. You can always decide to move the legacy version into core in the future if there's a demand... but it's much more difficult to move the other way because there will probably be people relying on 0.x support.

Just my 2 cents, obviously it's your module and your call though :-)

from pnpm.

davej avatar davej commented on May 13, 2024

Also, you can always console.log a descriptive error message telling users to install pnpm-legacy when run on node 0.x. It's not much of a roadblock really.

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

on the other hand it'd cause fragmentation. keep in mind the CLI isn't the only way to consume pnpmβ€”say, if ember-cli were to add pnpm support, they'd likely opt to use pnpm-legacy instead.

from pnpm.

davej avatar davej commented on May 13, 2024

Yeah, but the nice thing is that pnpm-legacy would be phased out over time. There may be a demand for it now but perhaps not so much in a couple of years time. And when demand goes away then you're not left in a position where you still need to transpile to support 1% of the user-base who are still using node 0.x.

Anyway, I see pros and cons both ways and my opinion is more of a personal preference really :-)

from pnpm.

rstacruz avatar rstacruz commented on May 13, 2024

I couldnt get the object-assign transform to work, btw. bummer

from pnpm.

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.