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

fix: support development on Node 20 #725

Merged
merged 38 commits into from
May 1, 2023
Merged

Conversation

nickserv
Copy link
Contributor

@nickserv nickserv commented Apr 22, 2023

This patches node-fetch so pnpm install works on Node 20: pnpm/pnpm#6424

I also added some updates and CI fixes.

This patches node-fetch so pnpm install works on Node 20: pnpm/pnpm#6424
@nickserv nickserv changed the title chore: test on all supported Node versions fix: support development on Node 20 Apr 22, 2023
Copy link
Member

@ssalbdivad ssalbdivad left a comment

Choose a reason for hiding this comment

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

The fix for Node 20 is much appreciated, but as far as I can tell that only requires updating pnpm.

The rest seem to functionally change what the CI process is doing to not align with what I had originally intended, so I'm a little unclear as to the motivation for these changes.

If you could clarify some of that for me, it would be super helpful!

@nickserv
Copy link
Contributor Author

nickserv commented Apr 26, 2023

I originally planned on just updating pnpm, but I wanted to make sure it would be properly tested in CI so I could work on #726, so I was a bit over-cautious since I couldn't start the CI builds myself. Sorry for any confusion/noise!

@ssalbdivad
Copy link
Member

@nickmccurdy No problem! If you want to just update this to include the pnpm version bump I will happily merge it 😊

This reverts commit cf6f507.
@nickserv

This comment was marked as resolved.

@ssalbdivad
Copy link
Member

Right now the only change I understand the motivation for is the pnpm upgrade, but let me know if there is something else you think should be changed. It looked like most of what was in the initial PR were things that were set the way intentionally.

Definitely appreciate your help and looking forward to figuring out the best way to go about some of this! I'm sure there are improvements that could be made

@nickserv
Copy link
Contributor Author

nickserv commented Apr 26, 2023

The build is failing on main. Maybe we should run pr checks on push too? Also this pr's build won't start, but unsure why.

The remaining changes in this pr we haven't already discussed:

  1. Updating to pnpm 8 for performance (but may break Node 14, see above)
  2. Checking format in CI and fixing existing formatting issues

.github/workflows/pr.yml Outdated Show resolved Hide resolved
.github/workflows/pr.yml Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@ssalbdivad
Copy link
Member

I'm not sure how the formatting got out of sync that sometimes causes diffs like the one in this PR for isEven.

My guess is that it has to do with the docgen process that occurs in CI when a new version is released. Maybe somehow after that runs not everything is properly reformatted?

@ssalbdivad
Copy link
Member

ssalbdivad commented Apr 26, 2023

Also this pr's build won't start, but unsure why.

I updated the repo's settings to run workflows on a user's first PR for the repo, so hopefully that will resolve the issue (previously I was being prompted to manually approve them for this PR).

@nickserv
Copy link
Contributor Author

I extracted pnpm checkFormat but it's still failing.

@ssalbdivad
Copy link
Member

Huh, so you ran format locally, got this result and pushed it, then it fails the CI check?

What happens when you run format then check format locally?

@nickserv
Copy link
Contributor Author

Yes, though pnpm checkFormat also fails locally. Every time I run Prettier, it wants to indent narrow.md one level deeper. I think this is a bug.

@nickserv
Copy link
Contributor Author

Now the format of README.md is wrong on CI, but not locally, using the same environment. I have no idea what's causing this since POSIX systems should always be using LF with git. This is probably either a bug or bad git config.

@ssalbdivad
Copy link
Member

ssalbdivad commented Apr 27, 2023

@nickmccurdy 😵 I mean, the formatting issue should be relatively minor and if someone does end up pushing incorrectly formatted code, if it's really bad, it should be apparent during PR, and if it's minor, it will just be fixed as soon as anyone else merges code, so I'm not super worried about that if it's a hassle.

I'm watching the issue you mentioned , definitely seems pretty critical for them to address so hopefully will be resolved soon.

It's honestly just too much for me to add all those super verbose cross-env NODE_OPTIONS=\"--loader=ts-node/esm\" prefixes every time we want to use ts-node, so I'd rather just wait on that issue to be fixed then merge the original version.

@nickserv
Copy link
Contributor Author

I think it's important to still fix this in the interim, as you basically can't develop locally with the latest stable version of Node until this is merged. ts-node is also known to lag behind in support. If you want to eliminate tech debt, it would probably be simpler to just replace it with a more modern compiler.

@ssalbdivad
Copy link
Member

@nickmccurdy Yeah I buy that, would you be willing to replace it with one of the more modern options? I'm honestly not particularly invested in how our TS is executed during dev as long as it works.

@ssalbdivad
Copy link
Member

@nickmccurdy Hey trying to get the Node 20 stuff integrated with some test changes we just merged.

It's honestly been really rough unfortunately tons of rough edges with the breaking changes to loaders. Had issue with both ts-node and tsx.

Anyways, I'll wrap up this PR now that there's a bunch of crazy changes on it and I have the context needed, so thanks so much for your help and hopefully the next node release will be smoother 🙏

@ssalbdivad
Copy link
Member

@nickmccurdy Welp I've spent many hours on this and it's just problem after problem with Node 20. For now I'm going to give up on this and merge some of the changes I've made and disable Node 20 in CI 😔

If you have any more ideas about how to resolve this stuff after I merge, please feel free to take a stab at it:

#738

@ssalbdivad ssalbdivad merged commit a50a2d4 into arktypeio:main May 1, 2023
@nickserv nickserv deleted the fix-node-20 branch October 26, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (merged or closed)
Development

Successfully merging this pull request may close these issues.

2 participants