-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
@@ -42,16 +40,16 @@ const createOnShouldStartLoadWithRequest = ( | |||
url: string, | |||
lockIdentifier: number, | |||
) => void, | |||
originWhitelist: ?$ReadOnlyArray<string>, |
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.
TypeScript also has a read-only array: ReadonlyArray<T>
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.
Well we do have eslint to not modify received parameters, but that's nice to know
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.
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 📝
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.
ok nice I'll make those changes before merging :)
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.
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 🐎
🎉 This PR is included in version 5.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Awesome work @Titozzz 👏 🚀 |
…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.
# [5.4.0](react-native-webview/react-native-webview@v5.3.1...v5.4.0) (2019-03-20) ### Features * **typescript:** Source code rewrite using typescript ([react-native-webview#425](react-native-webview#425)) ([453b7dd](react-native-webview@453b7dd)), closes [react-native-webview#384](react-native-webview#384) [react-native-webview#435](react-native-webview#435) [react-native-webview#206](react-native-webview#206) [react-native-webview#171](react-native-webview#171) [react-native-webview#168](react-native-webview#168)
# [5.4.0](react-native-webview/react-native-webview@v5.3.1...v5.4.0) (2019-03-20) ### Features * **typescript:** Source code rewrite using typescript ([#425](react-native-webview/react-native-webview#425)) ([453b7dd](react-native-webview/react-native-webview@453b7dd)), closes [#384](react-native-webview/react-native-webview#384) [#435](react-native-webview/react-native-webview#435) [#206](react-native-webview/react-native-webview#206) [#171](react-native-webview/react-native-webview#171) [#168](react-native-webview/react-native-webview#168)
# [5.4.0](react-native-webview/react-native-webview@v5.3.1...v5.4.0) (2019-03-20) ### Features * **typescript:** Source code rewrite using typescript ([#425](react-native-webview/react-native-webview#425)) ([453b7dd](react-native-webview/react-native-webview@453b7dd)), closes [#384](react-native-webview/react-native-webview#384) [#435](react-native-webview/react-native-webview#435) [#206](react-native-webview/react-native-webview#206) [#171](react-native-webview/react-native-webview#171) [#168](react-native-webview/react-native-webview#168)
No description provided.