Open
Conversation
|
@rcoopr is attempting to deploy a commit to the Barvian Team on Vercel. A member of the Team first needs to authorize it. |
barvian
reviewed
Oct 22, 2024
|
|
||
| // Don't check for declarative shadow DOM because we'll recreate it anyway: | ||
| this.attachShadow({ mode: 'open' }) | ||
| if (!this.shadowRoot) { |
Owner
There was a problem hiding this comment.
Was this related to HMR as well? I wonder how a shadow root is already attached 🤔
Author
There was a problem hiding this comment.
Yes that was the only fix required for HMR to work without issue. It was in the case that a component is mounted, HMR reloads with that component no longer mounted, then HMR reloads a 2nd time with it mounted once again. Reproduction details are in #38
|
Thanks for fix! Will try in my app as well upd: oh, looks like they updated something else and we need another PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the 2 broken issues from #38
The Trend issue is due to preact rendering the component with serialized parts, so implementing the same fix for React19 will work. Even though preact is using React18 under the hood, it supports custom elements differently.
number-flow/packages/react/src/index.tsx
Line 17 in f34ee35
number-flow/packages/react/src/index.tsx
Line 60 in f34ee35
Unfortunately I can't find a way to tell if
preactis in use. It might be necessary to provide another export@number-flow/preact, or add a prop, or rely on an env variable to change the behaviour