-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Mark Dalgleish <mark.john.dalgleish@gmail.com>
- Loading branch information
1 parent
825f70e
commit 6eedd68
Showing
4 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/dev": patch | ||
--- | ||
|
||
CSS imports with `?inline`, `?inline-css` and `?raw` are no longer incorrectly injected during SSR in development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,6 +157,7 @@ | |
- dhargitai | ||
- dhmacs | ||
- dima-takoy | ||
- dj-rabel | ||
- dmarkow | ||
- dmillar | ||
- DNLHC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { isCssUrlWithoutSideEffects } from "../vite/styles"; | ||
|
||
describe("isCssUrlWithoutSideEffects", () => { | ||
it("returns true for query parameters that result in an exported value with no side effects", () => { | ||
let urls = [ | ||
"my/file.css?inline", | ||
"my/file.css?inline-css", | ||
"my/file.css?inline&raw", | ||
"my/file.css?raw", | ||
"my/file.css?raw&url", | ||
"my/file.css?url", | ||
"my/file.css?url&something=else", | ||
"my/file.css?something=else&url", | ||
"my/file.css?url&raw", | ||
|
||
// other parameters mixed in | ||
"my/file.css?inline&something=else", | ||
"my/file.css?something=else&inline", | ||
"my/file.css?inline&raw&something=else", | ||
"my/file.css?something=else&inline&raw", | ||
"my/file.css?raw&something=else&url", | ||
"my/file.css?something=else&raw&url", | ||
"my/file.css?url&something=else&raw", | ||
"my/file.css?url&raw&something=else", | ||
"my/file.css?something=else&url&raw", | ||
]; | ||
|
||
for (let url of urls) { | ||
expect(isCssUrlWithoutSideEffects(url)).toBe(true); | ||
} | ||
}); | ||
|
||
it("returns false for other query parameters or no parameters", () => { | ||
let urls = [ | ||
"my/file.css", | ||
"my/file.css?foo", | ||
"my/file.css?foo=bar", | ||
"my/file.css?foo&bar", | ||
"my/file.css?inlinex", | ||
"my/file.css?rawx", | ||
"my/file.css?urlx", | ||
|
||
// values other than blank since Vite doesn't match these | ||
"my/file.css?inline=foo", | ||
"my/file.css?inline-css=foo", | ||
"my/file.css?raw=foo", | ||
"my/file.css?url=foo", | ||
|
||
// explicitly blank values since Vite doesn't match these | ||
"my/file.css?inline=", | ||
"my/file.css?inline-css=", | ||
"my/file.css?raw=", | ||
"my/file.css?url=", | ||
]; | ||
|
||
for (let url of urls) { | ||
expect(isCssUrlWithoutSideEffects(url)).toBe(false); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters