-
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
WITH REPRO STEPS - switchMap not unsubscribing if imported from internal #5641
Comments
BTW: I realize now that the cause of my problems is that my path rewriting is subtly wrong, and I import from two different copies of rxjs - |
As you already described, we have a specific way to consumer import our API surface and strongly prevent to import internal import site. I'm afraid this is not something we can actively trying to resolve. Does code work with |
(Yes, but) I'm not sure you don't understand my point. The documented import is unsuitable for React Native (Metro bundler), because it results in the entire CC @cartant - I'm pinging you because you kept asking on other threads for a reproducible demo. It's in the first comment on this issue. |
I am aware your motivation but
Shouldn't this be raised upstream metro to support tree shaking? Our tree shaking config is pretty much work for majority of bundler, while there is no such thing like ECMA standard for tree shaking it's de-facto across most of bundlers.
I still see this is bundler & your application config issue rather than core failed to export proper API surface to users. |
@radex You've not filled out the issue template, I can see that there's a link to a repo, but it has a whole bunch of deps that I don't want to vet - before installing locally. Essentially, I'd like to know whether this problem is still effected in the v7 beta. |
Per comment, so far my understanding this request is very specific to metro bundler and we don't have additional information to rule out this is rxjs specific. If this is still an issue and could be reproducible with 1. without metro 2. following public rxjs exports, please create new issue or discussions. |
Hi! This is a reopen of #4363, #4230, #3306.
The issue was never solved because reproducible sample was never provided… U N T I L N O W :))
Here's a repro: https://github.com/radex/rxjs-import-bug-repro
This:
Naturally should stop logging to console after 1 second. Even if I do imports like this:
All is well. However, if I do this:
and add this to webpack:
Then I can reproduce the problem. Contrived example? Sure. But this is an simplified extraction from a real app. Why would I do such an awful thing and not just import from
rxjs
as is documented? Because I'm shipping the app both on web and with React Native. And the latter's packager is not smart enough to tree shake unused code. That's why doing code transforms (in webpack and babel) and point tointernal
so that I can avoid a big chunk of RxJS weight on RN (and keep same code for web)The text was updated successfully, but these errors were encountered: