Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMake ServiceWorkerContainer::register return a Promise #13409
Comments
|
Please make a comment here if you intend to work on this issue. Thank you! |
|
Use |
|
@jdm May I? |
|
@Coder206 Sure, go ahead. |
|
@jdm I apologize for the delay, I am having trouble building Servo on all my instances. I noticed there are steps in the code ( |
|
@Coder206 The issue here is sufficiently scoped to only modifying |
|
After reading the new spec, it looks like the majority of the function body of |
|
I disagree. I don't think it's worth changing the goal posts here to adjust to the new specification changes; the goal of this issue to to change the implementation of |
ServiceWorkerContainer::Promise <!-- 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 fix #13409 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes <!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13419) <!-- Reviewable:end -->
ServiceWorkerContainer::Promise <!-- Please describe your changes on the following line: --> The purpose of the code changes is to enable the use of promises in the Service Worker container. I also modified the Service Worker test in order to support the promises. --- <!-- 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 fix #13409 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes <!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13419) <!-- Reviewable:end -->
ServiceWorkerContainer::Promise <!-- 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 fix #13409 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes <!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13419) <!-- Reviewable:end -->
|
@jdm Thanks for all your time, patience and help for this issue! I learnt lots! :-) |
Specification: https://w3c.github.io/ServiceWorker/#service-worker-container and https://w3c.github.io/ServiceWorker/#service-worker-container-register-method
Code:
components/script/dom/webidls/ServiceWorkerContainer.webidl,components/script/dom/serviceworkercontainer.rsThe implementation of
ServiceWorkerContainer::Registerwas written before #12830, which added support for Promise values in DOM APIs. We can rewrite the code to remain synchronous but return a resolved Promise so that our implementation becomes compatible with existing tests.