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

Move registerCoreWithSerializer to its own file #9396

Merged
merged 4 commits into from Nov 21, 2023

Conversation

thebriando
Copy link
Member

↪️ Pull Request

This moves the registerCoreWithSerializer function to a different module to prevent circular dependency problems

💻 Examples

🚨 Test instructions

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

RequestGraph,
// $FlowFixMe[unclear-type]
}): Array<[string, Class<any>]>)) {
if (ctorToName.has(ctor)) {
Copy link
Member

Choose a reason for hiding this comment

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

Was this function somehow getting called multiple times now? Looks like this wasn't there before

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah we had a different check for this before https://github.com/parcel-bundler/parcel/pull/9396/files#diff-9575fdb466517de49a2fcba34666f6aafe312d93c8c66978f8d7e6b27464b792L51-L55

and I thought I needed to change it bc the function is called in Parcel.js and worker.js and I was running into this error

if (ctorToName.has(ctor)) {
throw new Error('Class already registered with serializer');
}

but the error was happening bc I had an unused import that was calling the function again. I'll change it back

Copy link
Member

@devongovett devongovett left a comment

Choose a reason for hiding this comment

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

lgtm

@thebriando thebriando merged commit d741b10 into v2 Nov 21, 2023
14 of 15 checks passed
@devongovett devongovett deleted the bdo/move-registerCoreWithSerializer branch November 21, 2023 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants