Skip to content

Loosen assertion so it matches any production error - #8907

Merged
acdlite merged 2 commits into
react:masterfrom
acdlite:fiberproderrorcode
Feb 2, 2017
Merged

acdlite merged 2 commits into
react:masterfrom
acdlite:fiberproderrorcode

Conversation

@acdlite

@acdlite acdlite commented Jan 31, 2017

Copy link
Copy Markdown
Collaborator

This test was failing because the error code didn't match. The specific error code isn't important.

@sophiebits sophiebits left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess this is fine, but does this mean the message is different?

@gaearon

gaearon commented Jan 31, 2017

Copy link
Copy Markdown
Collaborator

I would assume it means it is crashing for a different reason.

@sophiebits sophiebits left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we figure out why this is different?

The exact error code isn't important.
@acdlite

acdlite commented Feb 2, 2017

Copy link
Copy Markdown
Collaborator Author

It was because the message was slightly different, which I fixed in 2afcf6e

I figured loosening the invariant made sense, anyway.

Although after rebasing, now I'm having a different problem where the error code transform isn't picking up that invariant, but works for other invariants in the same file. Weird.

@acdlite

acdlite commented Feb 2, 2017

Copy link
Copy Markdown
Collaborator Author

Ah, the message is the same as Stack but the template string passed to invariant is different. I'll change.

Also, we haven't run gulp react:extract-errors in a while. Should we automate that?

@acdlite

acdlite commented Feb 2, 2017 •

Copy link
Copy Markdown
Collaborator Author

I guess it happens before release so it's not a big deal.

(Or does it...?)

@gaearon

gaearon commented Feb 2, 2017

Copy link
Copy Markdown
Collaborator

Yea, it's in the release guide so shouldn't be necessary.

The production error code system depends on the exact template string
that is passed to `invariant`. This changes the Fiber templates to
match the Stack ones.
@acdlite

acdlite commented Feb 2, 2017

Copy link
Copy Markdown
Collaborator Author

@spicyj Going to assume this is good to merge now that we know why the codes were different (they're the same now), since you approved it earlier.

@acdlite
acdlite merged commit 57d2d6d into react:master Feb 2, 2017
@sophiebits

Copy link
Copy Markdown
Collaborator

I don't think we should loosen this unnecessarily – even if format changes are okay, problems building the URL or similar could surface and be caught by the old test. Can we revert this? (If I rescind my acceptance then please don't consider a PR accepted.)

@acdlite

acdlite commented Feb 2, 2017

Copy link
Copy Markdown
Collaborator Author

Ok I'll revert it and open a separate PR without the change to the test.

@acdlite

acdlite commented Feb 2, 2017

Copy link
Copy Markdown
Collaborator Author

And sorry, I didn't intentionally ignore your review... I thought it was ambiguous whether you had "rescinded" it or not, since there were two reviews, hence my comment :D

@sophiebits

Copy link
Copy Markdown
Collaborator

Latest review wins. :)

acdlite added a commit that referenced this pull request Feb 2, 2017
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
Loosen assertion so it matches any production error
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
Loosen assertion so it matches any production error
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
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