Skip to content
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

Use satisfies operator #7861

Merged
merged 2 commits into from
Dec 9, 2022
Merged

Use satisfies operator #7861

merged 2 commits into from
Dec 9, 2022

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Nov 28, 2022

sucrase, prettier, and eslint all support TypeScript 4.9 now. However, it looks like VS Code is still on 4.8.4

@changeset-bot
Copy link

changeset-bot bot commented Nov 28, 2022

🦋 Changeset detected

Latest commit: a22fb66

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Rich-Harris
Copy link
Member

Game was moved into a separate file the other day so that it could be unit-tested. Looks like it's now duplicated?

@benmccann
Copy link
Member Author

Yeah, I caught that right as you did. I've updated this. Going to mark it as draft until VS Code supports TypeScript 4.9, but I think it's otherwise ready to go

@benmccann
Copy link
Member Author

VS Code now supports TypeScript 4.9 and satisfies: https://code.visualstudio.com/updates/v1_74#_typescript-49

Mine just updated to include support for it

@Rich-Harris
Copy link
Member

The docs still convert this...

image

...into this when you opt into TypeScript mode:

image

Ideally it would be export async function load(...) {...} satisifes PageServerLoad. Is it worth trying to get that working before merging this, so that we're singing from the same hymn sheet everywhere? @dummdidumm how complex would that be?

@dummdidumm
Copy link
Member

Not that complex, but it's not going to be export async function load(...) {...} satisifes PageServerLoad (that's sadly not supported yet for some reason), it's going to be export const load = (async (...) => {...}) satisifes PageServerLoad

@Rich-Harris
Copy link
Member

ah yeah, turned out it was actually very simple: #8001. unfortunately the site doesn't build with that change, hence separate branch rather than a commit to this one

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Giving this my approval, but a little hesitant to merge it just now. I'm not sure how fast/how many devs will have the latest VS Code version, so a good percentage could be confused by that not working in their editor.

@Rich-Harris
Copy link
Member

I feel like we ought to wait until the docs are in sync anyway

@dummdidumm
Copy link
Member

They are now, I merged your PR into this one

@Rich-Harris
Copy link
Member

oh! i totally missed that. nice. how long should we wait? I feel like VSCode updates probably propagate quite quickly, though I'm not sure if there's a way to check. Part of me thinks that a couple of questions in Discord/etc is a reasonable price to pay for smoother typechecking for people checking out 1.0 for the first time

@benmccann
Copy link
Member Author

I think I would lean towards trying to get this in now because a bunch of people will be trying to write tutorials, post/answer StackOverflow questions, etc. and all that content will be using outdated syntax if we release 1.0 without this. Merging this now will cause more questions on Discord from people who haven't updated VS Code yet, but I think it's probably the lesser of two evils and just a temporary hiccup

@Rich-Harris Rich-Harris merged commit 20ed756 into master Dec 9, 2022
@Rich-Harris Rich-Harris deleted the satisfies branch December 9, 2022 16:38
@github-actions github-actions bot mentioned this pull request Dec 9, 2022
@524c
Copy link
Contributor

524c commented Dec 9, 2022

I'm watching this final race towards 1.0 🚀
I noticed that there is a typo in the title of this PR...

@benmccann benmccann changed the title Use satifies operator Use satisfies operator Dec 9, 2022
@benmccann
Copy link
Member Author

updated the title. luckily I got the changeset right first time around

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants