Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Running the server wasn't working for me, lot of errors. This change does a few things:
npm install
time and overall speedclient
,server
folders,server
lives inside of the Vite App, which allows us to set up thespacetime:*
scripts in a sensible mannerChanges to App.tsx
Avoided doing any changes to App.tsx as it reflects the quickstart guide, but some things were quite critical to change:
useEffect(fn, [])
. This is the most important, as before, the listeners were at the top level of the component. Which means, any state change(Even typing the message!) triggered the function to re-run, and by effect, recreate all the listeners without cleaning up the old ones, which caused quite a memory leak on even just changing the username.const client = useRef(spacetimeDBClient)
. Totally redundant.let
withconst
. Lets were giving off the impression that these values would be re-assigned later, but they never were.TODO:
CleanShot.2024-02-11.at.22.50.58.mp4
API
If the API is breaking, please state below what will break
Requires SpacetimeDB PRs
List any PRs here that are required for this SDK change to work