pulsar-edit / ppm

Pulsar Package Manager
MIT License
35 stars 13 forks source link

Migrate to (bundled) npm 8 or newer #61

Open DeeDeeG opened 1 year ago

DeeDeeG commented 1 year ago

Have you checked for existing feature requests?

Summary

Switching to (bundled) npm 8 or newer in apm.

My first plan would be to ask the author of https://github.com/atom-community/apm/pull/123 if it is okay to use their implementation at this repo. We can then verify whether it "just works" at that point, or needs more work for successful integration of newer npm into ppm.

What benefits does this feature provide?

Newer npm brings newer node-gyp.

Newer npm should be much faster than npm 6.

Allegedly, but I think in my personal use I have in fact seen it to be faster.

Newer npm will be supported further into the future.

In summary: Node 14 has npm 6. Node 16 has npm 8. Node 18 has npm 9.

Node 14 support ends 30 April, which is soon. We want to be on something newer for longer support.

Support timeline for various npm versions See NodeJS support timeline, that's what most of this is based off of: https://github.com/nodejs/release#release-schedule - Node 14 has come with npm 6 by default for a long time now. So npm 6.x has been implicitly sort of supported for all that time. Now [Node 14 is about to be end of life (on the 30th of April 2023)](https://github.com/nodejs/release#release-schedule). So that implicit support for npm 6.x will also be ending, or so the rumor is. - Node 16 comes with npm 8, so it will sort of implicitly be supported for a while, or rather at least until the 11th of September 2023 (https://github.com/nodejs/release#release-schedule). Node 16 support is actually ending quicker than usual, since it's the last version of Node on OpenSSL 1.1.1, OpenSSL 1.1.1 support is ending 11 September 2023, and newer Node is on OpenSSL 3. See: https://nodejs.org/en/blog/announcements/nodejs16-eol - Node 18 has npm 9, so we should be able to use that all the way until 30 April 2025. ---

Note: Most of the biggest churn and breaking changes happened in npm 7, if I recall correctly / in my subjective recollection.

This was around the time [GitHub acquired npm](https://github.blog/2020-03-16-npm-is-joining-github/) (!), and they (in my subjective opinion), went though a bit of a "move fast, break things" phase. They technically haven't stopped doing the "moving fast" part, I really wish they would focus more on testing changes with the ecosystem, but that is my bias as an end-user-testing-focused contributor to open source projects that apparently use some of npm's most obscure (and so least well preserved) features and quirks. It's just that many of their biggest ideas for "breakin' stuff" got expressed into code by the time npm 7.x was done, and so once we get over that hurdle of getting "somewhere past npm 7", npm 8 and 9 should hopefully be relatively somewhat smoother. ---

Any alternatives?

Alternatives are to stay on an unsupported npm version (npm 6)...

Which I prefer not to do long-term, so why not get out ahead of the (semi-official unofficial) EOL of npm 6?

Other examples:

No response

DeeDeeG commented 1 year ago

Hello @bongnv, I saw your pull request https://github.com/atom-community/apm/pull/123 over at atom-community/atom repostory.

Do you mind if I try that out for the Pulsar fork's ppm repository? Would you be interested in re-submitting the same changes as that PR but against this repository? Or would you mind if I post the commits (possibly rebased and with any other changes we find out might be needed) here as a new Pull Request?

Edit to clarify: I would ensure the original commit author metadata was intact so you would be credited for the contribution.

I appreciate the work you did before showing a way to get apm working with newer npm, so I wanted to see if ppm (an apm fork) could pick up where you left off rather than re-doing the same work you've already accomplished?

Thank you for considering.

Best Regards, - DeeDeeG