GithubHelp home page GithubHelp logo

Comments (7)

alexeagle avatar alexeagle commented on June 2, 2024 1

@kamalmarhubi I agree you need the ability to get any specific version. I'll look into platforms, but the simple answer is to change the node_repositories rule to allow you to pass a label for the the node (for each OS). You don't want it on nodejs_binary because then you could have different node version for different binaries in the same repo, which I think is a bad idea.

In addition to allowing you to specify any version, I just saw that Node 8 is now LTS so we should upgrade the default version that ships with the rules.

from rules_nodejs.

alexeagle avatar alexeagle commented on June 2, 2024

I think we ought to support LTS versions of node - that means according to the schedule we should do it next month. https://github.com/nodejs/LTS

from rules_nodejs.

kamalmarhubi avatar kamalmarhubi commented on June 2, 2024

I'd strongly advocate for making the version user specified. We've had serious issues with even minor version bumps, and would need to be able to choose the node version we use.

from rules_nodejs.

alexeagle avatar alexeagle commented on June 2, 2024

Fair enough. The only hard part I see is that I need a URL to fetch node from, and it's platform dependent, plus I have manually mirrored the current version to our CDN
https://github.com/bazelbuild/rules_nodejs/blob/master/internal/node_install.bzl#L29
So I'm not sure how the user would express this dependency. Maybe it's sufficient just to give the choice of major versions (6,7,8,9).

Also I have to pick which node versions these rules are tested against. And we want rules to be portable, so if you write a node program requiring 8, then all users must upgrade. Of course that problem exists without Bazel involved.

from rules_nodejs.

kamalmarhubi avatar kamalmarhubi commented on June 2, 2024

For ease of use, the current setup is great. If adding flexibility, major version is not enough for us. For example, a patch upgrade from 4.8.2 to 4.8.4 caused segfaults in production for one of our services because of issues with a native module at that version. So it's important to be able to hold back certain nodejs_binary targets.

I was reading about platforms earlier, and it seems that might be the right way to go about this. Users could define toolchains like node_6.11.3 and so on, or something like that? I haven't really understood the whole thing that well, and definitely haven't understood how toolchain resolution works.

As an intermediate that requires less fussing around with new concepts, the nodejs_binary rule could take a label to specify the nodejs executable to run. This lets users have very fine control where needed. Thoughts?

from rules_nodejs.

Globegitter avatar Globegitter commented on June 2, 2024

rules_go also allows to swap out the version of the go sdk, might be worth synchronising with how it is done there.

from rules_nodejs.

alexeagle avatar alexeagle commented on June 2, 2024

Fixed in #183

from rules_nodejs.

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.