-
Notifications
You must be signed in to change notification settings - Fork 304
SSR #1905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
SSR #1905
Conversation
| "module": "esnext", | ||
| "moduleResolution": "node", | ||
| "module": "NodeNext", | ||
| "moduleResolution": "nodenext", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allows importing from "sub exports", moduleResolution: "node" means compiles to support for node v10, node next raises the minimum version of node
8e4e9fd to
cf80308
Compare
|
View Vercel preview at instant-www-js-drewh-ssr-jsv.vercel.app. |
| return new Response('sync', { | ||
| headers: { | ||
| // 24 hour expiry | ||
| 'Set-Cookie': `instant_refresh_token=${body.user.refresh_token}; Path=/; HttpOnly; Secure; SameSite=Strict; Max-Age=86400`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you're testing on localhost? I would expect the Secure field to prevent this from working.
| // kick off a request to cache it | ||
| this.getCurrentUser(); | ||
| this.getCurrentUser().then((userInfo) => { | ||
| this.syncUserToEndpoint(userInfo.user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the cookie only lives for 24 hours, should we have something in reactor that periodically refreshes it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have it sync in the background when reactor gets init'd, not sure of a better solution? ideas welcome
| } | ||
|
|
||
| async syncUserToEndpoint(user) { | ||
| if (this.config.endpointURI) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endpointURI seems too generic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i partially intentionally left it generic to account for more possible webhook actions in the future, also can't really think of a good name
17b63d1 to
f458ced
Compare
- working suspense catching - stream cache suspense entries - move cache to per render - begin work on typed query hook - progres - lots of cool stuff working - working query reactivity - cool typed hook - save me! - working schema date type inference - fix date objects - fix cardinality inference - use real auth - lots of cleanup + right before avoid http req on client only - better error
fix prettier
f458ced to
40c28ed
Compare
endpointURIoption in init@instantdb/react/nextjs