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

destructure await #4548

Merged
merged 6 commits into from
Mar 15, 2020
Merged

Conversation

tanhauhau
Copy link
Member

@tanhauhau tanhauhau commented Mar 12, 2020

Fixes #1851

  • tidy
  • more test case

@tanhauhau tanhauhau force-pushed the tanhauhau/destructure-await branch from c1d394a to 96156d0 Compare March 13, 2020 14:53
@tanhauhau tanhauhau changed the title WIP: destructure await destructure await Mar 13, 2020
@tanhauhau tanhauhau force-pushed the tanhauhau/destructure-await branch from 81b7845 to e546487 Compare March 13, 2020 23:29
@Conduitry Conduitry merged commit 7d1e4e8 into sveltejs:master Mar 15, 2020
@Conduitry
Copy link
Member

Is there some DRYing that we can do between each block destructuring and await block destructuring now? We can do that in a separate issue/PR if so.

@tanhauhau tanhauhau deleted the tanhauhau/destructure-await branch March 15, 2020 10:31
@tanhauhau
Copy link
Member Author

oh.. i didn't know there's another util for each destructuring, https://github.com/sveltejs/svelte/blob/master/src/compiler/parse/read/context.ts#L46

interestingly, it doesn't support default values in destructuring:

{#each list as { a = 2 }} // error: assignment pattern are not supported

{#each list as [ a = 2 ]} // error: assignment pattern are not supported

do you think we should support that when DRYing them out?

xla added a commit to radicle-dev/prettier-plugin-svelte that referenced this pull request Mar 22, 2020
Svelte 3.20.0 introduced support for await destructing, see
svetlejs/svelte#1851 and sveltejs/svelte#4548. This change supports
this syntax and keep this plugin functional with the newest svelte
version
taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Await Destructuring
2 participants