Description
As Bundle Dependencies proposal briefly mentions, it would be nice that a resource listed in the index section of the bundle will be also a target of subresource loading, even if the resource is not mentioned in resources
in <script type=webbundle>
.
The benefit is: users don't have to list all resources in resources
. They have to specify only direct dependencies.
For example, suppose that main.html
is:
<script type="webbundle">
{
source: "a.wbn",
resources: [....] # what should be specified?
}
</script>
<link rel="style" href="a.css" />
...
<img src="a.png" />
...
<script type="module" src="a1.js" />
The bundle, a.wbn
has the following resources:
URL |
---|
./a1.js |
./a2.js |
./a3.js |
./a.png |
./a.css |
The dependency graph is:
main.html
├── a1.js
│ ├── a2.js
│ └── a3.js
├── a.png
└── a.css
Then, it would be nice that users can specify only the direct dependencies in resources
, as follows:
<script type="webbundle">
{
source: "a.wbn",
resources: ["a1.js", "a.css", "a.png"]
}
</script>
<link rel="style" href="a.css" />
...
<img src="a.png" />
...
<script type="module" src="a1.js" />
Instead of listing all resources:
<script type="webbundle">
{
source: "a.wbn",
resources: ["a1.js", "a2.js", "a3.js", "a.css", "a.png"]
}
</script>
<link rel="style" href="a.css" />
...
<img src="a.png" />
...
<script type="module" src="a1.js" />
We probably want to introduce an optional key in JSON of <script type=webbundle>
to enable this behavior of not, however, I'm feeling that this behavior is fine as the default behavior in most cases .