📚 [Guide] Create a backward compatible Turbomodule#3023
📚 [Guide] Create a backward compatible Turbomodule#3023cipolleschi wants to merge 1 commit intofacebook:mainfrom
Conversation
|
✅ Deploy Preview for react-native ready! 🔨 Explore the source changes: 95db79d 🔍 Inspect the deploy log: https://app.netlify.com/sites/react-native/deploys/6239a2c0899af50008deb46e 😎 Browse the preview: https://deploy-preview-3023--react-native.netlify.app |
78e1d3a to
0698e45
Compare
Simek
left a comment
There was a problem hiding this comment.
Hello @cipolleschi, thank you for the great work on fixing and extending the documentation lately! 👍
It looks like the page is not linked in any sidebar, which makes the page only accessible via URL. You probably want to add this page somewhere in there:
Other that that, I have left two, small suggestions according to the new page content.
|
Hi @Simek! Thanks for the suggestions. I'll go through applying them now. About the sidebar thing, I left the article out on purpose for two reasons:
What do you think? |
0698e45 to
3b07322
Compare
|
I should have fixed all the comments! :D |
|
|
||
| To create a turbomodule with the React Native CLI, run the following command: | ||
|
|
||
| ```sh title="" |
There was a problem hiding this comment.
| ```sh title="" | |
| ```sh |
Just a small fix suggestion.
Simek
left a comment
There was a problem hiding this comment.
Thank you for the quick updates! For the formatting and website perspective this LGTM.
Let's have a @cortinico look at the technical side of this. 🙂
There are few more small formatting (capitalization of Metro, JavaScript, TypeScript etc.) and punctuation issues (mostly missing dots at the end of sentences), but since this still a draft we can correct this in the future.
3b07322 to
e9c53d6
Compare
|
Great, thanks! |
| ], | ||
| "keywords": ["react-native", "ios", "android"], | ||
| "repository": "https://github.com/<your_github_handle>/example-library", | ||
| "author": "<Your Name> <your_email@your_provide.com> (https://github.com/<your_github_handle>)", |
There was a problem hiding this comment.
| "author": "<Your Name> <your_email@your_provide.com> (https://github.com/<your_github_handle>)", | |
| "author": "<Your Name> <your_email@your_provider.com> (https://github.com/<your_github_handle>)", |
|
|
||
| This section and the following are a practical guides to create a module that is backward compatible. We are not diving deep into what can be done with Native Modules. For more informations on that topic, have a look [here](native-modules-intro). | ||
|
|
||
| If you are interested in creating a Turbomodule, you can skip this part and directly go [here](#create-the-turbomodule). Consider that most of the code of a Native Module is needed for a Turbomodule. |
There was a problem hiding this comment.
I think that the "Consider that most of the code of a Native Module is needed for a Turbomodule" is confusing for the reader.
If a reader is looking into creating a TurboModule without dealing with backward compat, probably is not even reading this page right?
There was a problem hiding this comment.
I agree. I moved the sentence to the previous paragraph, adding some more context.
|
Great stuff 👍 A couple of things that are worth mentioning:
|
e9c53d6 to
df09aba
Compare
|
Thanks! For your points 1 and 2, I added a sentence at line 426. It's not clear to me what do you mean for your point 3, though. The whole point of the article is that we can install the module in both the architecture. Some problem arises if:
But I think that these are clearly explained throughout the guide and also with the summary. I think that the user can expect some error if it forget about these steps. What do you think? |
df09aba to
95db79d
Compare
Discussed offline but following up here for the sake of transparency. I think we will adjust the guide a bit to adopt the approach followed by some of the Software Mansion library: Ideally we would like to don't ask the user to update the import but just have an abstraction that will expose the correct object given the underlying infrastructure. |
|
Closing as this is stale and merged in #3037 |
This PR contains a first draft of a Guide to create a TurboModule which is backward compatible with the new architecture.
This guide is intended to be used as a reference to understand better how the backward compatibility can be achieved and what are the differences between a Native Module and a Turbomodule, from a developer perspective.