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

Implement Service Workers API #11091

Open
creativcoder opened this issue May 9, 2016 · 6 comments
Open

Implement Service Workers API #11091

creativcoder opened this issue May 9, 2016 · 6 comments

Comments

@creativcoder
Copy link
Contributor

@creativcoder creativcoder commented May 9, 2016

Note: This is assigned to myself.

This is a meta issue tracker for the Service Worker Infrastructure project.
The following interfaces of the Service Workers Api, needs to be implemented.

ServiceWorker
ServiceWorkerGlobalScope
ServiceWorkerRegistration
ServiceWorkerContainer

The related PR's will be referenced here.

  • Implement a Custom response interface #10961
  • Implement Register method for Service Workers #11114
  • Integrate Service Worker manager thread with constellation #11727
  • Implement Registration match algorithm for Load Requests
  • Implement a Job queue for ServiceWorkerRegistration.
  • Implement Update, Install, Run algorithms
  • Implement FetchEvent interface
  • Service worker code only supports a single content process #15217
bors-servo added a commit that referenced this issue Jun 1, 2016
implement related service worker interface and register method

Fixes  #11091

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11114)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Jun 1, 2016
implement related service worker interface and register method

Fixes  #11091

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11114)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Jun 2, 2016
implement related service worker interface and register method

Fixes  #11091

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11114)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Jun 2, 2016
implement related service worker interface and register method

Fixes  #11091

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11114)
<!-- Reviewable:end -->
@KiChjang KiChjang reopened this Jun 2, 2016
@creativcoder creativcoder mentioned this issue Jun 12, 2016
4 of 4 tasks complete
bors-servo added a commit that referenced this issue Jul 12, 2016
Integrate service worker manager thread

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes are part of #11091

<!-- Either: -->
- [X] There are tests for these changes at my [gh-pages](https://github.com/creativcoder/gsoc16/tree/gh-pages) branch to test  the instantiation of service workers by their manager, but will need to discuss how that would integrate into master.

Changes:
- Introduces a `ServiceWorkerManager`, which maintains an map of registered service workers as well as a map of active workers keyed by their `scope_url`.
- Adds the initialization of ServiceWorkerManager, at the `script::init()`, which makes it available as a single entity listening for requests from different script threads.
- Adds a timeout thread in `serviceworkerglobalscope`, which terminates the workers, after a timeout of 60 secs, thereby removing it from the active workers list.
- Adds the matching of scope urls, in longest prefix way rather than path structural way, according to [spec](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#scope-match-algorithm).
- Make ServiceWorkerManager, the holder of network sender, instead of script thread, so it can send `CustomResponse`.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11727)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Jul 18, 2016
Integrate service worker manager thread

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes are part of #11091

<!-- Either: -->
- [X] There are tests for these changes at my [gh-pages](https://github.com/creativcoder/gsoc16/tree/gh-pages) branch to test  the instantiation of service workers by their manager, but will need to discuss how that would integrate into master.

Changes:
- Introduces a `ServiceWorkerManager`, which maintains an map of registered service workers as well as a map of active workers keyed by their `scope_url`.
- Adds the initialization of ServiceWorkerManager, at the `script::init()`, which makes it available as a single entity listening for requests from different script threads.
- Adds a timeout thread in `serviceworkerglobalscope`, which terminates the workers, after a timeout of 60 secs, thereby removing it from the active workers list.
- Adds the matching of scope urls, in longest prefix way rather than path structural way, according to [spec](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#scope-match-algorithm).
- Make ServiceWorkerManager, the holder of network sender, instead of script thread, so it can send `CustomResponse`.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11727)
<!-- Reviewable:end -->
@sendilkumarn
Copy link
Contributor

@sendilkumarn sendilkumarn commented Mar 7, 2017

Things like using no-cache by default were not implemented yet is it ? I would be more than happy to contribute things based on spec changes.

@jdm
Copy link
Member

@jdm jdm commented Mar 7, 2017

Some will be more relevant than others. The code that fetches scripts is very primitive at the moment.

@sendilkumarn
Copy link
Contributor

@sendilkumarn sendilkumarn commented Mar 7, 2017

agree to that. Let me know, if there is something in specific that I can start with.

@CYBAI
Copy link
Collaborator

@CYBAI CYBAI commented Aug 29, 2017

Hi @jdm

I'm curious that if there's any features not implemented yet related to ServiceWorker.
There're still some checkbox not checked in the description in this issue but I saw there're some PRs related to ServiceWorker merged from @creativcoder 's repo for gsoc16.
If there's any, I'd like to contribute for it 😄

Thanks!

@creativcoder
Copy link
Contributor Author

@creativcoder creativcoder commented Aug 29, 2017

Hi @CYBAI There is a lot left :) The last part which i was working on is the Update algorithm. You can start there if you want, (though i still have it on my local and plan on updating it)

But before we implement it i think;
The parts that you can start with are updating the existing definitions of service worker related structs (ServiceWorkerRegistration, ServiceWorker and ServiceWorkerContainer), as the spec has changed a lot, and it would be better if we reflect the spec updates to already existing structs and some smaller api's around it, to faciliate implementation of spec compliant lifecycle methods.

@jdm would provide more context on this

@CYBAI
Copy link
Collaborator

@CYBAI CYBAI commented Aug 29, 2017

Hi @creativcoder

Thanks for you reply!
I'm very interested in whole ServiceWorker structs. If I can, I'd like to check the current structs related to ServiceWorker in Servo, and update them with new spec.
I'm looking forward to hearing @jdm 's and your advices 😄
Thanks!

@CYBAI CYBAI mentioned this issue Nov 20, 2017
5 of 6 tasks complete
@jdm jdm moved this from Done to Unsure if needed in Mixed Reality future needs Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Mixed Reality future needs
  
Unsure if needed
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.