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

RFC: Monorepo #1

Closed
bajtos opened this issue Jan 10, 2017 · 6 comments
Closed

RFC: Monorepo #1

bajtos opened this issue Jan 10, 2017 · 6 comments

Comments

@bajtos
Copy link
Member

bajtos commented Jan 10, 2017

In the past year or two, we have repeatedly came across the idea of using a single monorepo containing all core LoopBack modules (strong-remoting, juggler, loopback, possibly others like swagger, etc.). The last time this was mentioned by @ritch when discussing loopback-next kick-off.

In this thread, I'd like to discuss pros and cons of using monorepo approach for the development of loopback-next (and possibly beyond).

@raymondfeng @superkhau @ritch

@bajtos
Copy link
Member Author

bajtos commented Jan 10, 2017

I have several concerns about the monorepo approach:

1) Modular design

So far, LoopBack was designed as a composition of smaller building blocks (juggler, remoting) that can be used on their own. In which case I think it's better for both strong-remoting and juggler to live in their own repository that can be versioned independently and have project-focused issue tracker where people interested only in a particular building block can follow the discussions without being overwhelmed by everything else happening in LoopBack core.

Having said that, it doesn't look like there are many people using strong-remoting or juggler without loopback (loopback downloads: 58k/month, juggler downloads: 58k/month, remoting: 52k/month, see also https://www.npmjs.com/browse/depended/strong-remoting and https://www.npmjs.com/browse/depended/loopback-datasource-juggler), so maybe it's time to get rid of this layered design and move all code into a single Node.js project/npm package?

2) Back/forward-porting changes, git history

With 3.x version living in multiple GitHub repositories, and the NEXT version living in a single monorepo, it will be difficult to back/forward port changes across major versions, as git cherry-pick will no longer work.

Also if we eventually decide to copy code from loopback-next monorepo into individual projects we have now, the commit history and links to valuable discussions in pull requests will be lost.


Here is the alternative solution I would like to propose for consideration:

  • Create a monorepo in loopback-next that will be used only as a playground for trying out new ideas and getting feedback.
  • Regularly sync code from master of individual loopback projects into this mono repo (but not the other way around!).
  • Once an idea gets mature enough that we know what kind of changes we want/need to make in each individual repository, then the real changes will be sent in multiple pull requests to these repos.

@bajtos bajtos mentioned this issue Jan 10, 2017
@bajtos
Copy link
Member Author

bajtos commented Jan 10, 2017

Related reading:

The first article recommends https://lernajs.io/ as the tool to use for managing a monorepo containing multiple npmjs packages.

@ritch
Copy link
Contributor

ritch commented Jan 10, 2017

Here are my take aways from above:

  1. no one uses our modules stand alone, even though they can
  2. module design and monorepos are compatible concepts
  3. switching to a monorepo is hard (mainly because of back porting and lost history)
  4. @bajtos and I are willing to try this monorepo for the development of 4.x (but not sure about beyond)

So I think the things for consideration are:

  1. Do the PROs of a monorepo offset 3 enough? I think we can determine this after we get deeper into 4.x development in this repo. It probably won't take long to see if its going to offset the other headaches.

  2. Should we de-emphasize the idea of using these other components on their own (juggler / remoting)? Note: we can still keep our modular design.

@raymondfeng
Copy link
Contributor

Please also consider the impact to CI our systems which may have assumptions about the module/repo layout.

@superkhau
Copy link
Contributor

superkhau commented Jan 12, 2017

no one uses our modules stand alone, even though they can

I completely agree with this. IMO, if we're going to sell Juggler as it's own thing, why attach the LoopBack name to it. Could be like waterline from sails for example. Maybe people can swap ORMs in the future for one they prefer, etc. I'm down with unix philosophy of do one thing (which means more repos really). We shouldn't have to rewrite large portions because we coupled our components too much, we need better decouplling and better extensibility. What if they want to swap strong-remoting or boot itself. I think we need to design from a different perspective: extensibility first, which means end users will have to hook in via other GitHub repos (and we're going to dogfood our own extensibility API first).

Anyways, one huge benefit of monorepo I can see is centralizing issues to one github repo which will make keeping track and searching through issues much easier during triage/roadmapping compared to what we have now.

I'm also concerned about CI and the line-ups that I can already see forming. Less concerned when it's distributed over N repos like we do now and take advantage of free open source CI systems like traivs (which can run in parallel over N projects).

@ritch
Copy link
Contributor

ritch commented Jan 12, 2017

For now the approach is to try lernajs as part of the general 4.x refactor / rewrite in TS. If it ultimately does not work out lets open another discussion. Closing for now to keep focused on moving forward.

@ritch ritch closed this as completed Jan 12, 2017
@monster910 monster910 mentioned this issue Jan 18, 2018
alexkander referenced this issue in alexkander/loopback-next Oct 11, 2020
* feat(websocket): add files of websocket extension implementation

Implementation of websocket server allow route controller by namespace, handle events and customize
way

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): bind key for request listener used to create httpserver

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): bind SocketIO instance and created namespaces

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): add providers ot handler sequence of event handle

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* refactor(socketio): preparing socket controller factory for test

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): add booter to autoload controller

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* refactor(socketio): preparation context connection moved into websocket controller factory

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): add decorator for injection of io server as param

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): separate httpOptions of serverOptions in the applications options

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* fix(socketio): add socketio controller booter

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* test(socketio): add unit test from webscoket extension

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* refactor(socketio): move application and controllers into acceptance tests to fixture dir

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* test(socketio): add acceptance tests for events

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* chore(socketio): remove unnecessaries packages

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* refactor(socketio): add constant SocketIOBinding.CONTROLLERS_NAMASPACE

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* chore(socketio): license update

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* chore(socketio): update MONOREPO and CODEOWNERS

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat: remove websocket extension

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* fix(example-socketio): update imports and options

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

