rsnext/packages/next/server
Shu Ding b96ff8de2f
Fix CSS imports tree-shaking (#41357)
The way we currently track server CSS imports is to collect CSS files that each **module** depends on. This happens on the module graph level which is a global thing and cannot be tree-shaken properly (check the enabled test for more details).

In this PR we collect another information, of CSS files that each **entrypoint** depends on. This is the CSS list after tree-shaken on the entry level. By intersecting these CSS imports with the module-level CSS imports, we can get the final used CSS imports for each _layout_.

cc @hanneslund 

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a 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 a 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/examples/adding-examples.md)
2022-10-12 13:41:19 +00:00
..
api-utils Improve types for <Image /> and responseLimit (#40863) 2022-09-26 22:41:25 -07:00
base-http Improve types for <Image /> and responseLimit (#40863) 2022-09-26 22:41:25 -07:00
dev Enabel appDir when flag and dir existed at the same time (#41233) 2022-10-07 00:16:42 +02:00
lib Add handling for static generation in app (#40561) 2022-09-19 18:05:28 +00:00
response-cache Eliminate path polyfill and incremental-cache from base server (#39548) 2022-08-12 15:25:47 +00:00
send-payload Fix app static generation cases (#41172) 2022-10-06 21:43:23 +02:00
web proper error if middleware or api/route not return a Response (#41336) 2022-10-12 14:02:25 +02: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 Fix CSS imports tree-shaking (#41357) 2022-10-12 13:41:19 +00:00
base-server.ts Ensure RSC paths are normalized in minimal mode (#41348) 2022-10-12 07:17:17 +00:00
body-streams.ts Add response stream errorhandling in edge-function-runtime (#41102) 2022-10-06 11:56:13 -07:00
config-schema.ts Update middleware query hydration handling (#41243) 2022-10-10 12:58:18 -07:00
config-shared.ts Update middleware query hydration handling (#41243) 2022-10-10 12:58:18 -07:00
config-utils.ts feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
config.ts Fix experimental undici warning (#41077) 2022-09-30 17:20:20 -07:00
crypto-utils.ts Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
font-utils.ts Local font files adjust fallbacks (#41180) 2022-10-10 18:54:34 +00: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
google-font-metrics.json Adding experimental size adjust based option (#41009) 2022-09-30 00:35:50 +00:00
htmlescape.ts Subresource Integrity for App Directory (#39729) 2022-09-08 15:17:15 -07:00
image-optimizer.ts docs(image): improve error message when sharp is missing in standalone mode (#41133) 2022-10-05 17:28:29 +00:00
internal-utils.ts Rename flight parameters to rsc/next (#40979) 2022-09-28 13:18:37 +02:00
load-components.ts Add handling for static generation in app (#40561) 2022-09-19 18:05:28 +00:00
match-bundle.ts App Build Stats (#38884) 2022-08-10 19:31:01 +00:00
next-server.ts inline httpproxy usage (#41330) 2022-10-12 09:03:45 +00:00
next.ts Handle rewriting WebSocket requests (#39463) 2022-08-10 17:00:30 +00:00
node-polyfill-fetch.js feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
node-polyfill-web-streams.js Update Edge Runtime (#38862) 2022-07-21 18:29:19 +00:00
node-web-streams-helper.ts Load beforeInteractive scripts properly without blocking hydration (#41164) 2022-10-09 15:08:51 +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 Adding experimentalAdjustFallback feature to font optimization (#40185) 2022-09-16 14:13:21 -07:00
render-result.ts Fix app static generation cases (#41172) 2022-10-06 21:43:23 +02:00
render.tsx Fix warning messages for next export (#41165) 2022-10-04 20:34:35 +00:00
request-meta.ts Fix middleware rewrite for _next/data (#41341) 2022-10-11 12:23:22 -07:00
require.ts Add handling for static generation in app (#40561) 2022-09-19 18:05:28 +00:00
router.ts Fix middleware rewrite for _next/data (#41341) 2022-10-11 12:23:22 -07: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 Mask Flight Parameters from Middleware (#39939) 2022-09-15 14:53:51 +00:00
web-server.ts Fix app static generation cases (#41172) 2022-10-06 21:43:23 +02:00