Use index section as resources
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
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 .
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Bundle Dependencies proposal and the webbundle script examples in this issue. Decide whether index entries should serve as subresource-loading targets by default or behind an optional JSON key, then document the agreed behavior in the relevant Web Bundle proposal or specification. Done means the dependency graph and resources/index semantics are unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100