Co-authored-by: Raymond Feng <enjoyjava@gmail.com>
Signed-off-by: Alexander Rondon <arondn2@gmail.com>
alexkander referenced this issue in alexkander/loopback-next Oct 13, 2020
* feat(websocket): add files of websocket extension implementation

Implementation of websocket server allow route controller by namespace, handle events and customize
way

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): bind key for request listener used to create httpserver

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): bind SocketIO instance and created namespaces

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): add providers ot handler sequence of event handle

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* refactor(socketio): preparing socket controller factory for test

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): add booter to autoload controller

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* refactor(socketio): preparation context connection moved into websocket controller factory

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): add decorator for injection of io server as param

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat(socketio): separate httpOptions of serverOptions in the applications options

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* fix(socketio): add socketio controller booter

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* test(socketio): add unit test from webscoket extension

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* refactor(socketio): move application and controllers into acceptance tests to fixture dir

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* test(socketio): add acceptance tests for events

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* chore(socketio): remove unnecessaries packages

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* refactor(socketio): add constant SocketIOBinding.CONTROLLERS_NAMASPACE

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* chore(socketio): license update

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* chore(socketio): update MONOREPO and CODEOWNERS

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* feat: remove websocket extension

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

* fix(example-socketio): update imports and options

Signed-off-by: Alexander Rondon <arondn2@gmail.com>

Co-authored-by: Raymond Feng <enjoyjava@gmail.com>
Signed-off-by: Alexander Rondon <arondn2@gmail.com>
alexkander referenced this issue in alexkander/loopback-next Oct 17, 2020
- add files of websocket extension implementation
- bind key for request listener used to create httpserver
- bind SocketIO instance and created namespaces
- add providers ot handler sequence of event handle
- preparing socket controller factory for test
- add booter to autoload controller
- preparation context connection moved into websocket controller factory
- add decorator for injection of io server as param
- separate httpOptions of serverOptions in the applications options
- add socketio controller booter
- test(socketio): add unit test from webscoket extension
- move application and controllers into acceptance tests to fixture dir
- add acceptance tests for events
- remove unnecessaries packages
- add constant SocketIOBinding.CONTROLLERS_NAMASPACE
- license update
- update MONOREPO and CODEOWNERS
- remove websocket extension
- update imports and options

Signed-off-by: Alexander Rondón <arondn2@gmail.com>
Signed-off-by: mayank <mayank.nauriyal@sourcefuse.com>
alexkander referenced this issue in alexkander/loopback-next Oct 17, 2020
Signed-off-by: Alexander Rondon <arondn2@gmail.com>
Signed-off-by: mayank <mayank.nauriyal@sourcefuse.com>
alexkander referenced this issue in alexkander/loopback-next Oct 17, 2020
- add files of websocket extension implementation
- bind key for request listener used to create httpserver
- bind SocketIO instance and created namespaces
- add providers ot handler sequence of event handle
- preparing socket controller factory for test
- add booter to autoload controller
- preparation context connection moved into websocket controller factory
- add decorator for injection of io server as param
- separate httpOptions of serverOptions in the applications options
- add socketio controller booter
- test(socketio): add unit test from webscoket extension
- move application and controllers into acceptance tests to fixture dir
- add acceptance tests for events
- remove unnecessaries packages
- add constant SocketIOBinding.CONTROLLERS_NAMASPACE
- license update
- update MONOREPO and CODEOWNERS
- remove websocket extension
- update imports and options

Signed-off-by: Alexander Rondón <arondn2@gmail.com>
Signed-off-by: mayank <mayank.nauriyal@sourcefuse.com>
alexkander referenced this issue in alexkander/loopback-next Oct 17, 2020
Signed-off-by: Alexander Rondon <arondn2@gmail.com>
Signed-off-by: mayank <mayank.nauriyal@sourcefuse.com>
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

4 participants