-
-
Notifications
You must be signed in to change notification settings - Fork 982
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
Rewrite Examples to TS #1273
Merged
Merged
Rewrite Examples to TS #1273
Conversation
This file contains 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
It was copied entirely to Example
jakub-gonet
commented
Dec 12, 2020
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.
Reviewed most of the configuration.
IMOResolved in dcd454eexamples/App.tsx
should be removedResolved in 830ee3cExampleTests.m
should be commented out (or wrapped inifdef
) – those tests won't work but they may be convenient for future reference.We should re-addResolved in 392a5eaMBFingerTipWindow
lib, it's used for creating GIFs of RNGH and presentations.We should add the new logo of SWM instead of only removing the old oneAlready done, didn't notice.
Seems like it's not present in scripts
jkadamczyk
reviewed
Dec 15, 2020
jkadamczyk
reviewed
Dec 15, 2020
jkadamczyk
reviewed
Dec 15, 2020
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.
If that's not too much of work we can think of getting rid of some of these _underscore prefixed class fields
WoLewicki
reviewed
Dec 15, 2020
WoLewicki
reviewed
Dec 15, 2020
This was causing problems with packaging relase version of Example
Merged
jakub-gonet
added a commit
that referenced
this pull request
Feb 8, 2021
## Description This PR combines three others (#1273, #1280, #1291) and rewrites Gesture Handler and examples to TS. We tried to make non-breaking changes but this should be tested. Most types were overhauled, although they should remain compatible with old ones thanks to the type aliases in the `src/handlers/gestureHandlerTypesCompat.ts` file. CI for iOS was disabled due to strange fails. It should be reenabled when we add unit/e2e tests to RNGH. Fixes #1076 - removed Flow from DrawerLayout Fixes #1261 - added TS types Fixes #998 - regenerated example app Fixes #887 - removed prop types ## Changes ### Package packing, configs & source code - Swipeable and DrawerLayout are now resolved by their own `package.json`s - React Native uses source code directly, browser and TS use files from `dist/` - Removed prop types #### Internal - Removed unused babel config in the root dir, adjust Eslint config - Removed unused functions - Changed private names from `_name` to `private name` - Replaced `x && x()` syntax with `x.?()` ### Types - Added types compatibility layer for the new types (`gestureHandlerTypesCompat.ts`) - Added generation of declarations and declarations map when TS is transpiled - Moved types from declaration files to files with implementation - Added types to Android / iOS / shared JS code - Added basic types to the web version ### Example app - Removed unused bits in examples - Regenerated Example app with latest RN - Removed stray files from examples/ - Updated Travis config to include newer Android build tools & iOS scheme name change - Organized Example code structure - Removed Example tests (they weren't testing anything) - Reconfigured web version of examples ## Testing PRs that were merged into `ts-rewrite` branch were tested by using `npm pack` and adding it to the new app. In the case of #1273 & #1280, we additionally checked bundled diff for changes. We diffed master to generated dist/ directory using `diff --color -wryN -W 200 src/ dist/src`with imports removed by `find src -name "*.js" -type f -exec sed -i '' '/import/d' {} \;` Co-authored-by: WoLewicki <[email protected]> Co-authored-by: Jakub <[email protected]>
mrousavy
pushed a commit
to mrousavy/react-native-gesture-handler
that referenced
this pull request
Feb 11, 2021
This PR combines three others (software-mansion#1273, software-mansion#1280, software-mansion#1291) and rewrites Gesture Handler and examples to TS. We tried to make non-breaking changes but this should be tested. Most types were overhauled, although they should remain compatible with old ones thanks to the type aliases in the `src/handlers/gestureHandlerTypesCompat.ts` file. CI for iOS was disabled due to strange fails. It should be reenabled when we add unit/e2e tests to RNGH. Fixes software-mansion#1076 - removed Flow from DrawerLayout Fixes software-mansion#1261 - added TS types Fixes software-mansion#998 - regenerated example app Fixes software-mansion#887 - removed prop types - Swipeable and DrawerLayout are now resolved by their own `package.json`s - React Native uses source code directly, browser and TS use files from `dist/` - Removed prop types - Removed unused babel config in the root dir, adjust Eslint config - Removed unused functions - Changed private names from `_name` to `private name` - Replaced `x && x()` syntax with `x.?()` - Added types compatibility layer for the new types (`gestureHandlerTypesCompat.ts`) - Added generation of declarations and declarations map when TS is transpiled - Moved types from declaration files to files with implementation - Added types to Android / iOS / shared JS code - Added basic types to the web version - Removed unused bits in examples - Regenerated Example app with latest RN - Removed stray files from examples/ - Updated Travis config to include newer Android build tools & iOS scheme name change - Organized Example code structure - Removed Example tests (they weren't testing anything) - Reconfigured web version of examples PRs that were merged into `ts-rewrite` branch were tested by using `npm pack` and adding it to the new app. In the case of software-mansion#1273 & software-mansion#1280, we additionally checked bundled diff for changes. We diffed master to generated dist/ directory using `diff --color -wryN -W 200 src/ dist/src`with imports removed by `find src -name "*.js" -type f -exec sed -i '' '/import/d' {} \;` Co-authored-by: WoLewicki <[email protected]> Co-authored-by: Jakub <[email protected]>
braincore
pushed a commit
to braincore/react-native-gesture-handler
that referenced
this pull request
Mar 4, 2021
## Description This PR combines three others (software-mansion#1273, software-mansion#1280, software-mansion#1291) and rewrites Gesture Handler and examples to TS. We tried to make non-breaking changes but this should be tested. Most types were overhauled, although they should remain compatible with old ones thanks to the type aliases in the `src/handlers/gestureHandlerTypesCompat.ts` file. CI for iOS was disabled due to strange fails. It should be reenabled when we add unit/e2e tests to RNGH. Fixes software-mansion#1076 - removed Flow from DrawerLayout Fixes software-mansion#1261 - added TS types Fixes software-mansion#998 - regenerated example app Fixes software-mansion#887 - removed prop types ## Changes ### Package packing, configs & source code - Swipeable and DrawerLayout are now resolved by their own `package.json`s - React Native uses source code directly, browser and TS use files from `dist/` - Removed prop types #### Internal - Removed unused babel config in the root dir, adjust Eslint config - Removed unused functions - Changed private names from `_name` to `private name` - Replaced `x && x()` syntax with `x.?()` ### Types - Added types compatibility layer for the new types (`gestureHandlerTypesCompat.ts`) - Added generation of declarations and declarations map when TS is transpiled - Moved types from declaration files to files with implementation - Added types to Android / iOS / shared JS code - Added basic types to the web version ### Example app - Removed unused bits in examples - Regenerated Example app with latest RN - Removed stray files from examples/ - Updated Travis config to include newer Android build tools & iOS scheme name change - Organized Example code structure - Removed Example tests (they weren't testing anything) - Reconfigured web version of examples ## Testing PRs that were merged into `ts-rewrite` branch were tested by using `npm pack` and adding it to the new app. In the case of software-mansion#1273 & software-mansion#1280, we additionally checked bundled diff for changes. We diffed master to generated dist/ directory using `diff --color -wryN -W 200 src/ dist/src`with imports removed by `find src -name "*.js" -type f -exec sed -i '' '/import/d' {} \;` Co-authored-by: WoLewicki <[email protected]> Co-authored-by: Jakub <[email protected]>
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.
Description
Session 1: Example Blues
Fixes #1017.
This is the first part of moving into Typescript. Using TS types in Examples will allow us to test breaking changes to TS types API in the future PRs.
Note
During the rewrite, we spotted that RNGH
TouchableNativeFeedback
type inreact-native-gesture-handler.d.ts
does not expose static fields of RN's implementation. This is something that should be fixed in follow-up PRs.Changes
Test plan
I ran a
diff
on twonpm pack
ed version of the library and only changes that were present were related to reformatting.Manually investigating TS errors & running example app.
TODO
Test every example on WebWe don't have setup ready, this can be verified in the follow-up PRs.