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

Revert namespaced history import #6288

Merged
merged 1 commit into from
Aug 10, 2018
Merged

Revert namespaced history import #6288

merged 1 commit into from
Aug 10, 2018

Conversation

billyjanitsch
Copy link
Contributor

See #6278 (comment) for rationale. In short, the change merged in #6278 will actually increase bundle size for ESM builds if other parts of react-router are used which include other parts of the history module.

Instead, please consider merging remix-run/history#597 and releasing a new version of the history module, which would allow webpack to more aggressively tree-shake react-router's use of history, providing equivalent bundle size savings regardless of how much of react-router is used.

@timdorr
Copy link
Member

timdorr commented Aug 10, 2018

Yep, that's correct. Thanks for this!

@timdorr timdorr merged commit 562d3d7 into remix-run:master Aug 10, 2018
@petermikitsh
Copy link
Contributor

petermikitsh commented Aug 10, 2018

@billyjanitsch Good catch, that is very much correct.

Made a repo to demo this: https://github.com/petermikitsh/module-import-demo

// This will import the CommonJS build
import LocationUtilsCommonJS from 'history/LocationUtils';

// This will import the Module build
import { LocationUtils } from 'history';

screen shot 2018-08-10 at 4 20 40 pm

@billyjanitsch billyjanitsch deleted the revert-history-import branch August 11, 2018 01:25
jeresig pushed a commit to Khan/react-router that referenced this pull request Aug 29, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Oct 10, 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.

3 participants