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

Hoist dependencies = smaller react-router-dom UMD #5720

Merged
merged 5 commits into from
Nov 13, 2017

Conversation

pshrmn
Copy link
Contributor

@pshrmn pshrmn commented Nov 11, 2017

Previously, react-router-dom's UMD builds contained duplicate code because they were fetching from both packages/react-router/node-modules and packages/react-router-dom/node_modules. With hoisting, this build is now fetching from the root node_modules.

I don't think that the changes to the react-router-dom/rollup.config.js are actually necessary since rollup will try to resolve from a parent node_modules, but I wanted to be explicit about that.

Fixes #5718.

Previously, react-router-dom's UMD builds contained duplicate code because they were fetching from both `packages/react-router/node-modules` and `packages/react-router-dom/node_modules`. With hoisting, this build is now
fetching from the root `node_modules`.
@pshrmn
Copy link
Contributor Author

pshrmn commented Nov 12, 2017

The website isn't playing well with this right now, so I'll need to try to figure out what is going on with that before this can be merged.

@timdorr
Copy link
Member

timdorr commented Nov 13, 2017

OK, I think it's fixed.

But there's a big internal dep on this copypasta-ed Animated module, which is now private in React 16. It looks like this was necessary to separate the build environments for the web vs native code. This looks like a bunch of technical debt for us, so if we can remove that dependency somehow, that would be great.

@timdorr
Copy link
Member

timdorr commented Nov 13, 2017

I'm going to merge this in so we can close out #5718. Removing the Animated module is something we can take care of later.

@timdorr timdorr merged commit 463cd3e into remix-run:master Nov 13, 2017
@pshrmn pshrmn deleted the hoist branch November 13, 2017 16:38
@timdorr
Copy link
Member

timdorr commented Nov 13, 2017

BTW, we saved even more bytes from #5589, which I merged in before this:

# Before
93807  packages/react-router/umd/react-router.js
24574  packages/react-router/umd/react-router.min.js
179362 packages/react-router-dom/umd/react-router-dom.js
51512  packages/react-router-dom/umd/react-router-dom.min.js

# After
88063  packages/react-router/umd/react-router.js
19341  packages/react-router/umd/react-router.min.js
124601 packages/react-router-dom/umd/react-router-dom.js
29537  packages/react-router-dom/umd/react-router-dom.min.js

@andriijas
Copy link

maintainer, all i want for christmas is yoouuur release with smaller size. thanks and merry christmas!

@timdorr

bors bot referenced this pull request in mozilla/delivery-console Jun 6, 2018
179: Update dependency react-router-dom to v4.3.0 r=magopian a=renovate[bot]

This Pull Request updates dependency [react-router-dom](https://github.com/ReactTraining/react-router) from `v4.2.2` to `v4.3.0`



<details>
<summary>Release Notes</summary>

### [`v4.3.0`](https://github.com/ReactTraining/react-router/blob/master/CHANGELOG.md#v430httpsgithubcomReactTrainingreact-routercomparev420v430)
[Compare Source](remix-run/react-router@v4.3.0-rc.3...a27bc56)
> Jun 6, 2018

* Use the `pretty` option in generatePath ([#&#8203;6172] by @&#8203;sibelius)
* aria-current has incorrect value "true" ([#&#8203;6118] by @&#8203;brandonrninefive)
* Redirect with parameters ([#&#8203;5209] by @&#8203;dlindenkreuz)
* Fix with missing pathname: `<Link to="?foo=bar">` ([#&#8203;5489] by @&#8203;pshrmn)
* Escape NavLink path to allow special characters in path. ([#&#8203;5596] by @&#8203;esiegel)
* Expose `generatePath` ([#&#8203;5661] by @&#8203;rybon)
* Use named import of history module. ([#&#8203;5589] by @&#8203;RoboBurned)
* Hoist dependencies for smaller UMD builds ([#&#8203;5720] by @&#8203;pshrmn)
* Remove aria-current from navLink when inactive ([#&#8203;5508] by @&#8203;AlmeroSteyn)
* Add invariant for missing "to" property on `<Link>` ([#&#8203;5792] by @&#8203;selbekk)
* Use Prettier on the code ([e6f9017] by @&#8203;mjackson)
* Fix pathless route's match when parent is null ([#&#8203;5964] by @&#8203;pshrmn)
* Use history.createLocation in `<StaticRouter>` ([#&#8203;5722] by @&#8203;pshrmn)

[#&#8203;6172]: `https://github.com/ReactTraining/react-router/pull/6172`
[#&#8203;6118]: `https://github.com/ReactTraining/react-router/pull/6118`
[#&#8203;5209]: `https://github.com/ReactTraining/react-router/pull/5209`
[#&#8203;5489]: `https://github.com/ReactTraining/react-router/pull/5489`
[#&#8203;5596]: `https://github.com/ReactTraining/react-router/pull/5596`
[#&#8203;5661]: `https://github.com/ReactTraining/react-router/pull/5661`
[#&#8203;5589]: `https://github.com/ReactTraining/react-router/pull/5589`
[#&#8203;5720]: `https://github.com/ReactTraining/react-router/pull/5720`
[#&#8203;5508]: `https://github.com/ReactTraining/react-router/pull/5508`
[#&#8203;5792]: `https://github.com/ReactTraining/react-router/pull/5792`
[e6f9017]: remix-run/react-router@e6f9017
[#&#8203;5964]: `https://github.com/ReactTraining/react-router/pull/5964`
[#&#8203;5722]: `https://github.com/ReactTraining/react-router/pull/5722`

---

### [`v4.3.0-rc.3`](https://github.com/ReactTraining/react-router/releases/v4.3.0-rc.3)
[Compare Source](remix-run/react-router@v4.3.0-rc.2...v4.3.0-rc.3)
- Fix broken UMD builds.
- Add sideEffects: false for webpack tree shaking (#&#8203;6082 by @&#8203;taylorc93)

---

### [`v4.3.0-rc.2`](https://github.com/ReactTraining/react-router/releases/v4.3.0-rc.2)
[Compare Source](remix-run/react-router@v4.3.0-rc.1...v4.3.0-rc.2)
- Bump `hoist-non-react-statics` for React 16.3.
- Missing `generatePath` in `react-router-dom` package.

---

### [`v4.3.0-rc.1`](https://github.com/ReactTraining/react-router/releases/v4.3.0-rc.1)
[Compare Source](remix-run/react-router@v4.2.2...v4.3.0-rc.1)
> Mar 26, 2018

- Redirect with parameters ([#&#8203;5209] by @&#8203;dlindenkreuz)
- Fix with missing pathname: `<Link to="?foo=bar">` ([#&#8203;5489] by @&#8203;pshrmn)
- Escape NavLink path to allow special characters in path. ([#&#8203;5596] by @&#8203;esiegel)
- Expose `generatePath` ([#&#8203;5661] by @&#8203;rybon)
- Use named import of history module. ([#&#8203;5589] by @&#8203;RoboBurned)
- Hoist dependencies for smaller UMD builds ([#&#8203;5720] by @&#8203;pshrmn)
- Remove aria-current from navLink when inactive ([#&#8203;5508] by @&#8203;AlmeroSteyn)
- Add invariant for missing "to" property on `<Link>` ([#&#8203;5792] by @&#8203;selbekk)
- Use Prettier on the code ([e6f9017] by @&#8203;mjackson)
- Fix pathless route's match when parent is null ([#&#8203;5964] by @&#8203;pshrmn)
- Use history.createLocation in `<StaticRouter>` ([#&#8203;5722] by @&#8203;pshrmn)

[#&#8203;5209]: `https://github.com/ReactTraining/react-router/pull/5209`
[#&#8203;5489]: `https://github.com/ReactTraining/react-router/pull/5489`
[#&#8203;5596]: `https://github.com/ReactTraining/react-router/pull/5596`
[#&#8203;5661]: `https://github.com/ReactTraining/react-router/pull/5661`
[#&#8203;5589]: `https://github.com/ReactTraining/react-router/pull/5589`
[#&#8203;5720]: `https://github.com/ReactTraining/react-router/pull/5720`
[#&#8203;5508]: `https://github.com/ReactTraining/react-router/pull/5508`
[#&#8203;5792]: `https://github.com/ReactTraining/react-router/pull/5792`
[e6f9017]: remix-run/react-router@e6f9017
[#&#8203;5964]: `https://github.com/ReactTraining/react-router/pull/5964`
[#&#8203;5722]: `https://github.com/ReactTraining/react-router/pull/5722`

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).

Co-authored-by: Renovate Bot <[email protected]>
bors bot referenced this pull request in mozilla/delivery-console Jun 6, 2018
178: Update dependency react-router to v4.3.0 r=magopian a=renovate[bot]

This Pull Request updates dependency [react-router](https://github.com/ReactTraining/react-router) from `v4.2.0` to `v4.3.0`



<details>
<summary>Release Notes</summary>

### [`v4.3.0`](https://github.com/ReactTraining/react-router/blob/master/CHANGELOG.md#v430httpsgithubcomReactTrainingreact-routercomparev420v430)
[Compare Source](remix-run/react-router@v4.3.0-rc.3...v4.3.0)
> Jun 6, 2018

* Use the `pretty` option in generatePath ([#&#8203;6172] by @&#8203;sibelius)
* aria-current has incorrect value "true" ([#&#8203;6118] by @&#8203;brandonrninefive)
* Redirect with parameters ([#&#8203;5209] by @&#8203;dlindenkreuz)
* Fix with missing pathname: `<Link to="?foo=bar">` ([#&#8203;5489] by @&#8203;pshrmn)
* Escape NavLink path to allow special characters in path. ([#&#8203;5596] by @&#8203;esiegel)
* Expose `generatePath` ([#&#8203;5661] by @&#8203;rybon)
* Use named import of history module. ([#&#8203;5589] by @&#8203;RoboBurned)
* Hoist dependencies for smaller UMD builds ([#&#8203;5720] by @&#8203;pshrmn)
* Remove aria-current from navLink when inactive ([#&#8203;5508] by @&#8203;AlmeroSteyn)
* Add invariant for missing "to" property on `<Link>` ([#&#8203;5792] by @&#8203;selbekk)
* Use Prettier on the code ([e6f9017] by @&#8203;mjackson)
* Fix pathless route's match when parent is null ([#&#8203;5964] by @&#8203;pshrmn)
* Use history.createLocation in `<StaticRouter>` ([#&#8203;5722] by @&#8203;pshrmn)

[#&#8203;6172]: `https://github.com/ReactTraining/react-router/pull/6172`
[#&#8203;6118]: `https://github.com/ReactTraining/react-router/pull/6118`
[#&#8203;5209]: `https://github.com/ReactTraining/react-router/pull/5209`
[#&#8203;5489]: `https://github.com/ReactTraining/react-router/pull/5489`
[#&#8203;5596]: `https://github.com/ReactTraining/react-router/pull/5596`
[#&#8203;5661]: `https://github.com/ReactTraining/react-router/pull/5661`
[#&#8203;5589]: `https://github.com/ReactTraining/react-router/pull/5589`
[#&#8203;5720]: `https://github.com/ReactTraining/react-router/pull/5720`
[#&#8203;5508]: `https://github.com/ReactTraining/react-router/pull/5508`
[#&#8203;5792]: `https://github.com/ReactTraining/react-router/pull/5792`
[e6f9017]: remix-run/react-router@e6f9017
[#&#8203;5964]: `https://github.com/ReactTraining/react-router/pull/5964`
[#&#8203;5722]: `https://github.com/ReactTraining/react-router/pull/5722`

---

### [`v4.3.0-rc.3`](https://github.com/ReactTraining/react-router/releases/v4.3.0-rc.3)
[Compare Source](remix-run/react-router@v4.3.0-rc.2...v4.3.0-rc.3)
- Fix broken UMD builds.
- Add sideEffects: false for webpack tree shaking (#&#8203;6082 by @&#8203;taylorc93)

---

### [`v4.3.0-rc.2`](https://github.com/ReactTraining/react-router/releases/v4.3.0-rc.2)
[Compare Source](remix-run/react-router@v4.3.0-rc.1...v4.3.0-rc.2)
- Bump `hoist-non-react-statics` for React 16.3.
- Missing `generatePath` in `react-router-dom` package.

---

### [`v4.3.0-rc.1`](https://github.com/ReactTraining/react-router/releases/v4.3.0-rc.1)
[Compare Source](remix-run/react-router@v4.2.0...v4.3.0-rc.1)
> Mar 26, 2018

- Redirect with parameters ([#&#8203;5209] by @&#8203;dlindenkreuz)
- Fix with missing pathname: `<Link to="?foo=bar">` ([#&#8203;5489] by @&#8203;pshrmn)
- Escape NavLink path to allow special characters in path. ([#&#8203;5596] by @&#8203;esiegel)
- Expose `generatePath` ([#&#8203;5661] by @&#8203;rybon)
- Use named import of history module. ([#&#8203;5589] by @&#8203;RoboBurned)
- Hoist dependencies for smaller UMD builds ([#&#8203;5720] by @&#8203;pshrmn)
- Remove aria-current from navLink when inactive ([#&#8203;5508] by @&#8203;AlmeroSteyn)
- Add invariant for missing "to" property on `<Link>` ([#&#8203;5792] by @&#8203;selbekk)
- Use Prettier on the code ([e6f9017] by @&#8203;mjackson)
- Fix pathless route's match when parent is null ([#&#8203;5964] by @&#8203;pshrmn)
- Use history.createLocation in `<StaticRouter>` ([#&#8203;5722] by @&#8203;pshrmn)

[#&#8203;5209]: `https://github.com/ReactTraining/react-router/pull/5209`
[#&#8203;5489]: `https://github.com/ReactTraining/react-router/pull/5489`
[#&#8203;5596]: `https://github.com/ReactTraining/react-router/pull/5596`
[#&#8203;5661]: `https://github.com/ReactTraining/react-router/pull/5661`
[#&#8203;5589]: `https://github.com/ReactTraining/react-router/pull/5589`
[#&#8203;5720]: `https://github.com/ReactTraining/react-router/pull/5720`
[#&#8203;5508]: `https://github.com/ReactTraining/react-router/pull/5508`
[#&#8203;5792]: `https://github.com/ReactTraining/react-router/pull/5792`
[e6f9017]: remix-run/react-router@e6f9017
[#&#8203;5964]: `https://github.com/ReactTraining/react-router/pull/5964`
[#&#8203;5722]: `https://github.com/ReactTraining/react-router/pull/5722`

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).

Co-authored-by: Renovate Bot <[email protected]>
jeresig pushed a commit to Khan/react-router that referenced this pull request Aug 29, 2018
* Hoist dependencies = smaller react-router-dom UMD

Previously, react-router-dom's UMD builds contained duplicate code because they were fetching from both `packages/react-router/node-modules` and `packages/react-router-dom/node_modules`. With hoisting, this build is now
fetching from the root `node_modules`.

* eslint --fix the website.

* Update and sync packages.

* Fix website for React 16

* De-hoist RRN's react dep
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
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.

Rollup config correct?
3 participants