Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Remove CJS from docs #4400

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

Merged
merged 2 commits into from
May 21, 2025
Merged

Remove CJS from docs #4400

merged 2 commits into from
May 21, 2025

Conversation

JoviDeCroock
Copy link
Member

No description provided.

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

Excellent; good riddance CJS! Should we add text to the intro saying you should be using an up to date version of Node 20, 22 or higher?

website/pages/docs/mutations-and-input-types.mdx Outdated Show resolved Hide resolved
@JoviDeCroock JoviDeCroock merged commit dd53d99 into 16.x.x May 21, 2025
35 checks passed
yaacovCR pushed a commit to yaacovCR/graphql-js that referenced this pull request May 27, 2025
@glasser
Copy link
Contributor

glasser commented May 27, 2025

Is this just a doc change or are future versions of graphql planned which will only support ESM?

@benjie
Copy link
Member

benjie commented May 29, 2025

@glasser I think with Node 20 and 22 now supporting require(ESM) and almost all bundlers favouring ESM, going ESM-only can't be that far away. I'm not sure if that's planned for v17 or not though, I think it's under discussion. Are you aware of a particular reason to go one way or the other?

@glasser
Copy link
Contributor

glasser commented May 29, 2025

@benjie I'm currently working on Apollo Server 5, a release that is focused entirely on updating dependencies (Node, Express, GraphQL-JS). A goal is to have a really simple migration that most people can implement quickly. We are considering making it require GraphQL v17, depending on whether v17 is likely to actually be released soon and how hard the migration will be. If it's not just a matter of updating uses of obscure GraphQL-JS features but actually changing your build system, that's definitely a bit more intimidating for an upgrade, which makes me feel more like we should make AS5 continue to support v16 as well... we'd like there to be no good reason not to do the AS4 to AS5 upgrade as soon as possible.

That said I'm a bit out of date on CJS vs ESM these days and maybe with require(ESM) support most use cases that work with GraphQL-JS v16 will work fine with an ESM-only build out of the box?

@benjie
Copy link
Member

benjie commented May 29, 2025

require(ESM) is still relatively new, but that they backported it from 22 to 20 (which is in maintenance mode) indicates they have strong confidence in it. I've not yet experimented with it much myself yet; going ESM only 2-3 years ago was something I had to reject due to too many issues, but now I think it's probably worth revisiting.

yaacovCR pushed a commit that referenced this pull request May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.