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

{#await} blocks always cause transitionManager to be included #1514

Closed
Conduitry opened this issue May 29, 2018 · 4 comments
Closed

{#await} blocks always cause transitionManager to be included #1514

Conduitry opened this issue May 29, 2018 · 4 comments
Labels

Comments

@Conduitry
Copy link
Member

(Splitting this off from #1437 and closing that one, because they're kind of separate issues.)

If a component uses {#await} blocks, transitionManager will always be included, even if there are no transitions.

@Conduitry
Copy link
Member Author

This looks to be a little messy to fix. The handlePromise helper function checks whether there is anything in info.blocks before calling transitionManager - but the call to transitionManager will still always be there and so is included in the bundle. We know at compile time whether info.blocks is undefined, but it seems like we'd have to have two separate shared handlePromise helpers (one with transitions and one without), but to not have too much repeated code.

@Conduitry
Copy link
Member Author

My best idea so far, which I'm not thrilled with, is to make handlePromise accept a third argument that is the transitionManager, and the code generated in AwaitBlock.ts will either include or not include that third argument as appropriate. This involves a small amount of extra code when you are using outro transitions, and still carries along some unnecessary code when you are not using outro transitions, but does avoid including the whole transitionManager if you aren't using outro transitions.

@Conduitry
Copy link
Member Author

This appears to have been fixed by #1569 and can be closed next release

@Rich-Harris
Copy link
Member

fixed in 2.9.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

2 participants