Skip to content
This repository was archived by the owner on Sep 9, 2021. It is now read-only.

feat: support loading cross-origin workers through an inline proxy (options.crossOrigin) #143

Closed
wants to merge 3 commits into from

Conversation

ggoodman
Copy link

@ggoodman ggoodman commented May 4, 2018

No description provided.

@jsf-clabot
Copy link

jsf-clabot commented May 4, 2018

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented May 4, 2018

Codecov Report

Merging #143 into master will decrease coverage by 3.71%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #143      +/-   ##
=========================================
- Coverage   66.21%   62.5%   -3.72%     
=========================================
  Files           5       5              
  Lines          74      80       +6     
  Branches       25      29       +4     
=========================================
+ Hits           49      50       +1     
- Misses         22      26       +4     
- Partials        3       4       +1
Impacted Files Coverage Δ
src/workers/index.js 72.22% <16.66%> (-27.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04bc4ff...b7e3e89. Read the comment docs.

@ggoodman
Copy link
Author

ggoodman commented May 4, 2018

Note: I've signed the CLA.

@ggoodman ggoodman changed the title Support loading cross-domain workers using a importScripts proxy feat: support loading cross-origin workers through an inline proxy (options.crossOrigin) May 4, 2018
@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #143 into master will decrease coverage by 3.25%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #143      +/-   ##
=========================================
- Coverage   65.75%   62.5%   -3.26%     
=========================================
  Files           5       5              
  Lines          73      80       +7     
  Branches       23      29       +6     
=========================================
+ Hits           48      50       +2     
- Misses         22      26       +4     
- Partials        3       4       +1
Impacted Files Coverage Δ
src/workers/index.js 72.22% <16.66%> (-27.78%) ⬇️
src/index.js 88.88% <0%> (-0.31%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5718fc1...48cebf6. Read the comment docs.

@apexskier
Copy link

This is a feature I'm looking for as well. I'm going to pull this down and test it out.

README.md Outdated
@@ -125,6 +126,24 @@ webpack assets is used
}
```

### `crossOrigin`

Choose a reason for hiding this comment

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

I think this should be combined with the main Cross-Origin policy section or a note should be added there about this workaround.

Choose a reason for hiding this comment

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

You also might want to add a note that this will have no effect if the inline option is enabled.

README.md Outdated
### `crossOrigin`

Results in the use of an intermediate BLOB worker that will allow loading the worker code hosted on another origin.
This is useful if you want to host your javascript and worker code on a CDN and only makes sense if you have

Choose a reason for hiding this comment

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

There's another way this can be useful, if you use the __webpack_public_path__ option. I'd suggest updating this to link to the main webpack docs instead:

This is useful if you want to host your javascript and worker code on a CDN and only makes sense if you have configured a publicPath globally in webpack or local to this loader that is an http:// or https:// url.

This is useful if you want to host your javascript and worker code on a CDN and only makes sense if you have configured a publicPath [globally in webpack](https://webpack.js.org/guides/public-path/) or local to this loader that is an `http://` or `https://` url.

@ggoodman
Copy link
Author

@apexskier thanks for your review. Could you take a stab at making the suggested adjustments and I'll merge them into this PR?

@apexskier
Copy link

apexskier commented Jan 22, 2019

@ggoodman Here's a PR. It also merges with master, so it's a little messy. If you git merge master on this branch that'll make the diff cleaner. ggoodman#1

@ggoodman
Copy link
Author

@apexskier thanks!. As you guessed, I couldn't make anything of the PR against my branch but having merged I can now see that it LGTM.

@ggoodman ggoodman closed this Apr 26, 2020
@alexander-akait
Copy link
Member

@apexskier Unfortunately, we do not have enough time and energy for the current loader, maybe you want to become a champion and solve issues?

@pankajk07
Copy link

pankajk07 commented Aug 14, 2020

@evilebottnawi @ggoodman any plans of getting this merged and released ?

@alexander-akait
Copy link
Member

Same issue - #225 feel free to send a new PR

@ggoodman ggoodman deleted the feat-cross-origin branch August 20, 2020 12:44
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