-
Notifications
You must be signed in to change notification settings - Fork 94
Webpack HMR compatibility: update editInPlace.js #522
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
base: master
Are you sure you want to change the base?
Webpack HMR compatibility: update editInPlace.js #522
Conversation
For HMR compatibility. Fix the javascript error display in console and webpack error overlay : "Failed to execute 'define' on 'CustomElementRegistry': the name "x-trans" has already been used with this registry"
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.
Pull Request Overview
This PR addresses a Webpack Hot Module Replacement (HMR) compatibility issue by preventing duplicate custom element registration. The change resolves a JavaScript error that occurs when the custom element "x-trans" is already registered in the CustomElementRegistry during HMR reloads.
- Adds a guard condition to check if the custom element is already registered before defining it
- Prevents the "name has already been used with this registry" error in development environments with HMR
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.
Looks good to me, thank you!
Fix Translation\Bundle\Tests\Unit\Twig\DefaultApplyingNodeVisitorTest::testApply
I try to solve failed test on PHP 8.2+. Can you launch the workflow? |
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.
Thanks for working on tests fix! It seems your change helped to make tests green. Fairly speaking, I'm not sure why we need that line and why we didn't have problems with that before, but as I see we don't use it anyway so I suppose it's safe to delete it. Any comments?
Yes, I think it's safe too. I understood that the AST Twig changed with PHP 8.2+ version but honestly I don't know why... |
For HMR compatibility. Fix the javascript error display in console and webpack error overlay : "Failed to execute 'define' on 'CustomElementRegistry': the name "x-trans" has already been used with this registry"