-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@angular-devkit/build-angular): ignore hidden inputs with hmr #19386
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
Conversation
packages/angular_devkit/build_angular/src/webpack/plugins/hmr/hmr-accept.ts
Outdated
Show resolved
Hide resolved
packages/angular_devkit/build_angular/src/webpack/plugins/hmr/hmr-accept.ts
Outdated
Show resolved
Hide resolved
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.
I'd love to understand better what is happening. I tried to take a look at the reproduction https://github.com/mhartington/hrm-ionic-test but it's empty.
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.
Approved by mistake.
@alan-agius4 pushed the code to hmr-ionic-test Basically what's happening is that you have the following DOM structure Where ionic components like Range and Checkbox will render a hidden input within the component. So at the time HMR grabs a snapshot of the outgoing DOM structure, it will grab those hidden inputs. which do nothing and are not something users can directly interact with So as HMR grabs the snapshot, it could count 1 actual input, and one hidden input. But the hidden input within Ionic's process might not be available right away when the changes are applied, meaning there will be a mismatch in the number of inputs. When hmr-accepts attempts to restore the values, with different input lengths it will You can see the dom changes yourself by setting a break point at |
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.
@mhartington, thanks for the detailed explanation and the PR. The change LGTM.
Can you please squash the commits to make CI green?
Thanks
Closes angular#19385 Don't query for hidden inputs when using HMR
a3c91e5
to
e7a8ea6
Compare
Done! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Don't query for hidden inputs when using HMR