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 Web Workers with Fast Refresh #15145

Merged
merged 8 commits into from
Jul 14, 2020

Conversation

Timer
Copy link
Member

@Timer Timer commented Jul 14, 2020

This pull request fixes #12753 by setting the noop Fast Refresh helper functions in the web worker global scope.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@Timer Timer removed the kind: bug label Jul 14, 2020
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Jul 14, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
buildDuration 10.1s 10.1s ⚠️ +20ms
nodeModulesSize 66.5 MB 66.5 MB ⚠️ +3.81 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
/ failed reqs 0 0
/ total time (seconds) 1.745 1.72 -0.03
/ avg req/sec 1432.94 1453.37 +20.43
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.005 1.124 ⚠️ +0.12
/error-in-render avg req/sec 2487.61 2225.13 ⚠️ -262.48
Client Bundles (main, webpack, commons)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.js gzip 6.72 kB 6.72 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..cead.js gzip 9.77 kB 9.77 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.4 kB 56.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.module.js gzip 5.79 kB 5.79 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 6.17 kB 6.17 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.9 kB 51.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 273 B 273 B
Overall change 540 B 540 B
Rendered Page Sizes
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
index.html gzip 955 B 955 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
buildDuration 11.3s 11.2s -96ms
nodeModulesSize 66.5 MB 66.5 MB ⚠️ +3.81 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.js gzip 6.72 kB 6.72 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..cead.js gzip 9.77 kB 9.77 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.4 kB 56.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.module.js gzip 5.79 kB 5.79 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 6.17 kB 6.17 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.9 kB 51.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 273 B 273 B
Overall change 540 B 540 B
Serverless bundles
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
_error.js 881 kB 881 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 881 kB 881 kB
link.js 923 kB 923 kB
routerDirect.js 917 kB 917 kB
withRouter.js 917 kB 917 kB
Overall change 4.53 MB 4.53 MB
Commit: 778c5af

timneutkens
timneutkens previously approved these changes Jul 14, 2020
ijjk
ijjk previously approved these changes Jul 14, 2020
@ijjk
Copy link
Member

ijjk commented Jul 14, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
buildDuration 12.6s 12.6s -32ms
nodeModulesSize 66.5 MB 66.5 MB
Page Load Tests Overall increase ✓
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
/ failed reqs 0 0
/ total time (seconds) 2.059 2.001 -0.06
/ avg req/sec 1214.37 1249.33 +34.96
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.228 1.221 -0.01
/error-in-render avg req/sec 2036.33 2046.77 +10.44
Client Bundles (main, webpack, commons)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.js gzip 6.72 kB 6.72 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..cead.js gzip 9.77 kB 9.77 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.4 kB 56.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.module.js gzip 5.79 kB 5.79 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 6.17 kB 6.17 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.9 kB 51.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 273 B 273 B
Overall change 540 B 540 B
Rendered Page Sizes
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
index.html gzip 955 B 955 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
buildDuration 13.9s 14s ⚠️ +134ms
nodeModulesSize 66.5 MB 66.5 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.js gzip 6.72 kB 6.72 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..cead.js gzip 9.77 kB 9.77 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.4 kB 56.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.module.js gzip 5.79 kB 5.79 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 6.17 kB 6.17 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.9 kB 51.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 273 B 273 B
Overall change 540 B 540 B
Serverless bundles
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
_error.js 881 kB 881 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 881 kB 881 kB
link.js 923 kB 923 kB
routerDirect.js 917 kB 917 kB
withRouter.js 917 kB 917 kB
Overall change 4.53 MB 4.53 MB
Commit: f59acc8

@ijjk
Copy link
Member

ijjk commented Jul 14, 2020

Failing test suites

Commit: f59acc8

test/integration/legacy-sass/test/index.test.js

  • Legacy Sass Support should work in development > should render the page
Expand output

● Legacy Sass Support should work in development › should render the page

NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":".example"}
  (Session info: headless chrome=83.0.4103.116)

  46 |     try {
  47 |       browser = await webdriver(appPort, '/')
> 48 |       const exampleElText = await browser.elementByCss('.example').text()
     |                             ^
  49 |       expect(exampleElText).toBe('Hello World!')
  50 |     } finally {
  51 |       if (browser) {

  at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:550:15)
  at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:563:13)
  at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:489:26)
  at thenableWebDriverProxy.execute (../node_modules/selenium-webdriver/lib/webdriver.js:699:17)
  at Object.<anonymous> (integration/legacy-sass/test/index.test.js:48:29)

