-
Notifications
You must be signed in to change notification settings - Fork 323
add tanstack start example/template #2222
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?
Conversation
|
View Vercel preview at instant-www-js-drewh-tanstack-start-jsv.vercel.app. |
3b47f2d to
d3c3474
Compare
|
|
f5e6404 to
7a41cc3
Compare
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite dev", |
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.
Def something weird going on at least when testing:
If I have www running, somehow this still overwrites the port
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.
Also now having this issue, can't find a way to fix.
not even this picked up on it https://vite.dev/config/server-options#server-strictport
| <div className="text-xs text-center"> | ||
| Open another tab to see todos update in realtime! | ||
| </div> | ||
| Secret data from server function: |
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.
May be nice to:
(a) make this look a little nicer
(b) add some small explanation. This demonstrate how to call the server
| export const appId = process.env.NEXT_PUBLIC_INSTANT_APP_ID; | ||
|
|
||
| export const db = init({ | ||
| appId: appId!, |
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.
nit: if this fails, there's no indication in the UI.
console shows "Uncaught (in promise) Error: Instant must be initialized with an appId."
Would be nice if we showed this error somehow, so folks could tell Claude etc.
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.
Working on a general solution in #2243
4e1e9c9 to
78995b5
Compare
3dfb66d to
b273374
Compare
Adds 3 new starter templates of increasing complexity:
Also changed:
also removes the package-lock from the nextjs example project. Reason is that if you use pnpm overrides to use local packages, that will also add the override to the package.lock. The package-lock gets removed by create-instant-app anyway.
tanstack-start and tanstack-start-full added to create-instant-app
Operations with the instant-cli will work with these templates because they both use VITE_PUBLIC environment variables.
Review guide:
In the instant repo:
cd examples/EXAMPLE-TO-TESTpnpm iinstant-cli initpnpm run devand to test CIA: set the INSTANT_REPO_FOLDER env variable to the location of your instant repo and run CIA in dev mode with INSTANT_CLI_DEV
Testing examples with dev dependencies (not necessary for this pr)
create a
pnpm-workspace.yamlfile in the root of the exampleWhen you change an @instantdb/package you must
pnpm iin the example to copy the new code into node modules. The override copies from the monorepo folder instead of fetching the files from the web. There are no symlinks.