hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

Update docs for sameSite option

Open camelmasa opened this issue 2 years ago • 6 comments

Description

Just updated docs for sameSite option. Ref: https://github.com/Shopify/hydrogen/blob/ee370be6d74b330db78d95b85f1733c8ca3eb2d7/packages/hydrogen/src/foundation/Cookie/Cookie.ts#L16


Before submitting the PR, please make sure you do the following:

  • [x] Read the Contributing Guidelines
  • [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123)
  • [x] Update docs in this repository according to your change

camelmasa avatar Aug 21 '22 08:08 camelmasa

I checked all docs in this repo. I don't think there is any other.

camelmasa avatar Aug 23 '22 16:08 camelmasa

I ignored that in CHANGELOG.md.

camelmasa@camelmasanoMacBook-Pro hydrogen % ag sameSite         
docs/framework/hydrogen-config.md
173:    sameSite: 'Strict',

docs/components/framework/cookie.md
19:  sameSite: 'Strict',
39:| sameSite | <code>"lax" &#124; "strict" &#124; "none"</code> | Declares that the cookie should be restricted to a first-party or [same-site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite) context.                                     |

docs/components/framework/filesessionstorage.md
23:    sameSite: 'Strict',

docs/components/framework/cookiesessionstorage.md
22:    sameSite: 'Strict',

docs/components/framework/memorysessionstorage.md
22:    sameSite: 'Strict',

examples/multipass/hydrogen.config.ts
13:    sameSite: 'Strict',

packages/hydrogen/CHANGELOG.md
1123:      sameSite: 'strict',
1165:  -    sameSite: 'strict',
1285:  +    sameSite: 'strict',

packages/hydrogen/src/foundation/Cookie/Cookie.ts
16:  sameSite?: 'Lax' | 'Strict' | 'None';

packages/create-hydrogen-app/CHANGELOG.md
244:  +    sameSite: 'strict',

templates/demo-store/hydrogen.config.ts
20:    sameSite: 'Strict',

camelmasa avatar Aug 23 '22 16:08 camelmasa

Ah, I need to change docs/components/framework/cookie.md... I'll do that!

camelmasa avatar Aug 23 '22 16:08 camelmasa

DONE!

camelmasa@camelmasanoMacBook-Pro hydrogen % ag sameSite     
docs/framework/hydrogen-config.md
173:    sameSite: 'Strict',

docs/components/framework/cookie.md
19:  sameSite: 'Strict',
39:| sameSite | <code>"Lax" &#124; "Strict" &#124; "None"</code> | Declares that the cookie should be restricted to a first-party or [same-site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite) context.                                     |

docs/components/framework/filesessionstorage.md
23:    sameSite: 'Strict',

docs/components/framework/memorysessionstorage.md
22:    sameSite: 'Strict',

docs/components/framework/cookiesessionstorage.md
22:    sameSite: 'Strict',

examples/multipass/hydrogen.config.ts
13:    sameSite: 'Strict',

packages/hydrogen/CHANGELOG.md
1123:      sameSite: 'strict',
1165:  -    sameSite: 'strict',
1285:  +    sameSite: 'strict',

packages/hydrogen/src/foundation/Cookie/Cookie.ts
16:  sameSite?: 'Lax' | 'Strict' | 'None';

packages/create-hydrogen-app/CHANGELOG.md
244:  +    sameSite: 'strict',

templates/demo-store/hydrogen.config.ts
20:    sameSite: 'Strict',

camelmasa avatar Aug 23 '22 16:08 camelmasa

@rennyG Do we need to update other files?

camelmasa avatar Aug 24 '22 23:08 camelmasa

@rennyG Do we need to update other files?

I did a search on this key/value in the shopify-dev repo, and it looks like no manual changes required there. When this PR is merged, though, we'll want the changes ported to shopify-dev. Let me know if you need a hand with that.

rennyG avatar Aug 29 '22 15:08 rennyG

Possible to test it?

jamalsoueidan avatar Apr 19 '24 05:04 jamalsoueidan

@jamalsoueidan Can you try installing @shopify/mini-oxygen@next after this GH action succeeds? Or you can also do the same change of this PR in your local node_modules/@shopify/mini-oxygen package, it's not a big change.

Edit: released in @shopify/[email protected]

frandiox avatar Apr 19 '24 08:04 frandiox

Perfect, it works ❤️

jamalsoueidan avatar Apr 19 '24 08:04 jamalsoueidan

@frandiox if you run multiply window, it will break as before just to let you know, i can live with one window.

jamalsoueidan avatar Apr 19 '24 15:04 jamalsoueidan

Ohh interesting, I think I know how to fix that but that will need to wait for a week or two ✈️ Feel free to reopen the issue and give more details 👍

frandiox avatar Apr 19 '24 18:04 frandiox

Ohh interesting, I think I know how to fix that but that will need to wait for a week or two ✈️ Feel free to reopen the issue and give more details 👍

Well, enjoy your holiday 👍🏻 When you come back we will look into that!

jamalsoueidan avatar Apr 19 '24 18:04 jamalsoueidan

I notice that the graphql is not auto updated, I have to terminate dev and boot up again.

If graphql not created yet, it will auto-generate the NEW graphql and use it, but if their was any errors, and you fix it, it will not re-generate graphql, so you must terminate and boot up.

jamalsoueidan avatar Apr 29 '24 02:04 jamalsoueidan

What do you mean with "the graphql"? A graphql query? Codegen? GraphiQL?

frandiox avatar May 01 '24 04:05 frandiox

I mean that when you define a GraphQL query and fragment, and use them in your code, it will recognize the query and the types, and you will receive all the values. However, if you modify the fragment again—by adding an ID, handle, or something similar—you won't see these attributes return until you reload the development environment

(even if running the codegen in the background)

Same goes with CSS, and doesn't work in multiply connections if testing in cypress, and in the browser, it breaks.

jamalsoueidan avatar May 01 '24 05:05 jamalsoueidan

if you run multiply window, it will break as before just to let you know, i can live with one window.

I'm testing with 5 tabs open but I can't break it 😞

I mean that when you define a GraphQL query and fragment, and use them in your code, it will recognize the query and the types, and you will receive all the values. However, if you modify the fragment again—by adding an ID, handle, or something similar—you won't see these attributes return until you reload the development environment

I'm trying with something like the following and it updates in all the 5 tabs:

image image

I've also tried with a separate fragment like this:

image

However, changing the fields in the query/fragment or the dom nodes seem to be updating in all the 5 tabs 🤔


cc @scottdixon are you able to reproduce this on your end?

frandiox avatar May 01 '24 10:05 frandiox

The problem happen when importing, not when it's in the same file.

Multiply times I had to terminate the dev to get the latest changes.

jamalsoueidan avatar May 01 '24 14:05 jamalsoueidan

@jamalsoueidan I think I found the problem with the GraphQL thing, thanks for reporting: https://github.com/Shopify/hydrogen/pull/2077

frandiox avatar May 02 '24 07:05 frandiox

I been using hydrogen every single day,,, so testing it is my daily routine hehe

jamalsoueidan avatar May 02 '24 10:05 jamalsoueidan

A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished. [Error: The script will never generate a response.] A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished. Error: Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance. at Object.wrappedBinding (miniflare-internal:wrapped:setup-environment:14:34) at requestHandler (/Users/jamalsoueidan/Development/booking-store/node_modules/@remix-run/server-runtime/dist/esm/server.js:136:303) at /Users/jamalsoueidan/Development/booking-store/node_modules/@shopify/remix-oxygen/dist/development/index.js:103:28 at Object.fetch (/Users/jamalsoueidan/Development/booking-store/server.ts:97:24) at withRequestHook (Users/jamalsoueidan/Development/booking-store/node_modules/@shopify/mini-oxygen/dist/vite/worker-entry.js:1053:20) Request POST https://booking-shopify-api.azurewebsites.net/api/products/get-users-image

jamalsoueidan avatar May 10 '24 01:05 jamalsoueidan