● Legacy Sass Support should work in development › should render the page

thrown: "Exceeded timeout of 60000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  42 |   })
  43 | 
> 44 |   it('should render the page', async () => {
     |   ^
  45 |     let browser
  46 |     try {
  47 |       browser = await webdriver(appPort, '/')

  at integration/legacy-sass/test/index.test.js:44:3
  at Object.<anonymous> (integration/legacy-sass/test/index.test.js:29:1)

@ijjk
Copy link
Member

ijjk commented Jul 14, 2020

Failing test suites

Commit: 643d33d

test/integration/legacy-sass/test/index.test.js

  • Legacy Sass Support should work in development > should render the page
Expand output

● Legacy Sass Support should work in development › should render the page

NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":".example"}
  (Session info: headless chrome=83.0.4103.116)

  46 |     try {
  47 |       browser = await webdriver(appPort, '/')
> 48 |       const exampleElText = await browser.elementByCss('.example').text()
     |                             ^
  49 |       expect(exampleElText).toBe('Hello World!')
  50 |     } finally {
  51 |       if (browser) {

  at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:550:15)
  at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:563:13)
  at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:489:26)
  at thenableWebDriverProxy.execute (../node_modules/selenium-webdriver/lib/webdriver.js:699:17)
  at Object.<anonymous> (integration/legacy-sass/test/index.test.js:48:29)

● Legacy Sass Support should work in development › should render the page

thrown: "Exceeded timeout of 60000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  42 |   })
  43 | 
> 44 |   it('should render the page', async () => {
     |   ^
  45 |     let browser
  46 |     try {
  47 |       browser = await webdriver(appPort, '/')

  at integration/legacy-sass/test/index.test.js:44:3
  at Object.<anonymous> (integration/legacy-sass/test/index.test.js:29:1)

@Timer Timer dismissed stale reviews from ijjk and timneutkens via 5e170f3 July 14, 2020 15:57
@Timer Timer requested review from timneutkens and ijjk July 14, 2020 15:57
@ijjk
Copy link
Member

ijjk commented Jul 14, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
buildDuration 12.4s 12.8s ⚠️ +425ms
nodeModulesSize 66.5 MB 66.5 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
/ failed reqs 0 0
/ total time (seconds) 2.152 2.23 ⚠️ +0.08
/ avg req/sec 1161.51 1121.02 ⚠️ -40.49
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.464 1.471 ⚠️ +0.01
/error-in-render avg req/sec 1707.68 1700.02 ⚠️ -7.66
Client Bundles (main, webpack, commons)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.js gzip 6.72 kB 6.72 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..cead.js gzip 9.77 kB 9.77 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.4 kB 56.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.module.js gzip 5.79 kB 5.79 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 6.17 kB 6.17 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.9 kB 51.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 273 B 273 B
Overall change 540 B 540 B
Rendered Page Sizes
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
index.html gzip 955 B 955 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
buildDuration 12.2s 12.9s ⚠️ +662ms
nodeModulesSize 66.5 MB 66.5 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.js gzip 6.72 kB 6.72 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..cead.js gzip 9.77 kB 9.77 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.4 kB 56.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
main-HASH.module.js gzip 5.79 kB 5.79 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 6.17 kB 6.17 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.9 kB 51.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 273 B 273 B
Overall change 540 B 540 B
Serverless bundles
vercel/next.js canary Timer/next.js hotfix/webworkers-fast-refresh Change
_error.js 881 kB 881 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 881 kB 881 kB
link.js 923 kB 923 kB
routerDirect.js 917 kB 917 kB
withRouter.js 917 kB 917 kB
Overall change 4.53 MB 4.53 MB
Commit: 5e170f3

@Timer Timer merged commit a131909 into vercel:canary Jul 14, 2020
@Timer Timer deleted the hotfix/webworkers-fast-refresh branch July 14, 2020 16:17
@rafeautie
Copy link

When will this make it to stable release?

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$RefreshReg$ is not defined in web worker after upgrading to 9.4.0
4 participants