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

feat(typescript): Source code rewrite using typescript #425

Merged
merged 12 commits into from
Mar 20, 2019
Merged

Conversation

Titozzz
Copy link
Collaborator

@Titozzz Titozzz commented Mar 15, 2019

No description provided.

@Titozzz
Copy link
Collaborator Author

Titozzz commented Mar 15, 2019

@LinusU Can you have a look, I've tried to take into account everything that was said in the previous PR #171

@@ -42,16 +40,16 @@ const createOnShouldStartLoadWithRequest = (
url: string,
lockIdentifier: number,
) => void,
originWhitelist: ?$ReadOnlyArray<string>,
Copy link

Choose a reason for hiding this comment

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

TypeScript also has a read-only array: ReadonlyArray<T> ☺️

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well we do have eslint to not modify received parameters, but that's nice to know

Copy link

Choose a reason for hiding this comment

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

It's nice to use because if users are using readonly variables to enforce mutability, TypeScript won't let them pass those variables to us since it thinks we are going to mutate them.

Basically, it's a way to document the interface 📝

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok nice I'll make those changes before merging :)

Copy link

@LinusU LinusU left a comment

Choose a reason for hiding this comment

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

Only had time for a quick look right now, but it looks great 👍

The only thing I could think of was that some Readonly* stuff is missing, which TypeScript actually have support for as well 🐎

@Titozzz Titozzz merged commit 453b7dd into master Mar 20, 2019
react-native-community-bot pushed a commit that referenced this pull request Mar 20, 2019
# [5.4.0](v5.3.1...v5.4.0) (2019-03-20)

### Features

* **typescript:** Source code rewrite using typescript ([#425](#425)) ([453b7dd](453b7dd)), closes [#384](#384) [#435](#435) [#206](#206) [#171](#171) [#168](#168)
@react-native-community-bot
Copy link
Collaborator

🎉 This PR is included in version 5.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@LinusU
Copy link

LinusU commented Mar 20, 2019

Awesome work @Titozzz 👏 🚀

phuongwd pushed a commit to phuongwd/react-native-webview that referenced this pull request Apr 29, 2020
…webview#425)

Rewrote the whole repository into typescript. This will provide way better and up to date documentation. This should also add some safety for people contributing 😄 .
Flow types were not working until now which is why this PR doesn't have them but feel free to PR.

This also fixes react-native-webview#384 react-native-webview#435 react-native-webview#206 react-native-webview#171 react-native-webview#168.
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.

3 participants