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

internal: fix inlineInvariant for cjs builds that require filenames with explicit extensions #3832

Merged
merged 2 commits into from
Feb 17, 2023

Conversation

yaacovCR
Copy link
Contributor

@yaacovCR yaacovCR commented Jan 19, 2023

Current build script rewrites invariant to avoid function call if invariant true.

However, the rewriting should take into account the import name as rewritten (by TS?):

Current output for cjs is:

const invariant_js_1 = require('../jsutils/invariant.js');

while the call is still:

typeof stream.initialCount === 'number' ||
invariant(false, 'initialCount must be a number');

yielding an error of the sort: invariant is not defined

@netlify
Copy link

netlify bot commented Jan 19, 2023

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
🔨 Latest commit dde36a1
🔍 Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/63eff56acc5bf200083901ee
😎 Deploy Preview https://deploy-preview-3832--compassionate-pike-271cb3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋

Supported commands

Please post this commands in separate comments and only one per comment:

  • @github-actions run-benchmark - Run benchmark comparing base and merge commits for this PR
  • @github-actions publish-pr-on-npm - Build package from this PR and publish it on NPM

@yaacovCR yaacovCR force-pushed the invariant-integration branch 6 times, most recently from 13d36e3 to c7b366c Compare January 20, 2023 07:11
@yaacovCR yaacovCR changed the title add integration tests for inline_invariant internal: fix inlineInvariant for cjs builds that require filenames with explicit extensions Jan 20, 2023
@yaacovCR yaacovCR added the PR: bug fix 🐞 requires increase of "patch" version number label Jan 20, 2023
Copy link
Member

@IvanGoncharov IvanGoncharov left a comment

Choose a reason for hiding this comment

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

Looks good!
We just need a comment documenting what we are testing in both files.
Otherwise ready to merge

@yaacovCR
Copy link
Contributor Author

Looks good! We just need a comment documenting what we are testing in both files. Otherwise ready to merge

Ready for review -- checks should pass once #3849 is merged.

@IvanGoncharov
Copy link
Member

@yaacovCR I rebased it on top of #3849 and merged it.

@IvanGoncharov IvanGoncharov merged commit d10acda into graphql:main Feb 17, 2023
@yaacovCR yaacovCR deleted the invariant-integration branch September 5, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: bug fix 🐞 requires increase of "patch" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants