-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Monorepo and Splitting Out To Different Packages #6786
Comments
* Adds a code path for operating on a Subscribable without lift. * Loosens the type of `OperatorFunction` and therefore `MonoTypeOperatorFunction` to go from `Subscribable<In>` to `Subscribable<Out>`. This is done in preparation for splitting `Observable` into its own package, where `lift` doesn't really need to exist in the public API. Related ReactiveX#6803 ReactiveX#6786
Core Team:
|
I've posted this on #6367, but I feel it should also be seen here, sorry for duplicate: Wouldn't publishing multiple packages for what is essentially the same code actually increase risk of non tree shakable use-case and thus increase bundle size ? As seen with lodash, if one of my dependency decides to depends on the future And of course it would be much worse if we actually publish a package for each operator. Then a single operator could be bundled three times if my deps happened to depend on I could also imagine compatibility issues if one of my dependency depends on an old version of That seems a lot of tricky tradeoffs to attempt to solve the issue of bundle size that is already properly solved by tree shaking. Is that really worth it ? 🤔 |
@benlesh would you please share the rxjs team opinions about the risks mentioned in my previous post? How could we avoid fragmenting the ecosystem and actually increase the bundle size if things are available from multiple packages at once ? How can we solve incompatibilities across future version of rxjs, that are transient dependencies, and that will still have to collaborate with each other? Also what do you think about the fact that lodash seems to be going into the opposite direction, single ESM tree-shakable package, lodash/lodash#5107 (comment) ? |
(Sorry originally posted this in the roadmap issue, before realising this issue is probably more appropriate) I just wanted to contribute to the discussion of packaging ... I've been successfully using rxjs 7.5.x in Deno via esm.sh, but the way things are imported isn't ideal, ie. everything is I'm not bothered really whether ops are individually packaged or not, but would prefer a situation where they are at least exposed publicly as individual modules, so I can do something like: |
Goals
Observable
off to be a standalone package.rxjs/testing
,rxjs/ajax
, etc, off into their own packages as well.Monorepo and multiple packages
rxjs
,rxjs/operators
,rxjs/ajax
, et al) but split all of those off into their own packages under@rxjs/observable
,@rxjs/operators
,@rxjs/ajax
, etc. We'll want to bikeshed ideas like@rxjs/subjects
or@rxjs/multicasting
etc. There's a lot of ground to cover there, and I don't want to get bogged down on that in this discussion.rxjs
willexport { Observable } from '@rxjs/observable';
etc.Standalone Observable
lift
: If we want a standaloneObservable
, we should move away from lift, because it requires too much knowledge of the inner working of RxJS in order to create custom operators that leverage it properly.lift
as a non-breaking change anytime. This is completely contained within ouroperate
utility function now. We may even start supporting this in v7, as it should be completely innocuous. It's just a different call pattern. I actually have some work done around this, and everything looks solid.pipe
on our standalone observable package, as it's central to our particular design for how to use RxJS. Even thoughpipe
might not be immediately useful to users ofObservable
that don't care about operators. (libraries that exportObservable
, etc).Long Term:
@rxjs/observable
et al until version 9. That should be a long ways off.The text was updated successfully, but these errors were encountered: