meteor / meteor/svelte-tutorial
Methods don't appear to be Optimistic
- Dominant language
- Svelte
- Stars
- 7
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
I don't believe the Methods are imported anywhere on the client so you can't take advantage of Optimistic UI. I think the intent is to take advantage of it since it's a key selling point of Meteor and the language in the tutorial makes it sound like you are using it.
As far as I can tell, this applies to all the tutorials.
If I'm missing something let me know but I made this change to test the `insert`
```
'tasks.insert': async function(text) {
check(text, String);
if (!this.userId) {
throw new Meteor.Error('Not authorized.');
}
if (this.isSimulation) {
console.log('simulation');
} else {
console.log('on the server');
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
await wait(2000);
console.log('done waiting')
}
TasksCollection.insert({
text,
createdAt: new Date(),
userId: this.userId,
});
},
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by checking how the Methods are imported and called in each tutorial, then use the shown tasks.insert change to verify whether simulation runs on the client before the server call. Done means the tutorials provide optimistic behavior consistently, or clearly explain why it is not available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100