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

Is the argument to generated createComment() calls ever used? #247

Closed
kzc opened this issue Jan 12, 2017 · 3 comments
Closed

Is the argument to generated createComment() calls ever used? #247

kzc opened this issue Jan 12, 2017 · 3 comments

Comments

@kzc
Copy link

kzc commented Jan 12, 2017

Generated code appears to use comments as anchors, but is the text of the comment ever used at runtime?

	var eachBlock_anchor = createComment( "#each allComments" );

Unless I'm mistaken only the comment object itself has to exist for Svelte functionality to work. Not including the comment text would save a few bytes in the bundle.

@Swatinem
Copy link
Member

That certainly is true. There is also #3 which is a tracking bug to get rid of anchors completely if there is a static element that can be used.

@Rich-Harris
Copy link
Member

Yeah, the names were just to make it easier to see what was going on when Svelte was first being developed — they've probably outlived their usefulness

@Conduitry
Copy link
Member

I've just submitted a PR from a branch where I had been looking at this a little while ago. It makes all the anchors be empty comments.

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

No branches or pull requests

4 participants