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

Fix "serviceWorker.js" path #3829

Merged
merged 2 commits into from
Jul 26, 2021
Merged

Fix "serviceWorker.js" path #3829

merged 2 commits into from
Jul 26, 2021

Conversation

cuining
Copy link
Contributor

@cuining cuining commented Jul 21, 2021

3.10.2 had this folder, but it was removed in version 3.11.0
cc @jsjoeio

@cuining cuining requested a review from a team as a code owner July 21, 2021 11:14
@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 21, 2021

Hey @cuining - thanks for the PR! That change was intentional as part of the migration away from Parcel. Please see these PRs:

I'm going to close this but if you find the issues with the service worker and believe this is the root cause, let us know!

@jsjoeio jsjoeio closed this Jul 21, 2021
@jsjoeio jsjoeio reopened this Jul 22, 2021
@jsjoeio jsjoeio self-assigned this Jul 22, 2021
@jsjoeio jsjoeio added the bug Something isn't working label Jul 22, 2021
@jsjoeio jsjoeio added this to the 3.12.0 milestone Jul 22, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 22, 2021

Update: you were right! Thank you for catching this and opening the PR. Sorry for closing it too quickly! I'll see if I can push a commit to fix any failing tests.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 22, 2021

Hmm...I'm struggling to push a change. @cuining Do you know if "Allow edits from maintainers" is checked?

Here is the needed change:

diff --git a/test/unit/browser/register.test.ts b/test/unit/browser/register.test.ts
index 6d1443f1..f2302cb8 100644
--- a/test/unit/browser/register.test.ts
+++ b/test/unit/browser/register.test.ts
@@ -155,7 +155,7 @@ describe("register", () => {
       await registerServiceWorker()
 
       expect(mockFn).toBeCalled()
-      expect(serviceWorkerPath).toMatch(`${csStaticBasePath}/dist/serviceWorker.js`)
+      expect(serviceWorkerPath).toMatch(`${csStaticBasePath}/out/browser/serviceWorker.js`)
       expect(serviceWorkerScope).toMatch("/")
     })
     it("should register when options.base is defined", async () => {
@@ -176,7 +176,7 @@ describe("register", () => {
       await registerServiceWorker()
 
       expect(mockFn).toBeCalled()
-      expect(serviceWorkerPath).toMatch(`/dist/serviceWorker.js`)
+      expect(serviceWorkerPath).toMatch(`/out/browser/serviceWorker.js`)
       expect(serviceWorkerScope).toMatch("/")
     })
   })

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 22, 2021

Tried another option. I don't think I have permission to edit your PR

image

Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should fix the issue but we need to update the tests. See PR comments for fix!

@codecov
Copy link

codecov bot commented Jul 25, 2021

Codecov Report

Merging #3829 (4e489f1) into main (0f45152) will increase coverage by 0.55%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3829      +/-   ##
==========================================
+ Coverage   62.05%   62.60%   +0.55%     
==========================================
  Files          36       36              
  Lines        1863     1872       +9     
  Branches      378      379       +1     
==========================================
+ Hits         1156     1172      +16     
+ Misses        601      595       -6     
+ Partials      106      105       -1     
Impacted Files Coverage Δ
src/browser/register.ts 100.00% <100.00%> (ø)
src/node/routes/vscode.ts 29.47% <0.00%> (-0.64%) ⬇️
src/node/util.ts 81.53% <0.00%> (+1.33%) ⬆️
src/browser/pages/vscode.ts 83.82% <0.00%> (+12.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f45152...4e489f1. Read the comment docs.

@cuining cuining requested a review from jsjoeio July 26, 2021 10:53
Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks again @cuining 🎉 (and sorry again for closing before)

We really appreciate you proactively fixing this ♥️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants