react-navigation / rfcs

RFCs for changes to React Navigation
Other
88 stars 16 forks source link

The multipackage: Breaking apart the NPM export #40

Closed ericvicenti closed 5 years ago

ericvicenti commented 6 years ago

Read the RFC here

ericvicenti commented 6 years ago

Hey folks 👋 , I'm super excited about this 😁

I'm leaning towards the multi-repo approach, but on the fence and I'm kinda terrified of it.

In any case, we will need the support of JS tooling superheroes in order to get this set up well. Lets all rally together on this!

(As a side note, I have been playing around with a frankenstein monorepo native+web hack over here, but it still lacks all the tooling that is mentioned in the RFC: https://github.com/ericvicenti/navigation-universe/tree/master/universal/src )

dantman commented 6 years ago

I know it will slightly discourage user packages. But if you're going the multiple-package approach I'd recommend going with @react-navigation/core, etc. That way it's clear which packages are maintained by the core community and which are maintained by 3rd parties. And a poorly written and abandoned 3rd party react-navigation-dialog-navigator doesn't interfere with the core react-navigation community creating a good DialogNavigator and people finding it.

ericvicenti commented 6 years ago

@dantman, I think thats a good idea!

ericvicenti commented 6 years ago

So, I have been making progress on this in the past few weeks, even though we seem to be in a maintainer deadlock on this issue. People generally want this, but aren't willing to accept the increased complexity or workflow overhead. So I've been forced to find an incremental approach until we find a path that makes everybody happy.

tldr:, I've created a way to import the react-navigation source code into a different repository. This allows me to test and experiment with all of the different packages in the same environment (including web+server rendering).

https://github.com/ericvicenti/universe

Soon I'll get the playground and tests copied over there as well. Each package lives in its own folder, which I plan to publish independently on github via a sub-repository.

So that means that the main react-navigation repo can continue to exist, while some maintainers such as myself will start developing in the new environment. No code will go stale, because there is an automatic way to pull the latest code out of the main legacy repo. It will still be the source of truth for core modules.

We will soon be able to publish these smaller packages to NPM, so that people can simply use the parts of react-nav that they need.

Let me know if anybody wants to help with this. I probably won't be landing this RFC because I couldn't get enough agreement for either of the two proposed directions. So I'll make some independent progress on this, and leave the main repository as-is, until we get the other workflow figured out.

brentvatne commented 5 years ago

this is done now! we skipped the RFC process here a bit though. we settled on @react-navigation/core, @react-navigation/web and @react-navigation/native for the platform-agnostic code, web container, and native container respectively. navigators will continue to live in their own repos at react-navigation-stack, react-navigation-tabs, and react-navigation-drawer, so they are peers with other navigators built by the community. react-navigation will continue to pull in the correct packages to work seamlessly in react-native on ios and android in order to minimize disruption - this may be reconsidered in the future.

with this comment i'll close this PR because it's not totally accurate to what @ericvicenti and i settled on.