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

Side effect free imports & backwards compatibility APIs #3384

Merged
merged 26 commits into from
Mar 16, 2018

Conversation

jasonaden
Copy link
Collaborator

This PR will address a couple things at once:

  • Make rxjs side-effect-free to take advantage of Webpack 4 and significantly decrease application bundle sizes
  • Adds an rxjs-compat package to be separately distributed to NPM
  • rxjs-compat holds imports that produce side-effects (any code that monkey patches through add operator will live here)
  • Adds a legacy-reexports directory used at build time to make imports such as rxjs/Observable still work (though devs will need to install rxjs-compat to make these imports behave correctly)

Basically, this makes the default case for Rx side-effect free, but includes many breaking API changes. The rxjs-compat package mitigates these breaking changes.

@jasonaden jasonaden force-pushed the side-effect-free-imports branch 2 times, most recently from 0fca095 to 328d512 Compare March 8, 2018 03:05
Copy link
Member

@benlesh benlesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feat(compat): set up correct imports & get build working for rxjs-comapt

misspelled commit

@simonbuchan
Copy link

So is rxjs-compat because of "sideEffects": false, or is that an excuse for it? Because with webpack 4.0.1 you could instead use something like "sideEffects": ["add/**", ...]...

@jasonaden
Copy link
Collaborator Author

@simonbuchan Intriguing note there. I can't find that anywhere in Webpack docs, and WebpackOptions.json says that option is a boolean. Can you point me to what you're referring to?

@jasonaden
Copy link
Collaborator Author

@simonbuchan Also, there is a reason for the rxjs-compat package. This is so users will have to take explicit action to get the old behavior, thus opting in.

@simonbuchan
Copy link

simonbuchan commented Mar 9, 2018

Huh, is a very recent change, but it's not even mentioned in the release changelog. Here's the PR: webpack/webpack#6536
Perhaps deemed not ready for primetime?
Re. rxjs-compat, what I meant was would you want to make these breaking changes if you didn't have to for sideEffects? Sounds like you do, I'm mostly neutral so long as we have less duplicate import names confusing IDEs.

@jasonaden
Copy link
Collaborator Author

Thanks for the reference commit. Yes, we would want to have the separate package either way, but good to know on the new feature.

@jasonaden jasonaden force-pushed the side-effect-free-imports branch 2 times, most recently from ad43c8c to c89960a Compare March 14, 2018 01:18
@rxjs-bot
Copy link

rxjs-bot commented Mar 14, 2018

Warnings
⚠️

❗ Big PR (1)

(1) : Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.

Generated by 🚫 dangerJS

@jasonaden jasonaden force-pushed the side-effect-free-imports branch 5 times, most recently from 8b8bd78 to d69a486 Compare March 15, 2018 23:38
@jasonaden jasonaden force-pushed the side-effect-free-imports branch from d69a486 to d4b0116 Compare March 15, 2018 23:47
@jasonaden jasonaden changed the title WIP: Side effect free imports & backwards compatibility APIs Side effect free imports & backwards compatibility APIs Mar 16, 2018
@benlesh benlesh merged commit 7873f8a into ReactiveX:master Mar 16, 2018
@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants