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

Keyed each block always includes transitionManager #1437

Closed
corneliusio opened this issue May 8, 2018 · 6 comments
Closed

Keyed each block always includes transitionManager #1437

corneliusio opened this issue May 8, 2018 · 6 comments
Labels

Comments

@corneliusio
Copy link

So I was digging around in some generated code and I noticed transitionManager showing up even when no transitions are being used. After tinkering around for a while I discovered it was adding a key to an each block that was including it in the compiled code.

https://svelte.technology/repl?version=2.5.0&gist=c849e83c4bd28ab7b4214611892d4249

This may be needed for cases beyond transitions and it's just the naming that's throwing me off, but at the very least there are some basic cases where it's being included unnecessarily.

I also want to acknowledge that this is prob like 1KB of code minified. So it may not be a concern at all.

p.s. - Svelte is so legit. Thanks for all the work you put into making it even more awesome.

@Rich-Harris Rich-Harris added the bug label May 8, 2018
@Rich-Harris
Copy link
Member

Ah, whoops! This is due to changes made between 2.4 and 2.5, I think. Definitely counts as a bug — thanks

@corneliusio
Copy link
Author

@Conduitry
Copy link
Member

Looks like this was fixed (maybe on purpose? maybe by accident?) in 2.6.0. The keyed-each.ts helper updateKeyedEach no longer depends on the transition stuff, so it's not getting included. However, keyed-each.ts still has import { transitionManager, linear, generateRule, hash } from './transitions'; which looks to no longer be necessary.

@Conduitry
Copy link
Member

However, it does look like transitionManager is still included whenever you use {#await}, whether or not there are transitions.

@corneliusio
Copy link
Author

Yeah, I can confirm that this was fixed in 2.6.0.

@Conduitry
Copy link
Member

Opening #1514 for the issue with {#await} causing transitionManager to always be included, and closing this one, as it's fixed in 2.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants