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

CSS hot reloading fix for platforms with urls that lack protocol and host prefix. #3649

Merged
merged 3 commits into from
Oct 16, 2019

Conversation

krisnye
Copy link
Contributor

@krisnye krisnye commented Oct 16, 2019

Our internal runtime reports a getBundleUrl() value of "/". This breaks css reloading unless the comparison is changed to match if the link base url starts with the bundle url.

↪️ Pull Request

This fixes a bug that breaks an internal adobe runtime. Our runtime uses unusual URLs which fail with the current comparison.

If we change the comparison to pass if the link url starts with the bundle base URL this fixes our problem.

Since the purpose of the check is only to make sure that externally referenced css files are not reloaded, this does not break current browser behavior.

A hot reloaded local url will still not start with an external urls protocol host and port.

💻 Examples

A typical link url in our runtime is "/src.f69400ca.css?1571167198029/"
The bundle.getBaseURL() is "/"

🚨 Test instructions

Hot reloading of local css files should still work.
External css files links should not be updated on local change.

✔️ PR Todo

  • [n/a] Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • [n/a] Included links to related issues/PRs

krisnye and others added 3 commits October 15, 2019 12:22
Our internal runtime reports a getBundleUrl() value of "/". This breaks css reloading unless the comparison is changed to match if the link base url starts with the bundle url.
@devongovett devongovett merged commit 5200ecc into parcel-bundler:master Oct 16, 2019
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

2 participants