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

[WIP] V3 #12

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open

[WIP] V3 #12

wants to merge 52 commits into from

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Nov 4, 2018

the interesting new stuff is in https://github.com/sveltejs/svelte-upgrade/tree/v3/test/v3/samples


Some TODOs:

  • update bind:/class:/etc directives to use braces for argument (bind:foo='bar' -> bind:foo={bar})
  • throw an error when methods and data have conflicting names
  • existing imports in components are often dropped; haven't dug into when this is triggered. try e.g.: <script>import foo from 'foo'; export default { helpers: { foo } };</script>
  • code importing onprops from 'svelte' is generated, which is not exported by Svelte (could be a Svelte problem; not sure what the intention is here)
  • computed properties are still rewritten as argument-less function calls, rather than reactive declarations
  • top-level statements in <script> are not moved into the separate 'static' script tag; they are left in the default per-instance script

@Conduitry
Copy link
Member

Absolutely not an important complaint, but: Could this please not clobber the EOF newline if the input file has one?

@Rich-Harris
Copy link
Member Author

Good point — done

@Conduitry
Copy link
Member

I'm experimenting with running a few components I've written through this, and I just realized two things. 1) I apparently wrote a component with a method and a data item of the same name (!), and 2) this does not handle them well.

Things could be renamed if they were only used internally, but if both are exported, this is impossible to resolve automatically, as both get squished into one namespace. Perhaps another kind of warning or error message, indicating that manual edits are required?

@Conduitry
Copy link
Member

This also does not update class: directives to use braces around their argument, if that is something we settled on.

@Rich-Harris
Copy link
Member Author

Yeah, it's not quite up to date — it's not fixing directives per the latest in the RFC. I was waiting to see if anyone strongly disagreed about that first. Same for ref:foo --> bind:this={foo}

Just realised I have some commits locally as well, will push those now

@Rich-Harris
Copy link
Member Author

It might throw an error now if you have conflicting methods/data, I can't remember if I did that already

@Conduitry
Copy link
Member

Just pulled and built and re-ran and it looks like no, it does not complain about conflicting data and methods yet.

@rob-balfre
Copy link

Any plans to continue work on this? Got a large v2 code base and wanted to avoid a large refactor

@tivac
Copy link

tivac commented Oct 17, 2019

We're in the process of doing a gradual port to v3 using svelte-translator (shameless self plug) but I'd love to see this get finished off a bit. Would be great to automate the rest of the refactor as much as possible.

@Rich-Harris or @Conduitry given that it's been almost a year since the last commit should we assume this is dead?

@IgnusG
Copy link

IgnusG commented Sep 11, 2020

I think it's safe to assume the priority of the team has shifted abandoning v2 altogether.
This is a bit concerning regarding the future of svelte (and v3) in general

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.

None yet

5 participants