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

deconflict inline component instance variable name #4792

Closed
wants to merge 3 commits into from

Conversation

Conduitry
Copy link
Member

Fixes #4636.

@Conduitry Conduitry marked this pull request as draft May 6, 2020 18:52
@Conduitry
Copy link
Member Author

Marking this as draft. The failing js sample tests made me notice that this is apparently being a bit overzealous with the deconflicting and I want to take another look at why that's happening.

@tanhauhau tanhauhau mentioned this pull request Jun 1, 2020
4 tasks
@tanhauhau
Copy link
Member

wonder you get any findings on this one.
from what i gather, get_unique_name is called twice, that's why.

  • after all the render_dom wrappers were created, each of their variable name is not yet deconflicted. after that, the Renderer will call assign_variable_name to call get_unique_name to deconflict them.

but your change calls the get_unique_name in the InlineComponentWrappers constructor as well.

calling the get_unique_name first, will add the variable name into the set, and calling it again with the same name will deconflict it, causing the name to change, even though there's no naming conflict.

i wonder maybe we should do deconflict in each wrapper, instead of inside the assign_variable_name? i see a // TODO messy over there.

i hv a working branch, https://github.com/sveltejs/svelte/compare/master...tanhauhau:tanhauhau/deconflict-wrapper-var-names?expand=1, that i haven't updated the sample test.

but doing so, the generated variable name is very messy, attached 1 updated sample test in the diff.

@Conduitry Conduitry closed this Jun 2, 2020
@Conduitry Conduitry deleted the gh-4636 branch June 2, 2020 12:55
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.

Site REPL started "hanging" as I tried to produce an example for a different bug
2 participants