-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
allow web worker resource to be relative #2086
allow web worker resource to be relative #2086
Conversation
I didn't notice the MSRV of 1.49. I'll fix this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A suggestion from me regarding re-implementing a std fn not yet available in MSRV.
Also admission that your naming is better than mine :)
Hi @astraw, could you please review the suggested changes to make this PR mergeable? |
I think this should be good to merge. However, Github shows me "Changes requested" although I thought I have now implemented all requested changes as far as I can see. Probably it is something with the Github PR UI that I do not understand, as I am not very familiar with it. Anyhow, it would be great if you would check this again and merge if you find appropriate. (Apologies for the delay, the last weeks have been busy.) |
It doesn't change until the person who made the request for changes approves of those changes :) Thank you for changes 🎉 LGTM. @voidpumpkin second pair of eyes please 👀 |
Description
This PR allows a web worker resource (the
.js
and_bg.wasm
files) to be specified relative to the loading path. Prior to this PR, the resource is specified with an absolute path. In this case - with an absolute path - if the resource is specified at"location.js"
, the path"/location.js"
will be used.As discussed in #2056, this adds a new method
name_of_resource_is_relative
to the traityew_agent::Agent
. The default implementation returnsfalse
and the current behavior - to specify an absolute path - remains unchanged. What is new here is that if an implementation implements this method and returnstrue
, the location of a web worker script is interpreted as relative to the current path.Fixes #2056.
Checklist
cargo make pr-flow