rsnext/test
Tobias Koppers 3f11815b02
avoid merging global css in a way that leaks into other chunk groups (#67373)
### What?

This disallows merging of global css with styles that appear on other
pages/chunk groups.

### Why?

Before we made the assumption that all CSS is written in a way that it
only affects the elements it should really affect.

In general writing CSS in that way is recommended. In App Router styles
are only added and never removed. This means when a user uses
client-side navigations to navigate the application, styles from all
previous pages are still active on the current page. To avoid visual
artefacts one need to write CSS in a way that it only affects certain
elements. Usually this can be archived by using class names. CSS Modules
even enforce this recommendation.

Assuming that all styles are written this way allows to optimize CSS
loading as request count can be reduced when (small) styles are merged
together.

But turns out that some applications are written differently. They use
global styles that are not scoped to a class name (e. g. to `body`
directly instead) and use them in different sections of the application.
They are structured in a way that doesn't allow client-side navigations
between these sections. This should be valid too, which makes our
assumption not always holding true.

This PR changes the algorithm so we only make that assumption for CSS
Modules, but not for global CSS. While this affects the ability to
optimize, applications usually do not use too much global CSS files, so
that can be accepted.

fixes #64773
2024-07-05 03:33:02 -07:00
..
.stats-app Bump minimum Node.js version to 18.18 (up from 18.17) (#67274) 2024-07-05 09:21:57 +00:00
development test: add test for parallel routes hmr (#67392) 2024-07-02 15:07:16 +00:00
e2e avoid merging global css in a way that leaks into other chunk groups (#67373) 2024-07-05 03:33:02 -07:00
examples Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
integration fix(next/image): handle invalid url (#67465) 2024-07-04 21:55:32 +02:00
lib Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00
production Bump minimum Node.js version to 18.18 (up from 18.17) (#67274) 2024-07-05 09:21:57 +00:00
unit fix(next/image): undo tight coupling between priority=true and fetchPriority=high (#67351) 2024-07-01 14:42:42 -04:00
.gitignore ci(workflow): enable test trace upload (#51107) 2023-06-12 17:14:13 +00:00
build-turbopack-build-tests-manifest.js Ensure production integration test results are uploaded (#63706) 2024-03-26 10:41:16 +01:00
build-turbopack-dev-tests-manifest.js Rename turbopack-tests-manifest to turbopack-dev-tests-manifest (#63409) 2024-03-19 10:26:14 +01:00
build-turbopack-tests-manifest.d.ts Update Turbopack test manifest from GitHub Actions artifact (#58394) 2023-11-24 16:48:12 +01:00
deploy-tests-manifest.json Fix noindex is missing on static not-found page (#67135) 2024-06-23 21:56:08 +02:00
get-test-filter.js fix e2e deployment test action (#66721) 2024-06-11 20:59:43 +00:00
jest-setup-after-env.ts Decrease default test timeouts (#56116) 2023-09-27 23:55:20 +00:00
ppr-tests-manifest.json Add timeout/retry handling for fetch cache (#66652) 2024-06-10 11:34:36 -07:00
readme.md
related-tests-manifest.json Reapply "chore(test): run related E2E deploy tests on PRs" (#64682) (#64712) 2024-04-19 11:02:43 +02:00
test-file.txt
turbopack-build-tests-manifest.json Ensure required-server-files test can exit cleanly (#66765) 2024-07-02 00:05:28 +02:00
turbopack-dev-examples-manifest.json Fix last examples for Turbopack (#64020) 2024-04-03 16:02:52 +02:00
turbopack-dev-tests-manifest.json Update Turbopack development test manifest (#67093) 2024-06-21 10:27:34 +02:00

See Testing for more information on how you can run/write/debug tests for Next.js.