lelandrichardson / react-primitives

Primitive React Interfaces Across Targets
MIT License
3.08k stars 108 forks source link

Document extensions #136

Open brodycj opened 5 years ago

brodycj commented 5 years ago

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 commented 5 years ago

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:

brodycj commented 5 years ago

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).