-
Notifications
You must be signed in to change notification settings - Fork 118
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
How to converge Subresource Loading with WebBundle APIs, <script type=webbundle>
, with Bundle Preloading proposal
#699
Comments
w3ctag/design-reviews#616 (TAG review) might be related too. |
I've found one more gap between two proposals, "how to resolve a relative URL". In Subresource loading with WebBundles, a relative URL in https://github.com/WICG/webpackage/blob/main/explainers/subresource-loading.md#the-main-document
In Bundle Preloading, a relative URL specified in https://github.com/WICG/bundle-preloading/blob/main/overview.md
We might want to align somehow. I am feeling that using a bundle's URL is more intuitive. At the era of Now we use @irori What do you think? |
+1 to use the bundle's URL as the base URL. I think that is more intuitive. |
Thanks. Let's update the explainer and our implementation too. |
…ument's base URL The discussion is: WICG#699 (comment)
…ument's base URL The discussion is: #699 (comment)
The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25
The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25
The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25
The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244822 Reviewed-by: Kunihiko Sakamoto <[email protected]> Commit-Queue: Hayato Ito <[email protected]> Cr-Commit-Position: refs/heads/main@{#935333}
The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244822 Reviewed-by: Kunihiko Sakamoto <[email protected]> Commit-Queue: Hayato Ito <[email protected]> Cr-Commit-Position: refs/heads/main@{#935333}
The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244822 Reviewed-by: Kunihiko Sakamoto <[email protected]> Commit-Queue: Hayato Ito <[email protected]> Cr-Commit-Position: refs/heads/main@{#935333}
I like this as well: in experimenting with #624 we are currently injecting a |
Thanks for the helpful feedback! That can be another good reason we should prefer a bundle's URL as a base URL.
For the record, we updated at:
|
Let me clarify that #700 only changes how to resolve relative URLs in the JSON rule in Relative URL resolution in iframe document still uses the document's URL (e.g. |
I have opened a PR at WICG/bundle-preloading#28 so the prototype server will be able to handle both absolute and relative URLs in This means that
will be equivalent to
|
…ive URL on the bundle's URL, a=testonly Automatic update from web-platform-tests <script type=webbundle>: Resolve a relative URL on the bundle's URL The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244822 Reviewed-by: Kunihiko Sakamoto <[email protected]> Commit-Queue: Hayato Ito <[email protected]> Cr-Commit-Position: refs/heads/main@{#935333} -- wpt-commits: 6bbec86c72b31033d100beb6c571c37f1cdc5446 wpt-pr: 31395
…ive URL on the bundle's URL, a=testonly Automatic update from web-platform-tests <script type=webbundle>: Resolve a relative URL on the bundle's URL The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244822 Reviewed-by: Kunihiko Sakamoto <[email protected]> Commit-Queue: Hayato Ito <[email protected]> Cr-Commit-Position: refs/heads/main@{#935333} -- wpt-commits: 6bbec86c72b31033d100beb6c571c37f1cdc5446 wpt-pr: 31395
Just an idea, I'm wondering whether we can converge the syntax surface by introducing, such as, For example <script type=webbundle>
{
source: "foo.wbn",
use_cache: true,
resources: ["css/a.css", "css/b.css"]
}
</script>
Is there any implications if we share a syntax in this way? If I miss something, please let me know that! |
I'm having some trouble understanding which resources would be affected by For example, with this code: <script type="webbundle">
{
source: "./bundle.wbn",
resources: ["one.png", "two.png", "three.png"],
use_cache: false
}
</script>
<img src="one.png"/>
<img src="two.png"/> My understanding is that the browser would not fetch This is pretty much how it would work for Bundle Preloading as well. In our proposal, all three resources would then be stored in the regular HTTP cache by default (we are looking into using With |
I have also been looking at errors and edge cases. These are some of them, with our interpretation of what would be the right behaviour for each:
|
Thanks for the feedback!
The current behavior of "Subresource Loading" (which is use_cache: false here) is: |
Thank you very much for the explanation. In the example above this means that only With Bundle Preloading, only individual resources would be stored in cache. We do this because the bundle that the client receives (not the one stored in the server) will probably change a lot, because its contents depend on the resources listed on each tag and on the state of the cache when the preloading request is made. What is the use case that you are addressing with |
Thanks! How to cache for each sub resources in each webbundle has been a tricky issue for us. As far as I remember, several approaches have been proposed. e.g. Dynamic bundle serving with WebBundles, ResourceBundles, BundlePreloading, and maybe more coming? That's a reason we can't have it in V1, and explore this area in v2 once we get more insights and feedback in real use cases. |
The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244822 Reviewed-by: Kunihiko Sakamoto <[email protected]> Commit-Queue: Hayato Ito <[email protected]> Cr-Commit-Position: refs/heads/main@{#935333}
Update: Chromium is doing an origin trial for Subresource Loading with Web Bundles. Given that we've got a positive feedback from OT participants, the next important step is to update several Web standards, such as If someone finds any concerns about the current We want to find any potential compatibility issues between the current one (v1) and future ones (v2, v3,...), as early as possible, before trying to update relevant Web standards so that we don't regret anything. |
[Issue Triage] |
The explainer PR is: WICG/webpackage#700 One of the gaps between the Subresource Loading with WebBundles and Bundle Preloading proposals is "how to resolve a relative URL of resources". The former is using document's base URL, and the latter is using the bundle's URL. We have to align. At the era of <link>-based API, using a document's base URL might make sense because `resources` are specified in the link element's attribute. Now we use <script>-based APIs, and `resources` is specified in JSON, so we no longer have any strong reason to use a document's base URL. See the spec discussion for details: WICG/webpackage#699 (comment) Bug: 1263807 Change-Id: Ic71f095589daa42db2d4649e2cf77212616b2f25 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244822 Reviewed-by: Kunihiko Sakamoto <[email protected]> Commit-Queue: Hayato Ito <[email protected]> Cr-Commit-Position: refs/heads/main@{#935333} NOKEYCHECK=True GitOrigin-RevId: f06d042b5412ac6654e62c62a602468fa3646ecc
Let's start a discussion how to converge the current Subresource Loading with WebBundles with the Bundle Preloading proposal.
Regarding their declarative syntax, Subresource loading with WebBundles is using this syntax:
while the Bundle Preloading is using this syntax:
This example is taken from here.
I'm wondering how we can converge the syntax as much as possible. I know they solve slightly different goals, however, I think there are many common factors, and Bundle Preloading is listed as a target of v2 in the Subresource Loading's long term plan.
We'd appreciate any ideas or opinions what is the best way to converge both as much as possible.
Just for reference, Speculation Rules try to have a flexible syntax for defining what outgoing links can be prepared speculatively before navigation. I'm wondering how we can achieve the same goal to have a flexible syntax which is expressive enough to cover both cases
Before we ship Subresource Loading with WebBundles MVP, we'd like to make sure the syntax used there is naturally extended to cover Bundle Preloading too.
Related issues are: #648, #670, #697
The text was updated successfully, but these errors were encountered: