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

Document extensions #136

Open
brodycj opened this issue Apr 10, 2019 · 2 comments
Open

Document extensions #136

brodycj opened this issue Apr 10, 2019 · 2 comments

Comments

@brodycj
Copy link
Contributor

brodycj commented Apr 10, 2019

Two kinds of extensions as described in https://youtu.be/hNwQPJy-XZY:

The trick is that for each primitive there would be JavaScript files such as:

I was not aware of this support for either of the two kinds of extensions until very recently (unfortunately I lost track of which discussion I found https://youtu.be/hNwQPJy-XZY in). I hope we can get this more formally documented in the near future.

P.S. Here are some examples of new "primitive" components (first 2 by myself):

This description was also updated to make it clear that I meant there are two types of extensions: adding new "primitive" components and supporting additional platforms.

@mathieudutour
Copy link
Collaborator

mathieudutour commented Apr 10, 2019

Keep in mind that this is not enforced by react-primitives. It's the bundler config that resolves some extensions before others (for the case of react-native, it resolves ios.js before .js).

But yes, a bit of documentation about it would be nice.

Here are the convention we follow:

  • .android.js -> react-native
  • .ios.js -> react-native
  • .js -> react-native-web
  • .sketch.js -> react-sketchapp
  • .vr.js -> react-vr (possibly react-360 soon)
  • .web.js -> react-native.web
  • .windows.js -> react-native

@brodycj
Copy link
Contributor Author

brodycj commented Apr 14, 2019

I hope to contribute some documentation in the near future. For now I would like to focus on Android, iOS, and web. (Examples and documentation for the other platforms would be nice, not sure how much commercial interest there would be.)

P.S. By "hope" I did not mean "promise". That means that there is no commitment, and I think others should feel free to contribute according to their best judgment. I may need a few weeks due to some other priorities. But I did say "near future", not "someday" since I would like to give this much needed task some priority. This may be part of #29 (add docs site).

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

No branches or pull requests

2 participants