Skip to content

internal: use empty merge commit to clean up git diff from 16.x.x #4412

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 97 commits into from
May 31, 2025

Conversation

yaacovCR
Copy link
Contributor

@yaacovCR yaacovCR commented May 27, 2025

This no-op merge commit "pretends" to take in all of the changes from the 16.x.x branch since this branch was created from the 16.4 point release. These changes were actually cherry-picked from 16.x.x separately into this branch, but this merge commit allows us to pretend that the branch was created from 16.11.

IvanGoncharov and others added 30 commits May 9, 2022 19:30
…tional arguments (graphql#3645)

BACKPORT OF graphql#3634

Deprecates the positional arguments to createSourceEventStream, to be removed in the next major version, in favor of named arguments.

Motivation:

1. aligns createSourceEventStream with the other exported entrypoints graphql, execute, and subscribe
2. allows simplification of mapSourceToResponse

suggested by @IvanGoncharov
Co-authored-by: Yaacov Rydzinski  <yaacovCR@gmail.com>
…ql#3706) (graphql#3707)

Co-authored-by: Ivan Goncharov <ivan.goncharov.ua@gmail.com>
graphql#4022)

As surfaced in
[Discord](https://discord.com/channels/625400653321076807/862957336082645006/1206980831915282532)
this currently is a breaking change in the 16.x.x release line which is
preventing folks from upgrading towards a security fix. This PR should
result in a patch release on the 16 release line.

This change was originally introduced to support CFW and browser
environments which should still be supported with the `typeof` check CC
@n1ru4l

This also adds a check whether `.env` is present as in the DOM using
`id="process"` defines that as a global which we don't want to access on
accident. as shown in graphql#4017

Bundles also target `process.env.NODE_ENV` specifically which fails when
it replaces `globalThis.process.env.NODE_ENV` as this becomes
`globalThis."production"` which is invalid syntax.

Fixes graphql#3978
Fixes graphql#3918
Fixes graphql#3928
Fixes graphql#3758
Fixes graphql#3934

This purposefully does not account for
graphql#3925 as we can't address
this without breaking CF/plain browsers so the small byte-size increase
will be expected for bundled browser environments. As a middle ground we
did optimise the performance here. We can revisit this for v17.

Most bundlers will be able to tree-shake this with a little help, in
graphql#4075 (comment)
you can find a conclusion with a repo where we discuss a few.

- Next.JS by default replaces
[`process.env.NODE_ENV`](https://github.com/vercel/next.js/blob/b0ab0fe85fe8c93792051b058e060724ff373cc2/packages/next/webpack.config.js#L182)
you can add `typeof process` linearly
- Vite allows you to specify
[`config.define`](https://vitejs.dev/config/shared-options.html#define)
- ESBuild by default will replace `process.env.NODE_ENV` but does not
support replacing `typeof process`
- Rollup has a plugin for this
https://www.npmjs.com/package/@rollup/plugin-replace

Supersedes graphql#4021
Supersedes graphql#4019
Supersedes graphql#3927

> This now also adds a documentation page on how to remove all of these
Co-authored-by: enisdenjo <denis@denelop.com>
Co-authored-by: Denis Badurina <badurinadenis@gmail.com>
…raphql#4124)

Co-authored-by: Erik Kessler <erik.kessler1@gmail.com>
Co-authored-by: Benedikt Franke <benedikt.franke@mll.com>
Co-authored-by: Michael Hayes <michael@hayes.io>
Co-authored-by: Mike Ciesielka <maciesielka@comcast.net>
Co-authored-by: Saihajpreet Singh <saihajpreet.singh@gmail.com>
In response to some of our actions starting to fail deprecate all of the
actions that don't work anymore due to using Node 10/12

- [Looks like upload artefact is safe to
upgrade](https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md)
we don't seem to overwrite files
- [Same for
download](https://github.com/actions/download-artifact/blob/main/docs/MIGRATION.md)
sarahxsanders and others added 13 commits May 28, 2025 08:34
Adds "Nullability in GraphQL.js" guide
Adds page on authorization strategies, right after
authentication/middleware page

Also adds a "Before you start" section about using ESM syntax JS code
snippets

---------

Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
Updates "Going to Production" guide to cover a larger scope. The goal is
to cover most bases on what devs should consider before deploying to
production. I also added a checklist.

---------

Co-authored-by: Benjie <benjie@jemjie.com>
Adds guide on caching strategies

---------

Co-authored-by: Benjie <benjie@jemjie.com>
adds guide on Scaling your API, covering monoliths, schema stitching, and federation

---------

Co-authored-by: Benjie <benjie@jemjie.com>
Expands on graphql#4398 by recommending the trusted documents pattern which
90+% of GraphQL users should be using.
Adds new guide: Type Generation for GraphQL Servers

This is a part of the effort to expand GraphQL.js documentation

---------

Co-authored-by: Eddy Nguyen <github@eddeee888.me>
Co-authored-by: Benjie <benjie@jemjie.com>
Adds guide "Operation Complexity Controls"

---------

Co-authored-by: Benjie <benjie@jemjie.com>
This PR has some cleanup tasks:
- Reorganized the information architecture a bit so that sections flow
better
- Fixed broken links
- Fixed a code snippet that wasn't closed off/bleeding into a section
- Updated auth strategy guide w/ callouts for not using resolver auth in
production per @benjie request

Please let me know if there are any other tweaks I can include!

---------

Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
@yaacovCR yaacovCR force-pushed the with-empty-merge-commit branch 2 times, most recently from 51b2273 to 8ee936d Compare May 30, 2025 12:34
@yaacovCR yaacovCR marked this pull request as ready for review May 30, 2025 12:36
@yaacovCR yaacovCR force-pushed the with-empty-merge-commit branch 4 times, most recently from 4bb35bf to 21f2fcb Compare May 30, 2025 12:52
@yaacovCR yaacovCR requested a review from a team as a code owner May 30, 2025 12:52
@yaacovCR
Copy link
Contributor Author

This gets us to green when comparing (currently):

image

Or with

$ git merge-base --is-ancestor 16.x.x with-empty-merge-commit \
  && echo "✅ 16.x.x is ancestor of with-empty-merge-commit → fast-forward OK" \
  || echo "❌ no fast-forward possible (16.x.x is not ancestor of with-empty-merge-commit)"
✅ 16.x.x is ancestor of with-empty-merge-commit → fast-forward OK

Because all of the commits merged in by this PR have no code-changes, i.e. this is a no-op merge, git bisect will still work. However, we are still technically non-linear (git log --graph --oneline --decorate with-empty-merge-commit):

image

....

image

....

image

@yaacovCR yaacovCR force-pushed the with-empty-merge-commit branch from 21f2fcb to 7ef7355 Compare May 30, 2025 13:10
This no-op merge commit "pretends" to take in all of the changes from the 16.x.x branch since this branch was created from the 16.4 point release. These changes were actually cherry-picked from 16.x.x separately into this branch, but this merge commit allows us to pretend that the branch was created from 16.11.
@yaacovCR yaacovCR force-pushed the with-empty-merge-commit branch from 7ef7355 to f4f3ee7 Compare May 30, 2025 13:21
@yaacovCR
Copy link
Contributor Author

What else does this get us?

Well, after this, doing a compare in the reverse direction (yaacovCR/graphql-js@with-empty-merge-commit...graphql:graphql-js:16.x.x) will show us which commits are new on 16.x.x since we last did this, and could remind us what to cherry-pick. Now, for example, it will show us that we are completely up to date:

image

But the utility of that will fade immediately after we cherry-pick -- unless we do this no-op again.

@yaacovCR yaacovCR merged commit ef042cf into graphql:next May 31, 2025
16 checks passed
@yaacovCR yaacovCR deleted the with-empty-merge-commit branch May 31, 2025 18:55
@yaacovCR
Copy link
Contributor Author

Sigh. This didn't work because of the merge strategy used. We have to do it directly on the branch.

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.