-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix: use Svelte parser for Svelte files #3204
Conversation
Using the Vue parser here leads to broken behavior when files use more than basic Svelte syntax.
|
|
@@ -41,6 +41,9 @@ | |||
"@babel/types": "^7.21.2", | |||
"@graphql-tools/load": "^7.5.3", | |||
"@vue/compiler-sfc": "^3.2.41", | |||
"typescript": "^4.8", |
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.
why put typescript in dependency
and not in devDependencies
?
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.
svelte2tsx
or one of its dependencies calls methods in typescript
that were added in 4.8.
could you sign CLA and add some tests to https://github.com/graphql/graphiql/blob/main/packages/graphql-language-service-server/src/__tests__/findGraphQLTags-test.ts so there will be no regression in the future? |
Can't get the CLA site to work unfortunately |
@tadeokondrak just make sure your git commits use the same email you signed the CLA with! |
That isn't the issue - downloading the PDF of the agreement gives me a .pdf file containing only the following:
Sorry, but I'd rather not go through the CLA support process to make this contribution. |
No change (site is still not showing me the individual contributor agreement) - closing |
@tadeokondrak I have filed an issue with the EasyCLA team to see if we can get this resolved for you. |
@tadeokondrak the CLA team confirmed your error and has pushed a fix; would you be willing to give it another go? We appreciate your contribution! |
@tadeokondrak reviving this PR as a new PR now, can you give me some test cases where svelte crashes? |
Great!
Not sure why, but this breaks with the old parser: <script>
graphql(`
mutation Test {
echo(m: "message")
}
`)
</script>
<div>
<div>Text</div>
</div> |
ah thank you! i will add this to the test. my guess is that is because vue expects |
ah, this introduced a bug with typescript module |
@tadeokondrak unfortunately using svelte2tsx introduces bundling issues with the typescript peer dependency. this isn't revealed with our unit tests, or by the local dev runner or even the vscode test runner, because it requires manually testing with the bundled vsix extension I am going to have to revert this change so that we can get the LSP server working again. You are welcome to re-create this PR again either without using a dependency with a peer dependency on typescript, or using svelte2tsx in a way that you can prove works with the bundled vscode-graphql vsix |
Using the Vue parser here leads to broken behavior when files use more
than basic Svelte syntax.