fix(animated): WeakMap fallback for non-extensible component caching#2534
Closed
AndreiCalazans wants to merge 125 commits into
Closed
fix(animated): WeakMap fallback for non-extensible component caching#2534AndreiCalazans wants to merge 125 commits into
AndreiCalazans wants to merge 125 commits into
Conversation
…ndrs#2360) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Neveux <d.neveux@warfog.gg> Co-authored-by: Josh <joshua.ellis18@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Neveux <d.neveux@warfog.gg>
Co-authored-by: Dimitris Tsetsonis <jimtse12@gmail.com> Co-authored-by: Josh <joshua.ellis18@gmail.com>
…il (pmndrs#1868) (pmndrs#2407) Co-authored-by: Jon Hieb <hiebj@wildidea.io>
refractor v5 reorganised its exports map to `./*` -> `./lang/*.js`, so the old `refractor/lang/tsx` resolves to `lang/lang/tsx.js`. Use the new `refractor/tsx` and `refractor/jsx` paths.
Two unrelated regressions surface under @vanilla-extract/css 1.20.1 + lightningcss minification: - Wrap orphan `screen and (...)` selectors in an `'@media'` key on `_index.homeBlocks` and `TableCell.tableCellIsThirdItem`. Older vanilla-extract silently treated them as media queries; the new version emits them as native CSS nesting, which lightningcss rejects. - Use `calloutWrapper.classNames.base` instead of `${calloutWrapper}` in the `Callout` globalStyle selector. @vanilla-extract/recipes 0.5.7 dropped the implicit `toString()` on the runtime fn, so interpolation leaked the function source into the CSS file.
React 19's stricter `cloneElement` signature rejects the `aria-hidden`/`focusable`/`className` props against `ReactElement<unknown>`. Cast the only child to `ReactElement<HTMLAttributes<HTMLElement>>` so the props validate.
…s settle on sub-precision drift (pmndrs#2520)
On Hermes (React Native), host components like View, Text, and Image become non-extensible after their first JSX render. The existing cache mechanism writes directly to Component[cacheKey], which throws 'cannot add a new property' in strict mode for these objects. Fix: attempt the direct write first (fast path for extensible components), catch the TypeError, and fall back to a module-level WeakMap for non-extensible components. Reproduces with Metro inlineRequires:true + experimentalImportSupport:true when @react-spring/native is loaded lazily inside a component render.
🦋 Changeset detectedLatest commit: 4bf13b7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Author
|
Closing — wrong base branch. Re-opening against |
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.
Fixes #2533
Problem
createHostcaches animated wrappers viaComponent[cacheKey] = .... On Hermes, React Native host components (View,Text,Image) become non-extensible after their first JSX render — writing a new property throwsTypeError: cannot add a new propertyin strict mode.This crashes
@react-spring/native's module initialization when loaded lazily (e.g. with MetroinlineRequires: true), becausecreateHostruns at module scope iterating over those exact primitives.Fix
Try the direct write first (fast path, no change for extensible components). On failure, fall back to a module-level
WeakMap.