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

Restore missing API #4847

Merged
merged 10 commits into from
Aug 4, 2023
Merged

Restore missing API #4847

merged 10 commits into from
Aug 4, 2023

Conversation

tjzel
Copy link
Collaborator

@tjzel tjzel commented Jul 28, 2023

Summary

During removal of react-native-reanimated.d.ts in #4519 I didn't consider that some types were exported only in the aforementioned file, e.g. WithSpringConfig. Therefore when we released 3.4.0 those types disappear from public API. This PR restores lacking types from .d.ts - but only the relevant ones, without Reanimated1 API.

Types restored

namespace Animated

  • Extrapolate
  • DerivedValue
  • Adaptable
  • TransformStyleTypes
  • AdaptTransforms
  • AnimatedTransform
  • AnimateStyle
  • StylesOrDefault
  • AnimateProps
  • EasingFunction
  • addWhitelistedNativeProps
  • addWhitelistedUIProps
  • AnimatedScrollViewProps
  • FlatListPropsWithLayout

react-native-reanimated

  • Adaptable
  • AdaptTransforms
  • AnimatedTransform
  • TransformStyleTypes
  • AnimateStyle
  • StylesOrDefault
  • AnimatedScrollViewProps
  • FlatListPropsWithLayout
  • ---
  • EasingFunction
  • EasingFunctionFactory
  • ---
  • WithDecayConfig
  • ---
  • WithSpringConfig
  • ---
  • WithTimingConfig
  • ---
  • FlatListPropsWithLayout
  • ---
  • AnimatedScrollViewProps
  • ---
  • AnimatedStyleProp
  • ---
  • InterpolateRGB
  • InterpolateHSV
  • ---
  • KeyframeProps

Requires #4855

Test plan

CI + 🚀

@tjzel tjzel changed the base branch from main to @tjzel/types/unify-AnimatedStyle July 31, 2023 12:13
@tjzel tjzel marked this pull request as ready for review July 31, 2023 14:54
@tjzel tjzel changed the base branch from @tjzel/types/unify-AnimatedStyle to main July 31, 2023 16:02
src/reanimated2/layoutReanimation/index.ts Show resolved Hide resolved
Comment on lines 402 to 403
// What is this type???
// Well we exported it before so let's keep it for now.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XD

Suggested change
// What is this type???
// Well we exported it before so let's keep it for now.
// This is only legacy type exported to keep the backwards compatibility

Comment on lines 402 to 403
// What is this type???
// Well we exported it before so let's keep it for now.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just change this comment to something more formal 😅

@tjzel tjzel added this pull request to the merge queue Aug 4, 2023
Merged via the queue into main with commit 499a0cb Aug 4, 2023
1 check passed
@tjzel tjzel deleted the @tjzel/restore-missing-API branch August 4, 2023 09:23
piaskowyk pushed a commit that referenced this pull request Aug 4, 2023
<!-- 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

During removal of `react-native-reanimated.d.ts` in #4519 I didn't
consider that some types were exported only in the aforementioned file,
e.g. `WithSpringConfig`. Therefore when we released `3.4.0` those types
disappear from public API. This PR restores lacking types from `.d.ts` -
but only the relevant ones, without Reanimated1 API.

## Types restored

### namespace Animated

- Extrapolate
- DerivedValue
- Adaptable
- TransformStyleTypes
- AdaptTransforms
- AnimatedTransform
- AnimateStyle
- StylesOrDefault
- AnimateProps
- EasingFunction
- addWhitelistedNativeProps
- addWhitelistedUIProps
- AnimatedScrollViewProps
- FlatListPropsWithLayout

### react-native-reanimated

- Adaptable
- AdaptTransforms
- AnimatedTransform
- TransformStyleTypes
- AnimateStyle
- StylesOrDefault
- AnimatedScrollViewProps
- FlatListPropsWithLayout
- \-\-\-
- EasingFunction
- EasingFunctionFactory
- \-\-\-
- WithDecayConfig
- \-\-\-
- WithSpringConfig
- \-\-\-
- WithTimingConfig
- \-\-\-
- FlatListPropsWithLayout
- \-\-\-
- AnimatedScrollViewProps
- \-\-\-
- AnimatedStyleProp
- \-\-\-
- InterpolateRGB
- InterpolateHSV
- \-\-\-
- KeyframeProps

___

Requires #4855 

## Test plan

CI + 🚀
@lockykeaney
Copy link

If I have upgraded to 3.4.2 then I shouldn't be getting this error anymore should I?

No matching export in "node_modules/react-native-reanimated/lib/module/reanimated2/animation/decay.js" for import "WithDecayConfig"

    node_modules/react-native-reanimated/lib/module/reanimated2/animation/index.js:4:20:
      4 │ export { withDecay, WithDecayConfig } from './decay';

@tjzel
Copy link
Collaborator Author

tjzel commented Aug 8, 2023

Yes, you shouldn't.

github-merge-queue bot pushed a commit that referenced this pull request Aug 18, 2023
<!-- 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

Removal of `react-native-reanimated.d.ts` exposed some of our internal
API with `export * from ...`. This file limits the exports and (kind-of)
defines public API.

Requires #4847.

## Test plan

CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants