NativeScript / worker-loader

36 stars 20 forks source link

Adding customDomain option to suppot fetching worker script from othe… #43

Closed raronen closed 5 years ago

raronen commented 5 years ago

Addin customDomain option to fix download worker script from other domain (cdn) issue.

This option enable to download the worker script from an external domain. Should be used when webpack_public_path points to "https://domain..".

cla-bot[bot] commented 5 years ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign the CLA at https://www.nativescript.org/cla. CLA has not been signed by users: @raronen. After signing the CLA, you can ask me to recheck this PR by posting @cla-bot check as a comment to the PR.

raronen commented 5 years ago

@cla-bot check

cla-bot[bot] commented 5 years ago

The cla-bot has been summoned, and re-checked this pull request!

sis0k0 commented 5 years ago

Hey @raronen, the changes look good to me. Was there some problem that forced you to close the PR?

raronen commented 5 years ago

Yes, I didn’t know it but it turns out that the worker script must be served from the same domain (including the protocol) as the script that is creating the worker

Taken from herehttps://benohead.com/cross-domain-cross-browser-web-workers/.

So it’s not as simple as I thought it would be. I wrote this this in the issue I opened and close it also.

I eventually decided to use the original worker-loader and download the script inline.

Thanks, Raz From: Stanimira Vlaeva notifications@github.com Sent: Wednesday, July 31, 2019 4:27 PM To: NativeScript/worker-loader worker-loader@noreply.github.com Cc: Raz Ronen Raz.Ronen@microsoft.com; Mention mention@noreply.github.com Subject: Re: [NativeScript/worker-loader] Adding customDomain option to suppot fetching worker script from othe… (#43)

Hey @raronenhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fraronen&data=02%7C01%7CRaz.Ronen%40microsoft.com%7C6f156afe0a57491cf8b108d715bab7d3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637001763997580364&sdata=yuNxUGoZrLkfjTlrEBcA9PhTs0UmnvZzWl5oZrZDLOQ%3D&reserved=0, the changes look good to me. Was there some problem that forced you to close the PR?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FNativeScript%2Fworker-loader%2Fpull%2F43%3Femail_source%3Dnotifications%26email_token%3DAMDNM6Z5FWUBCS2MMLEQ4ZTQCGHI5A5CNFSM4IHVDTE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3HHUCI%23issuecomment-516848137&data=02%7C01%7CRaz.Ronen%40microsoft.com%7C6f156afe0a57491cf8b108d715bab7d3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637001763997580364&sdata=VHiwgds%2B7aJNuFUB7NwxOKhaEHCtG90zjkvsyQH5e%2FA%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMDNM626J2WZNSDSX3WU7W3QCGHI5ANCNFSM4IHVDTEQ&data=02%7C01%7CRaz.Ronen%40microsoft.com%7C6f156afe0a57491cf8b108d715bab7d3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637001763997590373&sdata=YpCeKSkAF2mhyf6Czs8f0SGYBiLkou%2FfDkUrjX%2B9uJ4%3D&reserved=0.

sis0k0 commented 5 years ago

Thanks for the explanation! The solution that you went with sounds reasonable :)