-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Convert React Apollo Generators to new TS scheme #515
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
kingston
merged 10 commits into
main
from
kingston/eng-661-convert-apollo-react-generators-to-new-typescript-system
Apr 26, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
41d75b5
Add rough implementation of react utils
kingston 3fb519b
Initial refactor of react apollo generator
kingston b2ce24d
Implement refactor of react apollo config and strip out old React aut…
kingston 2d467da
Fix generation and add lint:only command
kingston b398e71
Fix up react apollo generation
kingston c6c9212
Refactor toposort to allow more performant BFS version that can also …
kingston 4a03edd
Fix up apollo error generator
kingston 4a16da7
Add back eslint import sorting
kingston 0c74fa1
Fix up Apollo sentry
kingston ca27450
Fix knip
kingston File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Throwing on missing Auth0 may be too rigid—consider a graceful fallback
Both
compileAuthFeaturesandcompileAuthPagesnowthrowwhenuseAuth0is falsy.In projects where
includeAuthis true but the provider is intentionally left undecided, this hard-failure prevents the rest of the compilation pipeline from running (e.g. for mobile targets or future providers). Returningundefined(like the early-exit above) or a more descriptive, typedGeneratorDisabledErrorwould allow callers to ignore unsupported auth providers without crashing the build.Also applies to: 42-44
🏁 Script executed:
Length of output: 662
🏁 Script executed:
Length of output: 185
Gracefully disable Auth0 instead of hard‐failing
Both compileAuthFeatures (at lines 25–26) and compileAuthPages (at lines 42–44) currently do:
Throwing a generic Error here will abort your entire build whenever useAuth0 is false. To allow projects that includeAuth but haven’t picked a provider (or target platforms that don’t support Auth0) to continue:
• Change each function to return undefined when Auth0 is disabled (and update its signature to allow undefined)
• —or—
• Define and throw a custom GeneratorDisabledError so callers can catch and skip disabled generators
For example, in packages/project-builder-server/src/compiler/lib/web-auth.ts:
And similarly update compileAuthFeatures. Ensure downstream callers check for undefined (or catch your new GeneratorDisabledError) so the rest of the compilation pipeline can proceed.