Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about minimum Node.js version #16370

Merged
merged 1 commit into from
Dec 16, 2020
Merged

Add note about minimum Node.js version #16370

merged 1 commit into from
Dec 16, 2020

Conversation

ziotom78
Copy link
Contributor

Add a warning about the minimum supported version of Node.js in the
docs. (See issue #16369.)

@metagn
Copy link
Collaborator

metagn commented Dec 16, 2020

related #16054

@dom96 dom96 merged commit 3b963a8 into nim-lang:devel Dec 16, 2020
@@ -93,7 +93,10 @@ file. However, you can also run the code with `nodejs`:idx:

nim js -d:nodejs -r examples/hallo.nim

If you experience errors saying that ``globalThis`` is not defined, be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: better to write the error you got verbatim, makes it more likey a user will find this note:

ReferenceError: globalThis is not defined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you're right, but I feel that this message would still not be clear enough. The point is that the error pops up only if you include some libraries (e.g., random, time). However, the fact that Nim generates JS code that accesses globalThis means that Nim 1.4 and Nim devel are not being tested with versions of Node.js older than 14 (my guess that version 12+ is fine only comes from a quick read of the documentation of globalThis). It cannot be excluded that people using Node.js might experience other kinds of errors even when the generated JS does not contain globalThis, if the Node.js version they are using is not the same as the one used to test the Nim JS backend.

Do CI builds run tests using Node.js? If it is so, perhaps it is better to write explicitly in the documentation what is the minimum Node.js supported by Nim (12? 13? 14?).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps it is better to write explicitly in the documentation what is the minimum Node.js supported by Nim

I guess you just did with your PR, sort of. As mentioned, #16054 is related, to relax this requirement, but it's probably not worth it, updating node is easy enough IMO.

mildred pushed a commit to mildred/Nim that referenced this pull request Jan 11, 2021
ardek66 pushed a commit to ardek66/Nim that referenced this pull request Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants