From cd76c110f72504d02b69c264928c5435be56c098 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 27 May 2017 09:57:42 -0400 Subject: [PATCH] make transitionManager treeshakeable (fixes #593) --- src/generators/dom/shared.ts | 2 +- src/shared/transitions.js | 17 +++---- .../_actual-bundle.js | 44 ------------------- .../expected-bundle.js | 44 ------------------- .../computed-collapsed-if/_actual-bundle.js | 44 ------------------- .../computed-collapsed-if/expected-bundle.js | 44 ------------------- .../_actual-bundle.js | 44 ------------------- .../expected-bundle.js | 44 ------------------- .../event-handlers-custom/_actual-bundle.js | 44 ------------------- .../event-handlers-custom/expected-bundle.js | 44 ------------------- .../if-block-no-update/_actual-bundle.js | 44 ------------------- .../if-block-no-update/expected-bundle.js | 44 ------------------- .../samples/if-block-simple/_actual-bundle.js | 44 ------------------- .../if-block-simple/expected-bundle.js | 44 ------------------- .../non-imported-component/_actual-bundle.js | 44 ------------------- .../non-imported-component/expected-bundle.js | 44 ------------------- .../_actual-bundle.js | 44 ------------------- .../expected-bundle.js | 44 ------------------- .../use-elements-as-anchors/_actual-bundle.js | 44 ------------------- .../expected-bundle.js | 44 ------------------- 20 files changed, 10 insertions(+), 801 deletions(-) diff --git a/src/generators/dom/shared.ts b/src/generators/dom/shared.ts index a368a0e580..020df20aac 100644 --- a/src/generators/dom/shared.ts +++ b/src/generators/dom/shared.ts @@ -29,7 +29,7 @@ export default { "linear": "function linear ( t ) {\n\treturn t;\n}", "generateKeyframes": "function generateKeyframes ( a, b, delta, duration, ease, fn, node, style ) {\n\tvar id = '__svelte' + ~~( Math.random() * 1e9 ); // TODO make this more robust\n\tvar keyframes = '@keyframes ' + id + '{\\n';\n\n\tfor ( var p = 0; p <= 1; p += 16.666 / duration ) {\n\t\tvar t = a + delta * ease( p );\n\t\tkeyframes += ( p * 100 ) + '%{' + fn( t ) + '}\\n';\n\t}\n\n\tkeyframes += '100% {' + fn( b ) + '}\\n}';\n\tstyle.textContent += keyframes;\n\n\tdocument.head.appendChild( style );\n\n\tnode.style.animation = node.style.animation.split( ',' )\n\t\t.filter( function ( anim ) {\n\t\t\t// when introing, discard old animations if there are any\n\t\t\treturn anim && ( delta < 0 || !/__svelte/.test( anim ) );\n\t\t})\n\t\t.concat( id + ' ' + duration + 'ms linear 1 forwards' )\n\t\t.join( ', ' );\n}", "wrapTransition": "function wrapTransition ( node, fn, params, intro, outgroup ) {\n\tvar obj = fn( node, params );\n\tvar duration = obj.duration || 300;\n\tvar ease = obj.easing || linear;\n\n\t// TODO share