Problem
In older yew (0.15 and earlier), worker scripts were specified with a name relative to the main script. Now, I must anticipate the final URL of my scripts and specify any leading path components in Agent::name_of_resource() because this is now treated as relative to the origin and thus absolute. However, it would be useful to allow the relative behavior again as this would allow yew apps (with workers) to be dropped into a directory not at the root of a website,
One could potentially call this a regression but the behavior was purposefully changed in #1208 to fix #1175. In #1175, @domdir made two proposals: href should be replaced with either: "page origin" or "page origin + pathname". As noted (While page origin + pathname is closer to the way it behaves currently, I think the correct solution, however, is to only use the page origin), the preference was for "page origin" only and that was indeed the result of #1208, but I think "page origin + pathname" has a valid usecase.
Expected behavior
I think it should be possible for an app to opt-in to the old behavior or specifying the web worker name relative to the app.
Environment:
- Yew version: 0.16 and later
Questionnaire
Problem
In older yew (0.15 and earlier), worker scripts were specified with a name relative to the main script. Now, I must anticipate the final URL of my scripts and specify any leading path components in
Agent::name_of_resource()because this is now treated as relative to the origin and thus absolute. However, it would be useful to allow the relative behavior again as this would allow yew apps (with workers) to be dropped into a directory not at the root of a website,One could potentially call this a regression but the behavior was purposefully changed in #1208 to fix #1175. In #1175, @domdir made two proposals:
href should be replaced with either: "page origin" or "page origin + pathname". As noted (While page origin + pathname is closer to the way it behaves currently, I think the correct solution, however, is to only use the page origin), the preference was for "page origin" only and that was indeed the result of #1208, but I think "page origin + pathname" has a valid usecase.Expected behavior
I think it should be possible for an app to opt-in to the old behavior or specifying the web worker name relative to the app.
Environment:
Questionnaire