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

support bundle files without "index" in the name #358

Merged
merged 1 commit into from Mar 1, 2018

Conversation

Traviskn
Copy link
Contributor

@Traviskn Traviskn commented Feb 9, 2018

We have a project where we have more entry-points in addition to the index.js, but these other entry-point files don't have index in their name. (If you're curious about the use-case for this, it's because we are using react-native-threads.

This PR is a different strategy for finding the dev server origin without looking specifically for index. I'm very open to feedback on this approach or if anyone has a better idea for going about it.

@zamotany
Copy link
Contributor

zamotany commented Feb 12, 2018

With this approach, DEV_SERVER_ORIGIN is missing a protocol.

Also, do you use HMR in project??

@Traviskn
Copy link
Contributor Author

Oh you're right this is incomplete, I totally left out the protocol!

I was running into red screen errors, failing on this line of the polyfillEnvironment file, even though I hadn't turned on HMR. If there's a way to somehow opt out of this file getting run when I don't need HMR that would be a fine workaround for our project.

@thymikee
Copy link
Member

@Traviskn don't forget to rebase before you start working on that, we recently added a fix to this part of the codebase

@zamotany
Copy link
Contributor

You can move
https://github.com/joltup/haul/blob/2b7eb739cbc7d39efdc12a263a100413d350f5e4/src/utils/polyfillEnvironment.js#L39-L52

into src/hot/client/index.js but then it might break HMR on physical iOS devises.

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

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

Can you rebase this against master?

@Traviskn
Copy link
Contributor Author

Yes I'll rebase on master

@Traviskn Traviskn force-pushed the non-index-bundles branch 2 times, most recently from fe1b4ef to 2620db1 Compare February 15, 2018 03:59
@Traviskn
Copy link
Contributor Author

While rebasing I noticed that the latest changes to the polyfillEnvironment.js actually do stop errors from being thrown, so my change isn't strictly necessary unless someone needs HMR in a bundle without index in the name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants