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

Prepare to upgrade to node 18 #3721

Open
humphd opened this issue Oct 18, 2022 · 3 comments
Open

Prepare to upgrade to node 18 #3721

humphd opened this issue Oct 18, 2022 · 3 comments
Labels
type: enhancement New feature or request type: research Requires researching and commenting what you have found

Comments

@humphd
Copy link
Contributor

humphd commented Oct 18, 2022

On Oct 25th, node 18 is becoming the active LTS version. We should see if we can switch over to use it everywhere.

It brings a bunch of new things, but among them is the global fetch() function, which should let us replace what we do now with got and node-fetch.

We should figure out what all the other features are that we can use, and make sure we update to use them properly.

@humphd humphd added the type: enhancement New feature or request label Oct 18, 2022
@sirinoks sirinoks added the type: research Requires researching and commenting what you have found label Oct 18, 2022
@sirinoks
Copy link
Contributor

Official NodeJS release notes

They added node:test module to replace additional testing tools like Jest that we use. We might want to consider replacing Jest in some places to see how it goes.
We don't have to though, it adds us an opportunity to, but it shouldn't break our existent tests. So, this might add potential issues about replacing jest tests in X place.

XMLHttpRequest reminds me of what Angular has..

With Streams API it's hard to say what we can do exactly, without knowing its limitations. But to throw some ideas - streaming our audio or video podcasts; perhaps generating some files out of blogs. For example, turn a blog post into a PDF.

I have no idea what to do with snapshot stuff.

And this is neat. Probably just for developers - checking what supported identifiers v8 has. Stuff like calendar, unit, timeZone.

@humphd
Copy link
Contributor Author

humphd commented Oct 18, 2022

The built-in test runner, node:test, isn't as advanced as Jest at this point. I don't think moving away from Jest is necessary until it improves.

But the other stuff is worth checking out. I also think they have a native "watch" mode now, like nodemon, but I don't know what it's called.

@sirinoks
Copy link
Contributor

sirinoks commented Oct 18, 2022

Just adding some info for people in here that are following:
About watch:
Running in watch mode using node --watch restarts the process when an imported file is changed.

I'm not sure if it's only for a file, or for a folder too. This could be useful for SSG related stuff? If we make changes to the original file, could just make an SSG reload and display new results. Ooooooh, could make people do a lab that implements this :D


I just realised, we can actually mix this in with Streams API, where we:

  • Make some file through a stream;
  • --watch it;
  • Make changes to the file using... WritableStream?
  • Changes are caught by the watch which would then reload our page and display new stuff.

I don't know why. But we can.
...
Waaaaait... Can we make and SSG, where we can edit its contents through the browser? For example, just change text in the page would actually write it to the original file. Which will become a new static original page now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request type: research Requires researching and commenting what you have found
Projects
None yet
Development

No branches or pull requests

2 participants