-
Notifications
You must be signed in to change notification settings - Fork 11
Updated the quickstart to use the new 1.0 API #130
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
Conversation
|
commit: |
I would prefer not to have the server code duplicated in a bunch of different places. I would much prefer that each client SDK repo contain only its client code, with a README linking to the module code in the main SpacetimeDB repository. Failing that, I would accept CI jobs which verify that the module code is line-for-line equal in the two repos. I want to avoid a situation (which we've been in several times in the past) in which each repo defines its own "quickstart-chat" module, with all the versions being different and mutually incompatible. |
Whoops! Apologies, that was supposed to be removed, not changed. Fixed. |
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.
How do I run this? I tried by running pnpm install
then pnpm run dev
from the examples/quickstart-chat
directory, and when I open it in my browser, I get a blank page and a bunch of errors in the console like the following:
Uncaught TypeError: DBConnection.builder(...).withUri(...).withModuleName(...).withToken is not a function
|
||
It is based directly on the plain React + TypeScript + Vite template. You can follow the quickstart guide for how creating this project from scratch at [SpacetimeDB TypeScript Quickstart](https://spacetimedb.com/docs/sdks/typescript/quickstart). | ||
|
||
You can follow the instructions for creating your own SpacetimeDB module here: [SpacetimeDB Rust Module Quickstart](https://spacetimedb.com/docs/modules/rust/quickstart). Place the module in the `quickstart-chat/server` directory for compability with this project. |
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.
This might be more of a comment on the quickstart docs, but I think it would be quicker to get up and running if this linked to the server module code that is ready to be run immediately.
@@ -0,0 +1,60 @@ | |||
# SpacetimeDB TypeScript Quickstart Chat |
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.
Can we add the instructions for running this to the readme? As someone who likes to start with being able to run an end-to-end example, then go through the code, it's nice to be able to get clear setup instructions without going through the explanation of how to write the code.
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.
Yes, I can do this.
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.
Steps are added (Zeke added them)
e6441a1
to
4c7ad25
Compare
Merging because we decided we don't need the tests for now. |
Description of Changes
I've renamed the
examples/quickstart
directory toexamples/quickstart-chat
for standardization purposes, and also updated the quickstart example project to be in line with the new 1.0 API and the new quickstart guide in the docs: clockworklabs/spacetime-docs#141.The directory structure now matches https://github.com/clockworklabs/SpacetimeDB/tree/master/crates/sdk/examples/quickstart-chat identically.
The standard path is
<sdk-path>/examples/quickstart-chat
.Note that this differs from what the quickstart tutorial tells you do to. In the tutorial the client is in
quickstart-chat/client
. Phoebe and I feel that that is okay.API
This is not an API breaking change.
Requires SpacetimeDB PRs
I do not believe it needs any.
Test
I've added an integration test that verifies that you can connect to SpacetimeDB, change your name and post a message.