Skip to content
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 index a Web Packaging package? #26

Open
rektide opened this issue Mar 27, 2020 · 1 comment
Open

How to index a Web Packaging package? #26

rektide opened this issue Mar 27, 2020 · 1 comment

Comments

@rektide
Copy link

rektide commented Mar 27, 2020

One of the items mentioned in the WICG proposal post is the interaction with Web Packaging. I'm very interested to know more about what this interaction would look like.

Let's start with this scenario:

  1. I am a comic book site comic.yoyodyne.example. I have a PWA main site and distribute Web Package bundles with free comics.
  2. My customers Jane and Karen are offline on a subway ride. Both have the PWA.
  3. Karen sends Jane the latest Fantastic Overthrust Oscillators (FOO) bundle
  4. How does Jane's PWA find out about the bundle & it's content?

At the moment, I have only one path I can think of for this to work. My thought is that the FOO Bundle could have it's own index.html that has embedded within it an explicit, hardcoded list of all the other files also in the Web Bundle. FOO Bundle would step through this hardcoded list of content, & index.add() each item. Once done, it could redirect to the main PWA url.

The constraint is that currently Karen or Jane would have to know about the Bundle's unique index.html file, & know how to navigate there to initialize this problem. It's also a kind of gross solution any how, because the index.html file has to have some JS with the hardcoded list of content that's in the bundle.

What I would love to see would be a way for content to more easily declare itself as indexed. As a secondary objective, HTTP Push has almost the same problem, where the page/sw have no way to know about PUSHed content. There, a similar approach is also hacked together: use SSE or use WebSockets or some such to tell the browser about the content you have just PUSHed to it, so you can fetch() then cache that content. That issue is whatwg/fetch#65.

It would be really lovely to have a way to get content into the content index effectively. I would love for my Comic web app to be able to find out about the Comics it is being sent. Content-Index seems like it could be a breakthrough in enabling that, but there's still an outstanding question to me of how to get Web Package bundles into the content-index.

@rayankans
Copy link
Collaborator

Thanks for bringing this up @rektide. The scenario you described is what I've been looking into for the next version of the API, to enable users sharing content index entries.

It's still very much in the idea phase, but it would be something like allowing websites to include a web bundle as part of the content index description, which would make the entry sharable at the browser UI level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants