Skip to content

Commit

Permalink
feature(gatsby): Extract non-css-in-js css and add add to <head> when…
Browse files Browse the repository at this point in the history
… SSRing in dev (#28471)

* feature(gatsby): Pause dev-ssr watching between page loads to avoid slowing down regular develop-js HMR

* update snapshot

* Don't double-resolve + add activity for building the SSR bundle

* Add timeout for tests to ensure that dev server has time to bundle SSR + remove activity timers as not helpful

* feature(gatsby): Extract and add CSS when SSRing in dev

* Remove commented out code

* get tests passing

* WIP

* Got hot-reloading working w/ mini-css-extract-plugin

* remove mistakenly added file

* remove change to yarn.lock

* revert other mistakenly added files

* Add an async module to test against

* fix async module

* Add postcss/tailwind

* write webpack config for easy comparisons

* that was a lot easier than I thought — just set hmr:true for non-production sites

* cleanups

* Don't need this since we're using <link> not <style>

* pass in port

* remove dev css from test comparisons

* Update snapshots + add tailwind

* cleanups

* remove discarded changes

* Move changes behind flag

* Undo unnecesary changes

* Update tests for signature change

* Move more code behind the flag

* dynamically set absolute URL for css files so works wherever it's hosted

* start relative than make absolute

* Remove now unused port

* Remove changes from gatsbyjs/gatsby#28394

* use @pieh's suggested refactor in https://github.com/gatsbyjs/gatsby/pull/28471/files\#r546803732

* pass naming options for extractText in via options

* Update packages/gatsby/src/utils/webpack.config.js

Co-authored-by: Michal Piechowiak <[email protected]>

* Update snapshot

* Stop Jest from chocking on import of css

* turned out we didn't need this

* test(ssr): ignore src/test file (those are not tests)

* test(ssr): update snapshot after removing inline script modyfing href

Co-authored-by: Michal Piechowiak <[email protected]>
  • Loading branch information
gatsbybot and pieh committed Jan 4, 2021
1 parent 06bb8bf commit 94ecdd9
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
jsesc "^2.5.1"
source-map "^0.5.0"

"@babel/generator@^7.11.6", "@babel/generator@^7.12.5":
"@babel/generator@^7.11.6", "@babel/generator@^7.12.1", "@babel/generator@^7.12.5":
version "7.12.5"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.5.tgz#a2c50de5c8b6d708ab95be5e6053936c1884a4de"
integrity sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==
Expand All @@ -136,15 +136,6 @@
jsesc "^2.5.1"
source-map "^0.5.0"

"@babel/generator@^7.12.1":
version "7.12.1"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.1.tgz#0d70be32bdaa03d7c51c8597dda76e0df1f15468"
integrity sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==
dependencies:
"@babel/types" "^7.12.1"
jsesc "^2.5.1"
source-map "^0.5.0"

"@babel/helper-annotate-as-pure@^7.10.4":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3"
Expand Down Expand Up @@ -2773,7 +2764,12 @@
"@types/node" "*"
form-data "^3.0.0"

"@types/node@*", "@types/node@^8.5.7":
"@types/node@*":
version "14.0.27"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.27.tgz#a151873af5a5e851b51b3b065c9e63390a9e0eb1"
integrity sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==

"@types/node@^8.5.7":
version "8.10.66"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.66.tgz#dd035d409df322acc83dff62a602f12a5783bbb3"
integrity sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==
Expand Down

0 comments on commit 94ecdd9

Please sign in to comment.