Skip to content

Commit

Permalink
feat(server-runtime): support Priority Set-Cookie attribute (#6770)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Haines <andrew@haines.org.nz>
Co-authored-by: Matt Brophy <matt@brophy.org>
  • Loading branch information
haines and brophdawg11 committed Nov 6, 2023
1 parent 22c6f65 commit e69dff6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-insects-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/server-runtime": minor
---

Updated `cookie` dependency from `0.4.1` to [`0.5.0`](https://github.com/jshttp/cookie/blob/v0.5.0/HISTORY.md#050--2022-04-11) to inherit support for `Priority` attribute in Chrome
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
- gustavopch
- gyx1000
- hadizz
- haines
- hardingmatt
- harmony7
- helderburato
Expand Down
14 changes: 14 additions & 0 deletions packages/remix-server-runtime/__tests__/cookies-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,20 @@ describe("cookies", () => {
expect(setCookie2).toContain("Path=/about");
});

it("supports the Priority attribute", async () => {
let cookie = createCookie("my-cookie");

let setCookie = await cookie.serialize("hello world");
expect(setCookie).not.toContain("Priority");

let cookie2 = createCookie("my-cookie2");

let setCookie2 = await cookie2.serialize("hello world", {
priority: "high",
});
expect(setCookie2).toContain("Priority=High");
});

describe("warnings when providing options you may not want to", () => {
let spy = spyConsole();

Expand Down
4 changes: 2 additions & 2 deletions packages/remix-server-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"module": "dist/esm/index.js",
"dependencies": {
"@remix-run/router": "1.11.0",
"@types/cookie": "^0.4.1",
"@types/cookie": "^0.5.3",
"@web3-storage/multipart-parser": "^1.0.0",
"cookie": "^0.4.1",
"cookie": "^0.5.0",
"set-cookie-parser": "^2.4.8",
"source-map": "^0.7.3"
},
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2499,6 +2499,11 @@
resolved "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz"
integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==

"@types/cookie@^0.5.3":
version "0.5.3"
resolved "https://registry.npmjs.org/@types/cookie/-/cookie-0.5.3.tgz#3f98076ede5e467783507284d3c19215327fff8f"
integrity sha512-SLg07AS9z1Ab2LU+QxzU8RCmzsja80ywjf/t5oqw+4NSH20gIGlhLOrBDm1L3PBWzPa4+wkgFQVZAjE6Ioj2ug==

"@types/cookiejar@*":
version "2.1.2"
resolved "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz"
Expand Down Expand Up @@ -4502,7 +4507,7 @@ cookie-signature@^1.1.0, cookie-signature@^1.2.0:
resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.0.tgz"
integrity sha512-R0BOPfLGTitaKhgKROKZQN6iyq2iDQcH1DOF8nJoaWapguX5bC2w+Q/I9NmmM5lfcvEarnLZr+cCvmEYYSXvYA==

cookie@0.4.2, cookie@^0.4.1, cookie@^0.4.2:
cookie@0.4.2, cookie@^0.4.2:
version "0.4.2"
resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz"
integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==
Expand Down

0 comments on commit e69dff6

Please sign in to comment.