rsnext/packages/next/server
Shu Ding f12788dee8
HMR for client CSS imports (#39916)
Follow-up to #39758, this PR makes sure that CSS imports (both global and CSS modules) from client components are not handled by mini-css-extract's HMR logic. Instead, we trigger a server component update and let the client to refetch the RSC payload.

However, we are still leveraging the mini-css-extract plugin to emit CSS assets. So in this PR we add a new pitch loader to calculate the original file hash, but replace the final content to eliminate HMR logic but only keep the hash (so hot reloader can keep tracking that).

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-25 16:40:16 +00:00
..
api-utils Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
base-http Allow reading request bodies in middlewares (#34294) (#34519) 2022-02-18 19:43:43 +00:00
dev HMR for client CSS imports (#39916) 2022-08-25 16:40:16 +00:00
lib Fix next/future/image blur-up placeholder (#39785) 2022-08-23 18:56:52 -05:00
response-cache Eliminate path polyfill and incremental-cache from base server (#39548) 2022-08-12 15:25:47 +00:00
send-payload Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
web allow Edge Functions to stream a compressed fetch response (#39608) 2022-08-21 10:43:02 +00:00
accept-header.ts Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
app-render.tsx HMR for client CSS imports (#39916) 2022-08-25 16:40:16 +00:00
base-server.ts Handle edge runtime for app (#39910) 2022-08-24 14:49:47 -05:00
body-streams.ts Fix unhandled rejections with edge runtime (#39091) 2022-07-28 07:50:51 +00:00
config-schema.ts fix meaninglessFileNames type in compiler options schema (#39698) 2022-08-21 23:25:10 +00:00
config-shared.ts Remove webpack4 types (#39631) 2022-08-16 09:55:37 +00:00
config-utils.ts Setup require hook in next-server for styled-jsx resolving (#39305) 2022-08-08 20:27:42 -05:00
config.ts Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
crypto-utils.ts Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
font-utils.ts Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
get-app-route-from-entrypoint.ts App Build Stats (#38884) 2022-08-10 19:31:01 +00:00
get-page-files.ts Add initial handling for routing tests (#36635) 2022-05-03 10:37:23 +00:00
get-route-from-entrypoint.ts App Build Stats (#38884) 2022-08-10 19:31:01 +00:00
htmlescape.ts Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
image-optimizer.ts Fix next/future/image blur-up placeholder (#39785) 2022-08-23 18:56:52 -05:00
load-components.ts Refactor client entry plugin to separate methods. (#39162) 2022-08-12 13:01:19 +00:00
match-bundle.ts App Build Stats (#38884) 2022-08-10 19:31:01 +00:00
next-server.ts Handle edge runtime for app (#39910) 2022-08-24 14:49:47 -05:00
next.ts Handle rewriting WebSocket requests (#39463) 2022-08-10 17:00:30 +00:00
node-polyfill-fetch.js Pre-compile more dependencies (#32742) 2022-01-17 15:17:22 +00:00
node-polyfill-web-streams.js Update Edge Runtime (#38862) 2022-07-21 18:29:19 +00:00
node-web-streams-helper.ts Improved server CSS handling (#39664) 2022-08-17 10:56:52 +00:00
optimize-amp.ts Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
post-process.ts Optimize Edge SSR bundle size (#38570) 2022-07-12 23:39:18 +00:00
render-result.ts Add unstable_useFlushEffects hook (#34117) 2022-02-18 00:18:28 +00:00
render.tsx Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
request-meta.ts Update Edge Runtime (#38862) 2022-07-21 18:29:19 +00:00
require.ts Add support for optional catchall with new router (#38444) 2022-07-08 10:29:41 +00:00
router.ts fix(next-server): Fix priority for edge routes (#39462) 2022-08-16 19:05:03 +01:00
serve-static.ts fix(#39706): add avif support for node serve static (#39733) 2022-08-18 17:57:12 +00:00
server-route-utils.ts Enable @typescript-eslint/no-use-before-define variables,enums,typedefs for core files (#39511) 2022-08-11 16:32:52 -05:00
utils.ts chore: Clean up imports and unused code (#39044) 2022-07-26 21:41:59 +00:00
web-server.ts Handle edge runtime for app (#39910) 2022-08-24 14:49:47 -05:00