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

[Idea] Maintain and publish mobx 4 & 5 from the same branch #2120

Closed
Bnaya opened this issue Sep 21, 2019 · 14 comments
Closed

[Idea] Maintain and publish mobx 4 & 5 from the same branch #2120

Bnaya opened this issue Sep 21, 2019 · 14 comments

Comments

@Bnaya
Copy link
Member

Bnaya commented Sep 21, 2019

I can't say i know mobx codebase very well,
But as what i've seen most of the code of 4 & 5 is very similar,
The difference is mostly the proxy part.

What if struct the code in a way that only the different parts will be behind a build flag (or even runtime flat if the developer wishes)
And keep all of the code on master.
Another idea, that i'm not sure if will work:
Use monorepo, one package will be 4.x and the other 5.x, and the shared code will be in a shared package (That won't be published, but will be bundled)

Kinda related #1957

@danielkcz
Copy link
Contributor

danielkcz commented Sep 22, 2019

Monorepos are the pain, mainly because there are no solid tools to work with them (Lerna is crap).

Merging codebase does sound appealing, but I can imagine it would make code fairly messy even with build flags. Not sure really. If you are willing to give it a try, it could be really interesting and easing the maintenance pain toward the future.

However, it would mean to release V6 and motivate people to upgrade. We can hardly just deprecate V4 as it's considered LTS. New bugs would still need to be fixed in V4 branch.

@Bnaya
Copy link
Member Author

Bnaya commented Sep 23, 2019

The initial idea is to keep publish V4 & V5,
just from the same branch (with separate package.json, or writing the version on the fly before publish),
And build/bundle flags will produce the correct bundle before each publish.
I believe i will find time to POC it after #2079 will get finalized

@mweststrate
Copy link
Member

Separate subpackages in the same branch sounds fine to me, if it isn't confusing for new contributors. Mixing code bases is a real pain. I tried, so I can confirm that it at least is not easy :).

@Bnaya
Copy link
Member Author

Bnaya commented Oct 2, 2019

My personal experience from my last PR, even a small PR to both of the branches was confusing.

Have you tried that with mobx or other projects?

@danielkcz
Copy link
Contributor

Separate subpackages in the same branch sounds fine to me, if it isn't confusing for new contributors.

I can imagine it could be confusing for reviews to basically see changes two times in there.

Mixing code bases is a real pain. I tried, so I can confirm that it at least is not easy :).

Not easy but also not impossible I assume? I kinda agree it would be the best way if it can work out somehow.

@mweststrate
Copy link
Member

mweststrate commented Oct 2, 2019 via email

@mweststrate
Copy link
Member

mweststrate commented Oct 2, 2019 via email

@danielkcz
Copy link
Contributor

danielkcz commented Oct 2, 2019

I really don't have much (almost none) insight into the repo code base, but perhaps we could go a middle way and besides folders for V4 and V5, there could be a common one for code that is the same across those versions. Perhaps even restructure it to reuse as much as possible.

Personally, I am totally DRY guy, so any sort of copy&pasting makes me rather uneasy.

@danielkcz
Copy link
Contributor

Also note, that with two different branches doing the diff is very easy. With both codebases in different folders, you cannot really do git diff, so that could make contributing somewhat harder.

@mweststrate
Copy link
Member

@Bnaya docs are now in the master branch, so that blocker is gone :)

I originally started with trying to do MobX 4 and 5 with a largely common code base. But that got a real big untangable mess very quickly. Imho clarity and maintainability are more important than dry :).

@stale
Copy link

stale bot commented Oct 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@Bnaya
Copy link
Member Author

Bnaya commented Oct 20, 2019

Unfortunately i can't find the time to work on it.
i will close it for now.

@mweststrate
Copy link
Member

No problem! I'll reopen it, as I think it is a cool idea nonetheless, and I or somebody else could pick it up.

@mweststrate
Copy link
Member

This has been done by @FredyC, so closing!

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

No branches or pull requests

3 participants