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

release: 3.16.3 #6761

Merged
merged 5 commits into from
Nov 26, 2024
Merged

release: 3.16.3 #6761

merged 5 commits into from
Nov 26, 2024

Conversation

MatiPl01 and others added 5 commits November 25, 2024 16:17
## Summary

This PR adds missing initializers path to side effects (because some
global variables are written in this file). It also fixes paths to
remaining files (as there is no longer `reanimated2` directory).
## Summary

The problem was caused by our `useDerivedValue` hook which set ref to
`null` in the `useEffect` cleanup method.

```tsx
useEffect(() => {
  return () => {
    initRef.current = null;
  };
}, []);
```

The warning was shown during hot reload, because react calls cleanup
functions in hooks, thus the `initRef` was reset in the
`useDerivedValue` hook, which resulted in execution of this code that
should run only when the component mounts for the first time:

```tsx
if (initRef.current === null) {
  initRef.current = makeMutable(initialUpdaterRun(updater));
}
```

Because of that, `initialUpdaterRun` executed the `updater` callback on
the JS thread during hot reload, while the component was rendered, which
resulted in reading shared value's `.value` property during the render
phase.
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect. -->

## Summary

The API for sharedValue has changed from using .value to get() and set()
methods. As a result, the mock that previously returned an object with a
single value property no longer works in the tests.

## Test plan

This is a PR for the mocks, so it's not necessary for it.

---------

Co-authored-by: Tomasz Żelawski <tomasz.zelawski@swmansion.com>
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect. -->

Fixes
#6665

Applying the change I made to `react-native-builder-bob`:
- callstack/react-native-builder-bob#695

It restores `classic` runtime for the `@babel/react-native` preset used
for generating ESModule code. The behavior was changed when we bumped
builder-bob:
- #6485

I ran the `diff` for the version of `lib` without `jsxRuntime: classic`
and with it - the differences are only in regards to `_jsx` usage. You
can read more here:
-
#6665
@tjzel tjzel merged commit af19f4a into 3.16-stable Nov 26, 2024
31 of 50 checks passed
@tjzel tjzel deleted the @tjzel/release/3.16.3 branch November 26, 2024 09:05
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.

5 participants