From f45e2b70fdaad54e86fbdf725ed19176b8746262 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 15 Dec 2018 19:18:03 -0500 Subject: [PATCH] Implement reactive assignments (#1839) This also includes elements of RFCs 2 and 3 --- .gitignore | 8 +- .travis.yml | 1 - appveyor.yml | 2 +- index.js | 7 + package-lock.json | 3021 ++++++++++++----- package.json | 26 +- src/ssr/register.js => register.js | 15 +- rollup.config.js | 37 +- rollup.store.config.js | 9 - src/Stats.ts | 17 +- src/cli/compile.ts | 3 +- src/cli/index.ts | 2 +- src/compile/Component.ts | 1241 +++---- src/compile/css/Stylesheet.ts | 12 +- src/compile/index.ts | 65 +- src/compile/nodes/Action.ts | 17 +- src/compile/nodes/Animation.ts | 11 +- src/compile/nodes/Attribute.ts | 13 +- src/compile/nodes/AwaitBlock.ts | 5 +- src/compile/nodes/Binding.ts | 24 +- src/compile/nodes/CatchBlock.ts | 7 +- src/compile/nodes/EachBlock.ts | 9 +- src/compile/nodes/Element.ts | 40 +- src/compile/nodes/EventHandler.ts | 162 +- src/compile/nodes/InlineComponent.ts | 16 +- src/compile/nodes/Meta.ts | 5 + src/compile/nodes/ThenBlock.ts | 7 +- src/compile/nodes/Transition.ts | 12 +- src/compile/nodes/Window.ts | 32 +- src/compile/nodes/shared/Expression.ts | 354 +- src/compile/nodes/shared/Node.ts | 4 +- src/compile/nodes/shared/mapChildren.ts | 2 + src/compile/render-dom/Block.ts | 101 +- src/compile/render-dom/Renderer.ts | 9 +- src/compile/render-dom/index.ts | 542 +-- src/compile/render-dom/wrappers/AwaitBlock.ts | 10 +- src/compile/render-dom/wrappers/DebugTag.ts | 2 +- src/compile/render-dom/wrappers/Document.ts | 54 +- src/compile/render-dom/wrappers/EachBlock.ts | 45 +- .../render-dom/wrappers/Element/Attribute.ts | 16 +- .../render-dom/wrappers/Element/Binding.ts | 115 +- .../wrappers/Element/StyleAttribute.ts | 7 +- .../render-dom/wrappers/Element/index.ts | 344 +- src/compile/render-dom/wrappers/Fragment.ts | 1 + src/compile/render-dom/wrappers/IfBlock.ts | 24 +- .../wrappers/InlineComponent/index.ts | 325 +- src/compile/render-dom/wrappers/Slot.ts | 9 +- src/compile/render-dom/wrappers/Text.ts | 2 +- src/compile/render-dom/wrappers/Title.ts | 13 +- src/compile/render-dom/wrappers/Window.ts | 106 +- src/compile/render-dom/wrappers/shared/Tag.ts | 30 +- .../render-dom/wrappers/shared/Wrapper.ts | 2 +- .../render-dom/wrappers/shared/addActions.ts | 54 + .../wrappers/shared/addEventHandlers.ts | 36 + src/compile/render-ssr/Renderer.ts | 13 +- src/compile/render-ssr/handlers/AwaitBlock.ts | 8 +- src/compile/render-ssr/handlers/DebugTag.ts | 3 +- src/compile/render-ssr/handlers/EachBlock.ts | 14 +- src/compile/render-ssr/handlers/Element.ts | 16 +- src/compile/render-ssr/handlers/Head.ts | 2 +- src/compile/render-ssr/handlers/HtmlTag.ts | 4 +- src/compile/render-ssr/handlers/IfBlock.ts | 4 +- .../render-ssr/handlers/InlineComponent.ts | 143 +- src/compile/render-ssr/handlers/Slot.ts | 6 +- src/compile/render-ssr/handlers/Tag.ts | 8 +- src/compile/render-ssr/index.ts | 164 +- src/compile/render-ssr/utils.ts | 3 + .../validate/js/propValidators/actions.ts | 16 - .../validate/js/propValidators/animations.ts | 21 - .../validate/js/propValidators/components.ts | 36 - .../validate/js/propValidators/computed.ts | 84 - .../validate/js/propValidators/data.ts | 15 - .../validate/js/propValidators/events.ts | 16 - .../validate/js/propValidators/helpers.ts | 49 - .../validate/js/propValidators/immutable.ts | 11 - .../validate/js/propValidators/index.ts | 47 - .../validate/js/propValidators/methods.ts | 42 - .../validate/js/propValidators/namespace.ts | 33 - .../validate/js/propValidators/oncreate.ts | 14 - .../validate/js/propValidators/ondestroy.ts | 14 - .../validate/js/propValidators/onrender.ts | 12 - .../validate/js/propValidators/onstate.ts | 14 - .../validate/js/propValidators/onteardown.ts | 12 - .../validate/js/propValidators/onupdate.ts | 14 - .../validate/js/propValidators/preload.ts | 6 - .../validate/js/propValidators/props.ts | 21 - .../validate/js/propValidators/setup.ts | 15 - .../validate/js/propValidators/store.ts | 6 - src/compile/validate/js/propValidators/tag.ts | 20 - .../validate/js/propValidators/transitions.ts | 21 - .../validate/js/utils/checkForAccessors.ts | 17 - .../validate/js/utils/checkForComputedKeys.ts | 16 - .../validate/js/utils/checkForDupes.ts | 23 - .../validate/js/utils/usesThisOrArguments.ts | 33 - src/compile/validate/utils/fuzzymatch.ts | 8 - src/compile/wrapModule.ts | 257 +- src/index.ts | 32 +- src/interfaces.ts | 14 +- src/internal/Component.js | 207 ++ src/{shared => internal}/animations.js | 0 src/{shared => internal}/await-block.js | 8 +- src/{shared => internal}/dom.js | 15 +- src/internal/index.js | 11 + src/{shared => internal}/keyed-each.js | 0 src/internal/lifecycle.js | 49 + src/internal/scheduler.js | 72 + src/{shared => internal}/spread.js | 0 src/{shared => internal}/ssr.js | 49 +- src/{shared => internal}/transitions.js | 4 +- src/{shared => internal}/utils.js | 22 +- src/parse/index.ts | 27 +- src/parse/read/directives.ts | 213 -- src/parse/read/script.ts | 2 - src/parse/state/mustache.ts | 1 - src/parse/state/tag.ts | 77 +- src/shared/.eslintrc.json | 38 - src/shared/_build.js | 40 - src/shared/index.js | 186 - src/utils/CodeBuilder.ts | 9 +- src/utils/annotateWithScopes.ts | 87 +- src/utils/deindent.ts | 23 +- src/utils/deprecate.ts | 8 - .../utils/FuzzySet.ts => utils/fuzzymatch.ts} | 9 +- src/utils/getName.ts | 6 - src/utils/getObject.ts | 1 + src/utils/getStaticAttributeValue.ts | 18 - ...{getTailSnippet.ts => get_tail_snippet.ts} | 13 +- src/utils/indentation.ts | 57 + src/utils/isThisGetCallExpression.ts | 8 - src/utils/namespaces.ts | 4 +- src/utils/nodeToString.ts | 11 - src/utils/nodes_match.ts | 32 + src/utils/removeNode.ts | 52 +- src/utils/sanitize.ts | 3 + src/utils/stringify.ts | 2 +- src/utils/validCalleeObjects.ts | 3 - src/utils/walkThroughTopFunctionScope.ts | 21 - store.d.ts | 29 - store.js | 226 +- test/cli/index.js | 3 +- test/cli/samples/amd/command.sh | 1 - test/cli/samples/amd/expected/Main.js | 192 -- test/cli/samples/amd/src/Main.html | 1 - test/cli/samples/custom-element/src/Main.html | 8 +- test/cli/samples/dir-sourcemap/src/Main.html | 10 +- test/cli/samples/dir-subdir/src/Main.html | 10 +- test/cli/samples/dir/src/Main.html | 10 +- test/cli/samples/globals/src/Main.html | 12 +- .../samples/sourcemap-inline/src/Main.html | 16 +- test/cli/samples/sourcemap/src/Main.html | 16 +- test/create/index.js | 39 - test/css/index.js | 48 +- test/css/samples/nested/_config.js | 2 +- .../_config.js | 2 +- .../input.html | 16 +- .../_config.js | 2 +- .../_config.js | 2 +- .../_config.js | 2 +- .../_config.js | 2 +- .../_config.js | 2 +- .../omit-scoping-attribute-global/_config.js | 2 +- test/css/samples/refs-qualified/_config.js | 22 +- test/css/samples/refs-qualified/input.html | 5 + .../unused-selector-ternary/_config.js | 2 +- test/custom-elements/index.js | 28 +- .../samples/custom-method/main.html | 18 +- .../samples/custom-method/test.js | 6 +- .../samples/escaped-css/main.html | 10 +- .../samples/html-slots/main.html | 10 +- test/custom-elements/samples/html/main.html | 10 +- test/custom-elements/samples/html/test.js | 2 +- .../samples/nested.skip/Counter.html | 7 + .../samples/nested.skip/main.html | 10 + .../samples/{nested => nested.skip}/test.js | 4 +- .../samples/nested/Counter.html | 13 - test/custom-elements/samples/nested/main.html | 12 - .../samples/new-styled/main.html | 10 +- test/custom-elements/samples/new/main.html | 10 +- test/custom-elements/samples/new/test.js | 2 +- .../no-missing-prop-warnings/main.html | 13 +- .../samples/oncreate/main.html | 19 +- test/custom-elements/samples/props/main.html | 14 +- .../samples/props/my-widget.html | 16 +- test/formats/index.js | 285 -- test/helpers.js | 18 +- test/hydration/index.js | 32 +- .../samples/binding-input/_config.js | 8 +- .../hydration/samples/binding-input/main.html | 2 +- .../samples/component-in-element/main.html | 14 +- test/hydration/samples/component/main.html | 10 +- .../samples/dynamic-text-changed/_config.js | 2 +- .../hydration/samples/dynamic-text/_config.js | 2 +- .../samples/each-block-arg-clash/_config.js | 2 +- .../samples/each-block-arg-clash/main.html | 2 +- test/hydration/samples/each-block/_config.js | 2 +- .../element-attribute-added/_config.js | 4 +- .../samples/element-attribute-added/main.html | 2 +- .../element-attribute-changed/_config.js | 2 +- .../element-attribute-removed/_config.js | 2 +- test/hydration/samples/element-ref/_config.js | 2 +- test/hydration/samples/element-ref/main.html | 4 + .../samples/event-handler/_config.js | 8 +- .../hydration/samples/event-handler/main.html | 2 +- .../samples/if-block-anchor/_config.js | 2 +- .../samples/if-block-false/_config.js | 2 +- .../samples/if-block-update/_config.js | 5 +- test/hydration/samples/if-block/_config.js | 2 +- test/hydration/samples/raw/_config.js | 2 +- test/js/index.js | 4 +- .../action-custom-event-handler/expected.js | 76 + .../action-custom-event-handler/input.html | 13 + test/js/samples/action/expected.js | 60 +- test/js/samples/action/input.html | 27 +- test/js/samples/bind-width-height/expected.js | 69 +- test/js/samples/bind-width-height/input.html | 2 +- .../expected.js | 49 +- .../collapses-text-around-comments/input.html | 11 +- .../component-static-array/expected.js | 52 +- .../samples/component-static-array/input.html | 12 +- .../component-static-immutable/expected.js | 54 +- .../component-static-immutable/input.html | 13 +- .../component-static-immutable2/expected.js | 54 +- .../component-static-immutable2/input.html | 12 +- test/js/samples/component-static/expected.js | 52 +- test/js/samples/component-static/input.html | 12 +- .../samples/computed-collapsed-if/expected.js | 67 +- .../samples/computed-collapsed-if/input.html | 15 +- test/js/samples/css-media-query/expected.js | 32 +- .../css-shadow-dom-keyframes/expected.js | 45 +- .../css-shadow-dom-keyframes/input.html | 10 +- test/js/samples/debug-empty/expected.js | 61 +- .../debug-foo-bar-baz-things/expected.js | 177 +- test/js/samples/debug-foo/expected.js | 151 +- test/js/samples/debug-ssr-foo/expected.js | 56 +- .../samples/deconflict-builtins/expected.js | 92 +- .../js/samples/deconflict-globals/expected.js | 58 +- test/js/samples/deconflict-globals/input.html | 14 +- .../expected.js | 78 +- .../input.html | 17 +- test/js/samples/do-use-dataset/expected.js | 44 +- test/js/samples/do-use-dataset/input.html | 2 +- .../dont-use-dataset-in-legacy/expected.js | 44 +- .../dont-use-dataset-in-legacy/input.html | 2 +- .../dont-use-dataset-in-svg/expected.js | 44 +- .../dont-use-dataset-in-svg/input.html | 2 +- test/js/samples/dynamic-import/expected.js | 51 +- test/js/samples/dynamic-import/input.html | 12 +- .../each-block-changed-check/expected.js | 178 +- .../each-block-keyed-animated/expected.js | 152 +- .../each-block-keyed-animated/input.html | 38 +- test/js/samples/each-block-keyed/expected.js | 102 +- .../samples/event-handlers-custom/expected.js | 60 - .../samples/event-handlers-custom/input.html | 16 - test/js/samples/event-modifiers/expected.js | 77 +- test/js/samples/event-modifiers/input.html | 30 +- .../js/samples/head-no-whitespace/expected.js | 29 +- .../js/samples/if-block-no-update/expected.js | 110 +- test/js/samples/if-block-simple/expected.js | 78 +- .../expected.js | 64 +- .../inline-style-optimized-url/expected.js | 44 +- .../inline-style-optimized/expected.js | 44 +- .../inline-style-unoptimized/expected.js | 64 +- test/js/samples/input-files/expected.js | 60 +- test/js/samples/input-range/expected.js | 64 +- .../input-without-blowback-guard/expected.js | 58 +- .../input-without-blowback-guard/input.html | 2 +- .../expected.js | 69 + .../input.html | 11 + .../expected.js | 70 + .../input.html | 12 + .../expected.js | 69 + .../input.html | 9 + .../expected.js | 67 + .../input.html | 7 + test/js/samples/legacy-input-type/expected.js | 29 +- test/js/samples/media-bindings/expected.js | 220 +- test/js/samples/media-bindings/input.html | 2 +- .../non-imported-component/expected.js | 66 +- .../samples/non-imported-component/input.html | 13 +- .../samples/select-dynamic-value/expected.js | 45 +- test/js/samples/setup-method/expected.js | 53 +- test/js/samples/setup-method/input.html | 25 +- .../samples/ssr-no-oncreate-etc/expected.js | 60 +- .../js/samples/ssr-no-oncreate-etc/input.html | 40 +- .../samples/ssr-preserve-comments/expected.js | 52 +- .../samples/ssr-preserve-comments/input.html | 2 +- test/js/samples/svg-title/expected.js | 29 +- test/js/samples/title/expected.js | 39 +- .../use-elements-as-anchors/expected.js | 278 +- .../samples/window-binding-scroll/expected.js | 67 +- .../samples/window-binding-scroll/input.html | 2 +- test/parser/index.js | 45 +- .../samples/action-with-call/input.html | 2 +- .../samples/action-with-call/output.json | 23 +- .../samples/action-with-identifier/input.html | 2 +- .../action-with-identifier/output.json | 5 +- .../samples/action-with-literal/input.html | 2 +- .../samples/action-with-literal/output.json | 15 +- test/parser/samples/action/output.json | 5 +- test/parser/samples/animation/output.json | 5 +- .../attribute-containing-solidus/output.json | 4 +- .../attribute-dynamic-boolean/output.json | 4 +- .../attribute-dynamic-reserved/output.json | 4 +- .../samples/attribute-dynamic/output.json | 4 +- .../samples/attribute-escaped/output.json | 4 +- .../samples/attribute-multiple/output.json | 4 +- .../samples/attribute-shorthand/output.json | 4 +- .../attribute-static-boolean/output.json | 4 +- .../samples/attribute-static/output.json | 4 +- .../samples/attribute-unquoted/output.json | 4 +- .../samples/await-then-catch/output.json | 4 +- .../samples/binding-shorthand/output.json | 9 +- test/parser/samples/binding/input.html | 2 +- test/parser/samples/binding/output.json | 7 +- test/parser/samples/comment/output.json | 4 +- .../samples/component-dynamic/output.json | 4 +- .../convert-entities-in-element/output.json | 4 +- .../samples/convert-entities/output.json | 4 +- .../samples/css-ref-selector/output.json | 120 +- test/parser/samples/css/output.json | 116 +- test/parser/samples/dynamic-import/input.html | 14 +- .../parser/samples/dynamic-import/output.json | 180 +- .../each-block-destructured/output.json | 4 +- .../samples/each-block-else/output.json | 4 +- .../samples/each-block-indexed/output.json | 4 +- .../samples/each-block-keyed/output.json | 4 +- test/parser/samples/each-block/output.json | 4 +- .../samples/element-with-mustache/output.json | 4 +- .../samples/element-with-text/output.json | 4 +- test/parser/samples/elements/output.json | 4 +- .../samples/error-binding-disabled/input.html | 2 +- .../error-binding-mustaches/error.json | 10 - .../error-binding-mustaches/input.html | 1 - .../samples/error-binding-rvalue/error.json | 10 - .../samples/error-binding-rvalue/input.html | 1 - .../samples/error-event-handler/error.json | 10 - .../samples/error-event-handler/input.html | 1 - .../parser/samples/error-ref-value/error.json | 10 - .../parser/samples/error-ref-value/input.html | 1 - test/parser/samples/event-handler/input.html | 2 +- test/parser/samples/event-handler/output.json | 79 +- test/parser/samples/if-block-else/output.json | 4 +- .../samples/if-block-elseif/output.json | 4 +- test/parser/samples/if-block/output.json | 4 +- .../samples/implicitly-closed-li/output.json | 4 +- test/parser/samples/nbsp/output.json | 4 +- test/parser/samples/raw-mustaches/output.json | 4 +- test/parser/samples/refs/output.json | 8 +- .../samples/script-comment-only/input.html | 6 +- .../samples/script-comment-only/output.json | 37 +- .../input.html | 10 +- .../output.json | 146 +- .../script-comment-trailing/input.html | 10 +- .../script-comment-trailing/output.json | 146 +- test/parser/samples/script/input.html | 10 +- test/parser/samples/script/output.json | 146 +- .../samples/self-closing-element/output.json | 4 +- .../parser/samples/self-reference/output.json | 4 +- .../space-between-mustaches/output.json | 4 +- test/parser/samples/spread/output.json | 4 +- .../samples/textarea-children/output.json | 58 +- .../transition-intro-no-params/output.json | 5 +- .../samples/transition-intro/input.html | 2 +- .../samples/transition-intro/output.json | 31 +- .../samples/unusual-identifier/output.json | 4 +- .../whitespace-leading-trailing/output.json | 4 +- .../samples/whitespace-normal/output.json | 4 +- test/parser/samples/yield/output.json | 4 +- test/preprocess/index.js | 2 +- test/runtime/index.js | 136 +- .../_config.js | 30 + .../main.html | 30 + .../_config.js | 30 + .../main.html | 24 + .../_config.js | 15 + .../main.html | 19 + .../_config.js | 2 +- .../main.html | 19 + .../_config.js | 16 + .../main.html | 20 + .../action-custom-event-handler/_config.js | 16 + .../action-custom-event-handler/main.html | 23 + .../samples/action-function/_config.js | 20 +- .../runtime/samples/action-function/main.html | 54 +- .../action-ternary-template/_config.js | 16 +- .../samples/action-ternary-template/main.html | 28 +- test/runtime/samples/action-this/_config.js | 15 +- test/runtime/samples/action-this/main.html | 32 +- test/runtime/samples/action-update/_config.js | 36 +- test/runtime/samples/action-update/main.html | 76 +- test/runtime/samples/action/_config.js | 20 +- test/runtime/samples/action/main.html | 50 +- .../_config.js | 8 +- .../after-render-prevents-loop/main.html | 13 + .../after-render-triggers-update/_config.js | 20 + .../after-render-triggers-update/main.html | 15 + test/runtime/samples/animation-css/_config.js | 20 +- test/runtime/samples/animation-css/main.html | 32 +- .../samples/animation-js-delay/_config.js | 20 +- .../samples/animation-js-delay/main.html | 38 +- test/runtime/samples/animation-js/_config.js | 20 +- test/runtime/samples/animation-js/main.html | 36 +- .../samples/assignment-in-init/_config.js | 6 + .../samples/assignment-in-init/main.html | 7 + .../_config.js | 5 + .../assignment-to-computed-property/main.html | 5 + .../attribute-boolean-false/_config.js | 2 +- .../samples/attribute-boolean-false/main.html | 2 +- .../_config.js | 8 +- .../samples/attribute-boolean-true/_config.js | 2 +- .../samples/attribute-boolean-true/main.html | 2 +- .../samples/attribute-casing/_config.js | 2 +- .../samples/attribute-casing/main.html | 2 +- .../attribute-dynamic-multiple/_config.js | 2 +- .../attribute-dynamic-multiple/main.html | 2 +- .../main.html | 2 +- .../attribute-dynamic-quotemarks/main.html | 2 +- .../attribute-dynamic-reserved/_config.js | 20 - .../attribute-dynamic-reserved/main.html | 2 - .../attribute-dynamic-shorthand/_config.js | 4 +- .../attribute-dynamic-shorthand/main.html | 10 +- .../samples/attribute-dynamic-type/_config.js | 8 +- .../samples/attribute-dynamic/_config.js | 4 +- .../samples/attribute-dynamic/main.html | 10 +- .../samples/attribute-empty-svg/main.html | 2 +- .../runtime/samples/attribute-empty/main.html | 2 +- .../samples/attribute-namespaced/_config.js | 4 +- .../attribute-partial-number/main.html | 10 +- .../attribute-prefer-expression/_config.js | 22 +- .../attribute-prefer-expression/main.html | 4 +- .../attribute-static-boolean/_config.js | 2 +- .../attribute-static-boolean/main.html | 2 +- .../samples/attribute-static/main.html | 2 +- test/runtime/samples/autofocus/_config.js | 6 +- test/runtime/samples/autofocus/main.html | 5 + .../samples/await-component-oncreate/Foo.html | 23 +- .../await-component-oncreate/_config.js | 4 +- .../await-component-oncreate/main.html | 16 +- test/runtime/samples/await-in-each/_config.js | 4 +- .../samples/await-set-simultaneous/_config.js | 6 +- .../await-then-catch-anchor/_config.js | 8 +- .../samples/await-then-catch-anchor/main.html | 2 +- .../samples/await-then-catch-event/_config.js | 16 +- .../samples/await-then-catch-event/main.html | 8 +- .../samples/await-then-catch-if/_config.js | 12 +- .../samples/await-then-catch-if/main.html | 2 +- .../await-then-catch-in-slot/_config.js | 8 +- .../await-then-catch-in-slot/main.html | 16 +- .../await-then-catch-multiple/_config.js | 8 +- .../await-then-catch-no-values/_config.js | 8 +- .../await-then-catch-no-values/main.html | 2 +- .../await-then-catch-non-promise/_config.js | 8 +- .../samples/await-then-catch-order/_config.js | 4 +- .../await-then-catch-static/_config.js | 8 +- .../samples/await-then-catch/_config.js | 8 +- .../samples/await-then-shorthand/_config.js | 8 +- .../samples/before-render-chain/Item.html | 12 + .../samples/before-render-chain/List.html | 13 + .../samples/before-render-chain/_config.js | 21 + .../main.html | 12 +- .../before-render-prevents-loop/_config.js | 20 + .../before-render-prevents-loop/main.html | 13 + .../_config.js | 33 +- .../main.html | 4 +- .../binding-indirect-computed/_config.js | 6 +- .../binding-indirect-computed/main.html | 41 +- .../samples/binding-indirect/_config.js | 18 +- .../samples/binding-indirect/main.html | 4 +- .../_config.js | 32 +- .../main.html | 23 +- .../_config.js | 34 +- .../main.html | 6 +- .../binding-input-checkbox-group/_config.js | 34 +- .../binding-input-checkbox-group/main.html | 2 +- .../_config.js | 14 +- .../main.html | 2 +- .../_config.js | 8 +- .../main.html | 23 +- .../samples/binding-input-checkbox/_config.js | 20 +- .../samples/binding-input-checkbox/main.html | 4 +- .../samples/binding-input-number/_config.js | 14 +- .../samples/binding-input-number/main.html | 4 +- .../binding-input-radio-group/_config.js | 38 +- .../binding-input-radio-group/main.html | 2 +- .../binding-input-range-change/_config.js | 10 +- .../binding-input-range-change/main.html | 4 +- .../samples/binding-input-range/_config.js | 10 +- .../samples/binding-input-range/main.html | 4 +- .../binding-input-text-contextual/_config.js | 10 +- .../binding-input-text-contextual/main.html | 4 +- .../_config.js | 8 +- .../binding-input-text-deconflicted/main.html | 2 +- .../_config.js | 14 +- .../main.html | 2 +- .../_config.js | 10 +- .../main.html | 4 +- .../_config.js | 14 +- .../main.html | 2 +- .../_config.js | 10 +- .../main.html | 4 +- .../binding-input-text-deep/_config.js | 10 +- .../samples/binding-input-text-deep/main.html | 4 +- .../samples/binding-input-text/_config.js | 8 +- .../samples/binding-input-text/main.html | 4 +- .../binding-input-with-event/_config.js | 18 +- .../binding-input-with-event/main.html | 2 +- .../_config.js | 10 +- .../main.html | 2 +- .../binding-select-in-each-block/_config.js | 6 +- .../binding-select-in-each-block/main.html | 2 +- .../binding-select-in-yield/Modal.html | 27 +- .../binding-select-in-yield/_config.js | 14 +- .../samples/binding-select-in-yield/main.html | 27 +- .../_config.js | 14 +- .../main.html | 2 +- .../binding-select-initial-value/_config.js | 6 +- .../binding-select-initial-value/main.html | 2 +- .../samples/binding-select-late/_config.js | 24 +- .../samples/binding-select-late/main.html | 4 +- .../binding-select-multiple/_config.js | 10 +- .../samples/binding-select-multiple/main.html | 4 +- .../binding-select-optgroup/_config.js | 6 +- .../samples/binding-select-optgroup/main.html | 2 +- .../runtime/samples/binding-select/_config.js | 12 +- test/runtime/samples/binding-select/main.html | 4 +- .../samples/binding-textarea/_config.js | 8 +- .../samples/binding-textarea/main.html | 2 +- .../samples/bindings-before-oncreate/One.html | 15 - .../samples/bindings-before-oncreate/Two.html | 15 - .../bindings-before-oncreate/_config.js | 5 - .../bindings-before-oncreate/main.html | 9 - .../samples/bindings-before-onmount/One.html | 13 + .../samples/bindings-before-onmount/Two.html | 7 + .../bindings-before-onmount/_config.js | 5 + .../samples/bindings-before-onmount/main.html | 7 + .../samples/bindings-coalesced/Foo.html | 28 +- .../samples/bindings-coalesced/_config.js | 8 +- .../samples/bindings-coalesced/main.html | 18 +- test/runtime/samples/class-boolean/main.html | 2 +- test/runtime/samples/class-helper/_config.js | 11 +- test/runtime/samples/class-helper/main.html | 14 +- test/runtime/samples/class-in-each/_config.js | 6 +- test/runtime/samples/class-in-each/main.html | 4 +- .../class-shortcut-with-class/_config.js | 19 +- .../class-shortcut-with-class/main.html | 2 +- .../runtime/samples/class-shortcut/_config.js | 19 +- test/runtime/samples/class-shortcut/main.html | 2 +- .../samples/class-with-attribute/main.html | 2 +- .../class-with-dynamic-attribute/_config.js | 11 +- .../class-with-dynamic-attribute/main.html | 2 +- .../component-binding-blowback-b/Nested.html | 21 +- .../component-binding-blowback-b/_config.js | 8 +- .../component-binding-blowback-b/main.html | 42 +- .../component-binding-blowback-c/Nested.html | 21 +- .../component-binding-blowback-c/_config.js | 8 +- .../component-binding-blowback-c/main.html | 47 +- .../component-binding-blowback/_config.js | 6 +- .../component-binding-blowback/main.html | 24 +- .../component-binding-computed/_config.js | 24 +- .../component-binding-computed/main.html | 27 +- .../component-binding-conditional-b/Bar.html | 10 +- .../component-binding-conditional-b/Baz.html | 8 +- .../component-binding-conditional-b/Foo.html | 10 +- .../_config.js | 6 +- .../component-binding-conditional-b/main.html | 25 +- .../component-binding-conditional/Bar.html | 10 +- .../component-binding-conditional/Baz.html | 8 +- .../component-binding-conditional/Foo.html | 10 +- .../component-binding-conditional/_config.js | 10 +- .../component-binding-conditional/main.html | 25 +- .../ComponentSelector.html | 2 +- .../component-binding-deep-b/Editor.html | 2 +- .../component-binding-deep-b/_config.js | 50 +- .../component-binding-deep-b/main.html | 61 +- .../samples/component-binding-deep/_config.js | 6 +- .../samples/component-binding-deep/main.html | 22 +- .../component-binding-each-nested/_config.js | 16 +- .../component-binding-each-nested/main.html | 26 +- .../component-binding-each-object/_config.js | 20 +- .../component-binding-each-object/main.html | 14 +- .../samples/component-binding-each/_config.js | 16 +- .../samples/component-binding-each/main.html | 24 +- .../component-binding-infinite-loop/A.html | 14 +- .../component-binding-infinite-loop/B.html | 22 +- .../component-binding-infinite-loop/C.html | 34 +- .../_config.js | 22 +- .../component-binding-infinite-loop/main.html | 21 +- .../Counter.html | 14 - .../_config.js | 29 - .../main.html | 12 - .../samples/component-binding-nested/Bar.html | 14 +- .../samples/component-binding-nested/Baz.html | 4 +- .../samples/component-binding-nested/Foo.html | 14 +- .../component-binding-nested/_config.js | 34 +- .../component-binding-nested/main.html | 12 +- .../Counter.html | 10 +- .../_config.js | 22 +- .../main.html | 16 +- .../Nested.html | 2 +- .../_config.js | 12 +- .../main.html | 18 +- .../samples/component-binding/Counter.html | 10 +- .../samples/component-binding/_config.js | 24 +- .../samples/component-binding/main.html | 12 +- .../component-data-dynamic-late/Widget.html | 2 +- .../component-data-dynamic-late/_config.js | 6 +- .../component-data-dynamic-late/main.html | 19 +- .../_config.js | 8 +- .../main.html | 12 +- .../component-data-dynamic/Widget.html | 2 +- .../samples/component-data-dynamic/_config.js | 14 +- .../samples/component-data-dynamic/main.html | 15 +- .../samples/component-data-empty/Widget.html | 2 +- .../samples/component-data-empty/main.html | 12 +- .../main.html | 11 +- .../component-data-static-boolean/Foo.html | 2 +- .../component-data-static-boolean/main.html | 8 +- .../samples/component-data-static/Widget.html | 2 +- .../samples/component-data-static/main.html | 12 +- .../component-event-not-stale/_config.js | 10 +- .../component-event-not-stale/main.html | 23 +- .../component-events-console/_config.js | 2 +- .../component-events-console/main.html | 8 +- .../samples/component-events-data/Widget.html | 12 +- .../samples/component-events-data/_config.js | 20 +- .../samples/component-events-data/main.html | 13 +- .../samples/component-events-each/Widget.html | 8 +- .../samples/component-events-each/_config.js | 27 +- .../samples/component-events-each/main.html | 27 +- .../component-events-fire-finally/_config.js | 23 - .../component-events-fire-finally/main.html | 1 - .../samples/component-events/Widget.html | 12 +- .../samples/component-events/_config.js | 18 +- .../samples/component-events/main.html | 19 +- .../component-if-placement/Component.html | 2 +- .../samples/component-if-placement/_config.js | 6 +- .../samples/component-if-placement/main.html | 14 +- .../component-invalid-identifier/Widget.html | 10 - .../component-invalid-identifier/_config.js | 3 - .../component-invalid-identifier/main.html | 11 - .../component-name-deconflicted/_config.js | 6 +- .../component-name-deconflicted/main.html | 21 +- .../samples/component-nested-deep/Level1.html | 17 +- .../samples/component-nested-deep/Level2.html | 14 +- .../samples/component-nested-deep/_config.js | 4 +- .../samples/component-nested-deep/main.html | 14 +- .../component-nested-deeper/Level1.html | 21 +- .../component-nested-deeper/Level2.html | 4 +- .../component-nested-deeper/Level3.html | 2 +- .../component-nested-deeper/_config.js | 6 +- .../samples/component-nested-deeper/main.html | 12 +- .../samples/component-not-void/Link.html | 2 +- .../samples/component-not-void/main.html | 10 +- .../runtime/samples/component-ref/Widget.html | 16 +- test/runtime/samples/component-ref/_config.js | 7 +- test/runtime/samples/component-ref/main.html | 13 +- .../component-shorthand-import/Widget.html | 2 +- .../component-shorthand-import/main.html | 6 +- .../samples/component-slot-default/main.html | 14 +- .../component-slot-dynamic/Nested.html | 16 +- .../samples/component-slot-dynamic/_config.js | 4 +- .../samples/component-slot-dynamic/main.html | 14 +- .../component-slot-each-block/_config.js | 6 +- .../component-slot-each-block/main.html | 16 +- .../samples/component-slot-empty/main.html | 12 +- .../samples/component-slot-fallback/main.html | 14 +- .../_config.js | 4 +- .../main.html | 18 +- .../component-slot-if-block/_config.js | 4 +- .../samples/component-slot-if-block/main.html | 18 +- .../_config.js | 4 +- .../main.html | 18 +- .../component-slot-name-with-hyphen/main.html | 14 +- .../samples/component-slot-named/main.html | 18 +- .../component-slot-nested-component/main.html | 12 +- .../samples/component-slot-nested/main.html | 14 +- .../component-static-at-symbol/Email.html | 2 +- .../component-static-at-symbol/main.html | 8 +- .../component-yield-follows-element/main.html | 10 +- .../samples/component-yield-if/Widget.html | 16 +- .../samples/component-yield-if/_config.js | 26 +- .../samples/component-yield-if/main.html | 19 +- .../Widget.html | 2 +- .../_config.js | 6 +- .../main.html | 20 +- .../Widget.html | 2 +- .../component-yield-multiple-in-if/_config.js | 8 +- .../component-yield-multiple-in-if/main.html | 24 +- .../component-yield-nested-if/Inner.html | 2 +- .../component-yield-nested-if/Outer.html | 2 +- .../component-yield-nested-if/_config.js | 6 +- .../component-yield-nested-if/main.html | 15 +- .../component-yield-parent/Widget.html | 2 +- .../samples/component-yield-parent/_config.js | 8 +- .../samples/component-yield-parent/main.html | 16 +- .../component-yield-placement/Modal.html | 10 +- .../component-yield-placement/_config.js | 12 +- .../component-yield-placement/main.html | 20 +- .../component-yield-static/Widget.html | 2 +- .../samples/component-yield-static/_config.js | 4 +- .../samples/component-yield-static/main.html | 11 +- .../runtime/samples/component-yield/main.html | 16 +- test/runtime/samples/component/Widget.html | 2 +- test/runtime/samples/component/main.html | 12 +- .../runtime/samples/computed-empty/_config.js | 8 - test/runtime/samples/computed-empty/main.html | 14 - .../samples/computed-function/_config.js | 14 - .../samples/computed-function/main.html | 20 - .../samples/computed-state-object/_config.js | 21 - .../samples/computed-state-object/main.html | 14 - .../computed-values-deconflicted/main.html | 14 - .../computed-values-default/_config.js | 11 - .../samples/computed-values-default/main.html | 9 - .../_config.js | 10 - .../main.html | 28 - .../samples/computed-values/_config.js | 10 - .../runtime/samples/computed-values/main.html | 16 - .../samples/computed-whole-state/_config.js | 25 - .../samples/computed-whole-state/main.html | 22 - test/runtime/samples/css-comments/_config.js | 2 +- test/runtime/samples/css-comments/main.html | 2 +- test/runtime/samples/css-false/Widget.html | 2 +- test/runtime/samples/css-false/_config.js | 2 +- test/runtime/samples/css-false/main.html | 10 +- .../css-space-in-attribute/Widget.html | 2 +- .../samples/css-space-in-attribute/_config.js | 2 +- .../samples/css-space-in-attribute/main.html | 10 +- test/runtime/samples/css/Widget.html | 2 +- test/runtime/samples/css/_config.js | 8 +- test/runtime/samples/css/main.html | 10 +- test/runtime/samples/custom-method/_config.js | 21 +- test/runtime/samples/custom-method/main.html | 28 +- .../samples/deconflict-builtins/_config.js | 5 +- .../samples/deconflict-builtins/main.html | 14 +- .../deconflict-component-refs/_config.js | 2 +- .../deconflict-component-refs/main.html | 7 +- .../samples/deconflict-contexts/_config.js | 2 +- .../deconflict-elements-indexes/_config.js | 6 +- .../deconflict-elements-indexes/main.html | 29 +- .../samples/deconflict-non-helpers/_config.js | 5 +- .../samples/deconflict-non-helpers/main.html | 19 +- .../runtime/samples/deconflict-self/main.html | 8 +- .../samples/deconflict-template-1/main.html | 12 +- .../samples/deconflict-template-2/main.html | 12 +- .../runtime/samples/deconflict-vars/main.html | 12 +- .../samples/default-data-function/_config.js | 4 +- .../samples/default-data-function/main.html | 10 +- .../samples/default-data-override/_config.js | 2 +- .../samples/default-data-override/main.html | 10 +- test/runtime/samples/default-data/main.html | 10 +- test/runtime/samples/destroy-twice/_config.js | 6 +- test/runtime/samples/destructuring/_config.js | 20 +- test/runtime/samples/destructuring/main.html | 10 +- .../dev-accept-declarative-store/_config.js | 5 - .../dev-accept-declarative-store/main.html | 11 - .../dev-error-missing-store-option/_config.js | 7 - .../dev-error-missing-store-option/main.html | 1 - .../dev-warning-bad-set-argument/_config.js | 9 - .../dev-warning-bad-set-argument/main.html | 11 - .../dev-warning-destroy-twice/_config.js | 6 +- .../Bar.html | 1 - .../Foo.html | 1 - .../_config.js | 16 - .../main.html | 13 - .../samples/dev-warning-helper/_config.js | 2 +- .../samples/dev-warning-helper/main.html | 18 +- .../dev-warning-missing-data-each/_config.js | 2 +- .../main.html | 2 +- .../dev-warning-readonly-computed/_config.js | 6 +- .../dev-warning-readonly-computed/main.html | 10 +- .../_config.js | 10 +- .../main.html | 2 +- .../runtime/samples/document-event/_config.js | 10 +- test/runtime/samples/document-event/main.html | 19 +- .../Green.html | 14 +- .../Red.html | 14 +- .../_config.js | 20 +- .../main.html | 18 +- .../_config.js | 14 +- .../main.html | 16 +- .../dynamic-component-bindings/Bar.html | 2 +- .../dynamic-component-bindings/Foo.html | 2 +- .../dynamic-component-bindings/_config.js | 16 +- .../dynamic-component-bindings/main.html | 14 +- .../dynamic-component-destroy-null/_config.js | 10 +- .../samples/dynamic-component-events/Bar.html | 8 +- .../samples/dynamic-component-events/Foo.html | 8 +- .../dynamic-component-events/_config.js | 12 +- .../dynamic-component-events/main.html | 13 +- .../dynamic-component-in-if/_config.js | 8 +- .../samples/dynamic-component-in-if/main.html | 21 +- .../_config.js | 8 +- .../main.html | 16 +- .../dynamic-component-nulled-out/_config.js | 10 +- .../dynamic-component-nulled-out/main.html | 12 +- .../samples/dynamic-component-ref/_config.js | 4 +- .../samples/dynamic-component-ref/main.html | 10 +- .../samples/dynamic-component-slot/_config.js | 8 +- .../samples/dynamic-component-slot/main.html | 36 +- .../_config.js | 8 +- .../main.html | 12 +- .../samples/dynamic-component/_config.js | 8 +- .../samples/dynamic-component/main.html | 12 +- .../each-block-array-literal/_config.js | 4 +- .../each-block-array-literal/main.html | 14 +- .../_config.js | 18 +- .../main.html | 17 +- .../each-block-containing-if/_config.js | 14 +- .../each-block-containing-if/main.html | 36 +- .../_config.js | 10 +- .../main.html | 2 +- .../_config.js | 6 +- .../each-block-destructured-array/_config.js | 6 +- .../_config.js | 10 +- .../main.html | 4 +- .../each-block-destructured-object/_config.js | 8 +- .../each-block-dynamic-else-static/_config.js | 12 +- .../each-block-else-mount-or-intro/_config.js | 3 +- .../each-block-else-mount-or-intro/main.html | 10 +- .../each-block-else-starts-empty/_config.js | 10 +- .../samples/each-block-else/_config.js | 24 +- .../samples/each-block-empty-outro/_config.js | 8 +- .../samples/each-block-empty-outro/main.html | 17 +- .../samples/each-block-in-if-block/_config.js | 6 +- .../samples/each-block-index-only/_config.js | 8 +- .../samples/each-block-indexed/_config.js | 2 +- .../each-block-keyed-dynamic/_config.js | 28 +- .../samples/each-block-keyed-empty/_config.js | 2 +- .../each-block-keyed-non-prop/_config.js | 8 +- .../_config.js | 6 +- .../each-block-keyed-siblings/_config.js | 8 +- .../each-block-keyed-static/_config.js | 2 +- .../each-block-keyed-unshift/_config.js | 10 +- .../each-block-keyed-unshift/main.html | 16 +- .../samples/each-block-keyed/_config.js | 24 +- .../each-block-random-permute/_config.js | 6 +- .../samples/each-block-static/_config.js | 6 +- .../samples/each-block-text-node/_config.js | 8 +- test/runtime/samples/each-block/_config.js | 8 +- .../samples/each-blocks-nested-b/_config.js | 4 +- .../samples/each-blocks-nested/_config.js | 4 +- .../element-source-location/_config.js | 8 +- .../samples/element-source-location/main.html | 14 +- .../escape-template-literals/main.html | 9 +- .../event-handler-console-log/_config.js | 4 +- .../event-handler-console-log/main.html | 6 +- .../event-handler-custom-context/_config.js | 16 - .../event-handler-custom-context/main.html | 28 - .../_config.js | 32 - .../main.html | 36 - .../event-handler-custom-each/_config.js | 32 - .../event-handler-custom-each/main.html | 34 - .../_config.js | 15 - .../main.html | 25 - .../event-handler-custom-this/main.html | 23 - .../samples/event-handler-custom/_config.js | 15 - .../samples/event-handler-custom/main.html | 29 - .../samples/event-handler-destroy/_config.js | 20 - .../samples/event-handler-destroy/main.html | 1 - .../event-handler-each-context/_config.js | 10 +- .../event-handler-each-context/main.html | 2 +- .../_config.js | 30 +- .../event-handler-each-deconflicted/main.html | 4 +- .../event-handler-each-this/_config.js | 8 +- .../samples/event-handler-each-this/main.html | 10 +- .../samples/event-handler-each/_config.js | 16 +- .../samples/event-handler-each/main.html | 2 +- .../event-handler-event-methods/_config.js | 14 +- .../event-handler-event-methods/main.html | 22 +- .../samples/event-handler-hoisted/_config.js | 4 +- .../samples/event-handler-hoisted/main.html | 25 +- .../event-handler-modifier-once/_config.js | 16 + .../event-handler-modifier-once/main.html | 5 + .../_config.js | 16 + .../main.html | 9 + .../_config.js | 19 + .../main.html | 16 + .../samples/event-handler-removal/_config.js | 19 +- .../samples/event-handler-removal/main.html | 16 +- .../samples/event-handler-sanitize/_config.js | 18 +- .../samples/event-handler-sanitize/main.html | 2 +- .../Widget.html | 8 +- .../_config.js | 6 +- .../main.html | 10 +- .../Widget.html | 8 +- .../_config.js | 6 +- .../main.html | 8 +- .../event-handler-shorthand/_config.js | 13 - .../samples/event-handler-shorthand/main.html | 11 - .../event-handler-this-methods/_config.js | 14 +- .../event-handler-this-methods/main.html | 2 +- test/runtime/samples/event-handler/_config.js | 18 +- test/runtime/samples/event-handler/main.html | 2 +- test/runtime/samples/events-custom/_config.js | 17 - test/runtime/samples/events-custom/main.html | 1 - .../samples/events-lifecycle/_config.js | 13 - .../samples/events-lifecycle/main.html | 1 - .../samples/flush-before-bindings/Nested.html | 36 +- .../flush-before-bindings/Visibility.html | 18 +- .../samples/flush-before-bindings/_config.js | 6 +- .../samples/flush-before-bindings/main.html | 34 +- .../samples/function-in-expression/_config.js | 14 +- .../samples/function-in-expression/main.html | 2 +- .../samples/get-after-destroy/_config.js | 8 +- test/runtime/samples/get-state/_config.js | 7 - test/runtime/samples/get-state/main.html | 12 - .../globals-accessible-directly/_config.js | 4 +- .../globals-not-dereferenced/_config.js | 6 +- .../_config.js | 8 +- .../main.html | 4 +- .../globals-shadowed-by-data/_config.js | 6 +- .../globals-shadowed-by-data/main.html | 17 +- .../globals-shadowed-by-helpers/_config.js | 6 +- .../globals-shadowed-by-helpers/main.html | 16 +- test/runtime/samples/head-if-block/_config.js | 6 +- .../head-title-dynamic-simple/_config.js | 12 + .../head-title-dynamic-simple/main.html | 3 + .../samples/head-title-dynamic/_config.js | 6 +- .../samples/head-title-static/_config.js | 2 +- test/runtime/samples/hello-world/_config.js | 12 +- .../helpers-not-call-expression/main.html | 16 +- test/runtime/samples/helpers/main.html | 20 +- .../_config.js | 9 +- .../main.html | 16 +- .../samples/if-block-else-in-each/_config.js | 2 +- .../if-block-else-partial-outro/_config.js | 8 +- .../if-block-else-partial-outro/main.html | 24 +- test/runtime/samples/if-block-else/_config.js | 10 +- .../if-block-elseif-no-else/_config.js | 10 +- .../samples/if-block-elseif-text/_config.js | 18 +- .../samples/if-block-elseif/_config.js | 18 +- .../runtime/samples/if-block-first/_config.js | 6 +- .../_config.js | 6 +- .../main.html | 25 +- test/runtime/samples/if-block-or/_config.js | 8 +- .../if-block-outro-nested-else/_config.js | 6 +- .../if-block-outro-nested-else/main.html | 15 +- .../_config.js | 1 - .../main.html | 15 +- .../samples/if-block-widget/_config.js | 8 +- .../runtime/samples/if-block-widget/main.html | 15 +- test/runtime/samples/if-block/_config.js | 8 +- .../samples/if-in-keyed-each/_config.js | 2 +- .../_config.js | 12 +- .../main.html | 21 +- .../ignore-unchanged-attribute/_config.js | 12 +- .../ignore-unchanged-attribute/main.html | 21 +- .../samples/ignore-unchanged-raw/_config.js | 12 +- .../samples/ignore-unchanged-raw/main.html | 21 +- .../samples/ignore-unchanged-tag/_config.js | 12 +- .../samples/ignore-unchanged-tag/main.html | 21 +- .../samples/immutable-mutable/Nested.html | 13 - .../samples/immutable-mutable/_config.js | 18 - .../samples/immutable-mutable/main.html | 13 - .../samples/immutable-nested/Nested.html | 27 +- .../samples/immutable-nested/_config.js | 20 +- .../samples/immutable-nested/main.html | 16 +- .../runtime/samples/immutable-root/_config.js | 8 +- test/runtime/samples/immutable-root/main.html | 18 +- .../imported-renamed-components/main.html | 9 +- .../samples/initial-state-assign/_config.js | 2 +- .../samples/initial-state-assign/main.html | 13 +- .../samples/inline-expressions/_config.js | 7 +- .../_config.js | 29 + .../main.html | 16 + .../_config.js | 17 + .../main.html | 14 + .../_config.js | 28 + .../main.html | 12 + .../instrumentation-script-update/_config.js | 17 + .../instrumentation-script-update/main.html | 11 + .../_config.js | 29 + .../main.html | 8 + .../_config.js | 17 + .../main.html | 12 + .../_config.js | 28 + .../main.html | 8 + .../_config.js | 17 + .../instrumentation-template-update/main.html | 7 + .../samples/lifecycle-events/_config.js | 9 +- .../samples/lifecycle-events/main.html | 26 +- .../_config.js | 10 +- .../samples/lifecycle-render-order/main.html | 24 + .../order.js | 0 .../runtime/samples/module-context/_config.js | 3 + test/runtime/samples/module-context/main.html | 5 + .../names-deconflicted-nested/_config.js | 2 +- .../samples/names-deconflicted/_config.js | 12 +- .../samples/names-deconflicted/main.html | 26 +- test/runtime/samples/nbsp/_config.js | 2 +- .../nested-transition-detach-each/_config.js | 12 +- .../nested-transition-detach-each/main.html | 28 +- .../Folder.html | 54 +- .../_config.js | 6 +- .../main.html | 14 +- .../_config.js | 8 +- .../main.html | 18 +- .../samples/noscript-removal/_config.js | 2 +- test/runtime/samples/object-rest/_config.js | 27 - test/runtime/samples/object-rest/main.html | 18 - .../Nested.html | 1 - .../_config.js | 34 - .../main.html | 21 - .../Foo.html | 1 - .../_config.js | 15 - .../main.html | 14 - .../samples/observe-deferred/_config.js | 22 - .../samples/observe-deferred/main.html | 14 - .../samples/observe-prevents-loop/_config.js | 29 - .../samples/observe-prevents-loop/main.html | 1 - .../oncreate-async-arrow-block/_config.js | 3 - .../oncreate-async-arrow-block/main.html | 7 - .../samples/oncreate-async-arrow/_config.js | 3 - .../samples/oncreate-async-arrow/main.html | 5 - .../runtime/samples/oncreate-async/_config.js | 3 - test/runtime/samples/oncreate-async/main.html | 7 - .../oncreate-sibling-order/Nested.html | 11 - .../samples/oncreate-sibling-order/main.html | 12 - .../samples/ondestroy-before-cleanup/Top.html | 17 +- .../ondestroy-before-cleanup/_config.js | 12 +- .../ondestroy-before-cleanup/container.js | 1 + .../ondestroy-before-cleanup/main.html | 24 +- test/runtime/samples/onmount-async/_config.js | 3 + test/runtime/samples/onmount-async/main.html | 7 + .../ParentWidget.html | 10 +- .../Widget.html | 13 + .../_config.js | 2 +- .../main.html | 17 +- .../onmount-fires-when-ready/Widget.html | 13 + .../onmount-fires-when-ready/_config.js | 10 + .../main.html | 16 +- .../samples/onmount-sibling-order/Nested.html | 13 + .../_config.js | 9 +- .../samples/onmount-sibling-order/main.html | 6 + .../result.js | 0 test/runtime/samples/onrender-chain/Item.html | 14 - test/runtime/samples/onrender-chain/List.html | 25 - .../runtime/samples/onrender-chain/_config.js | 17 - .../Widget.html | 9 - .../onrender-fires-when-ready/Widget.html | 9 - .../onrender-fires-when-ready/_config.js | 12 - .../onstate-before-oncreate/_config.js | 8 - .../samples/onstate-before-oncreate/main.html | 16 - .../samples/onstate-before-render/main.html | 26 - test/runtime/samples/onstate-event/_config.js | 49 - test/runtime/samples/onstate-event/main.html | 2 - .../samples/onstate-no-template/_config.js | 11 - .../samples/onstate-no-template/main.html | 7 - test/runtime/samples/onstate/_config.js | 20 - test/runtime/samples/onstate/main.html | 10 - .../_config.js | 8 - .../main.html | 17 - test/runtime/samples/onupdate/main.html | 12 - .../samples/option-without-select/_config.js | 6 +- test/runtime/samples/options/_config.js | 12 - test/runtime/samples/options/main.html | 11 - .../paren-wrapped-expressions/_config.js | 2 +- test/runtime/samples/preload/_config.js | 5 +- test/runtime/samples/preload/main.html | 14 +- .../samples/raw-anchor-first-child/_config.js | 8 +- .../raw-anchor-first-last-child/_config.js | 8 +- .../samples/raw-anchor-last-child/_config.js | 8 +- .../_config.js | 8 +- .../raw-anchor-next-sibling/_config.js | 8 +- .../raw-anchor-previous-sibling/_config.js | 8 +- .../raw-mustaches-preserved/_config.js | 16 +- test/runtime/samples/raw-mustaches/_config.js | 18 +- .../samples/reactive-function/_config.js | 16 + .../samples/reactive-function/main.html | 14 + .../_config.js | 4 +- .../reactive-values-deconflicted/main.html | 8 + .../_config.js | 9 + .../main.html | 21 + .../reactive-values-second-order/_config.js | 8 + .../reactive-values-second-order/main.html | 12 + .../_config.js | 15 + .../reactive-values-self-dependency/main.html | 15 + .../samples/reactive-values/_config.js | 16 + .../runtime/samples/reactive-values/main.html | 12 + .../samples/refs-no-innerhtml/_config.js | 7 +- .../samples/refs-no-innerhtml/main.html | 4 + test/runtime/samples/refs-unset/_config.js | 26 +- test/runtime/samples/refs-unset/main.html | 5 + test/runtime/samples/refs/_config.js | 7 +- test/runtime/samples/refs/main.html | 4 + .../samples/select-bind-array/_config.js | 8 +- .../samples/select-bind-array/main.html | 2 +- .../samples/select-bind-in-array/_config.js | 8 +- .../samples/select-bind-in-array/main.html | 2 +- .../samples/select-change-handler/_config.js | 20 +- .../samples/select-change-handler/main.html | 22 +- .../samples/select-no-whitespace/_config.js | 2 +- .../select-one-way-bind-object/_config.js | 8 +- .../samples/select-one-way-bind/_config.js | 8 +- test/runtime/samples/select-props/_config.js | 10 +- test/runtime/samples/select-props/main.html | 24 +- test/runtime/samples/select/_config.js | 12 +- .../samples/self-reference-tree/_config.js | 2 +- .../runtime/samples/self-reference/_config.js | 2 +- .../samples/set-after-destroy/_config.js | 8 +- .../samples/set-clones-input/_config.js | 16 - .../samples/set-clones-input/main.html | 7 - .../samples/set-in-oncreate/_config.js | 2 +- .../runtime/samples/set-in-oncreate/main.html | 18 +- .../samples/set-in-ondestroy/_config.js | 26 - .../samples/set-in-ondestroy/main.html | 1 - .../Widget.html | 23 +- .../set-in-onstate-dedupes-renders/_config.js | 5 +- .../set-in-onstate-dedupes-renders/main.html | 28 +- .../runtime/samples/set-in-onstate/_config.js | 10 +- test/runtime/samples/set-in-onstate/main.html | 23 +- .../samples/set-mutated-data/_config.js | 14 - .../samples/set-mutated-data/main.html | 1 - .../samples/set-null-text-node/_config.js | 8 +- .../samples/set-prevents-loop/main.html | 22 +- .../samples/set-undefined-attr/main.html | 20 +- test/runtime/samples/setup/_config.js | 5 - test/runtime/samples/setup/main.html | 7 - .../sigil-component-attribute/_config.js | 2 +- .../sigil-component-attribute/main.html | 6 +- .../_config.js | 12 +- .../spread-component-dynamic/_config.js | 12 +- .../spread-component-dynamic/main.html | 14 +- .../_config.js | 4 +- .../main.html | 19 +- .../spread-component-with-bind/_config.js | 4 +- .../spread-component-with-bind/main.html | 17 +- .../samples/spread-component/_config.js | 32 +- .../samples/spread-component/main.html | 12 +- .../samples/spread-each-component/_config.js | 10 +- .../samples/spread-each-component/main.html | 14 +- .../samples/spread-each-element/_config.js | 10 +- .../samples/spread-element-boolean/_config.js | 8 +- .../samples/spread-element-input/_config.js | 2 +- .../_config.js | 4 +- .../main.html | 16 +- .../spread-element-multiple/_config.js | 20 +- .../runtime/samples/spread-element/_config.js | 8 +- test/runtime/samples/spread-element/main.html | 16 +- .../samples/spread-own-props/Widget.html | 4 + .../samples/spread-own-props/_config.js | 31 + .../samples/spread-own-props/main.html | 11 + .../samples/state-deconflicted/_config.js | 26 +- .../samples/store-binding/NameInput.html | 1 - test/runtime/samples/store-binding/_config.js | 33 - test/runtime/samples/store-binding/main.html | 10 - .../samples/store-child-data/Component.html | 1 - .../samples/store-child-data/_config.js | 22 - .../samples/store-child-data/main.html | 9 - .../TextInput.html | 1 - .../store-component-binding-deep/_config.js | 47 - .../store-component-binding-deep/main.html | 10 - .../store-component-binding-each/Widget.html | 1 - .../store-component-binding-each/_config.js | 41 - .../store-component-binding-each/main.html | 15 - .../store-component-binding/TextInput.html | 1 - .../store-component-binding/_config.js | 45 - .../samples/store-component-binding/main.html | 10 - .../store-computed-oncreate/_config.js | 11 - .../samples/store-computed-oncreate/main.html | 10 - test/runtime/samples/store-computed/Todo.html | 15 - .../runtime/samples/store-computed/_config.js | 63 - test/runtime/samples/store-computed/main.html | 11 - .../samples/store-event/NameInput.html | 1 - test/runtime/samples/store-event/_config.js | 34 - test/runtime/samples/store-event/main.html | 10 - test/runtime/samples/store-nested/Nested.html | 13 - test/runtime/samples/store-nested/_config.js | 5 - test/runtime/samples/store-nested/main.html | 11 - .../samples/store-onstate-dollar/_config.js | 27 - .../samples/store-onstate-dollar/main.html | 1 - test/runtime/samples/store-root/Nested.html | 1 - test/runtime/samples/store-root/_config.js | 15 - test/runtime/samples/store-root/main.html | 19 - test/runtime/samples/store/_config.js | 17 - test/runtime/samples/store/main.html | 1 - .../runtime/samples/svg-attributes/_config.js | 7 +- .../Rect.html | 7 - .../_config.js | 21 - .../main.html | 11 - .../Rect.html | 11 +- .../_config.js | 7 +- .../main.html | 15 +- .../Rect.html | 11 +- .../_config.js | 7 +- .../main.html | 15 +- test/runtime/samples/svg-class/_config.js | 10 +- .../samples/svg-each-block-anchor/_config.js | 6 +- .../svg-each-block-namespace/_config.js | 11 +- .../svg-each-block-namespace/main.html | 14 +- test/runtime/samples/svg-multiple/_config.js | 7 +- .../samples/svg-no-whitespace/_config.js | 2 +- .../runtime/samples/svg-with-style/_config.js | 2 +- test/runtime/samples/svg-xlink/_config.js | 8 +- test/runtime/samples/svg-xmlns/_config.js | 9 +- test/runtime/samples/svg/_config.js | 7 +- test/runtime/samples/template/_config.js | 2 +- .../samples/textarea-children/_config.js | 8 +- .../runtime/samples/textarea-value/_config.js | 8 +- .../_config.js | 6 +- .../transition-css-deferred-removal/main.html | 48 +- .../samples/transition-css-delay/_config.js | 14 +- .../samples/transition-css-delay/main.html | 32 +- .../transition-css-duration/_config.js | 6 +- .../samples/transition-css-duration/main.html | 30 +- .../_config.js | 10 +- .../main.html | 32 +- .../transition-js-aborted-outro/_config.js | 8 +- .../transition-js-aborted-outro/main.html | 30 +- .../samples/transition-js-args/_config.js | 7 +- .../samples/transition-js-args/main.html | 30 +- .../transition-js-await-block/_config.js | 7 +- .../transition-js-await-block/main.html | 30 +- .../samples/transition-js-context/_config.js | 4 +- .../samples/transition-js-context/main.html | 31 +- .../samples/transition-js-deferred/_config.js | 6 +- .../samples/transition-js-deferred/main.html | 34 +- .../transition-js-delay-in-out/_config.js | 30 +- .../transition-js-delay-in-out/main.html | 50 +- .../samples/transition-js-delay/_config.js | 36 +- .../samples/transition-js-delay/main.html | 32 +- .../_config.js | 10 +- .../main.html | 30 +- .../transition-js-dynamic-component/A.html | 24 +- .../transition-js-dynamic-component/B.html | 24 +- .../_config.js | 9 +- .../transition-js-dynamic-component/main.html | 12 +- .../_config.js | 45 +- .../main.html | 33 +- .../_config.js | 56 +- .../main.html | 49 +- .../transition-js-each-block-intro/_config.js | 46 +- .../transition-js-each-block-intro/main.html | 30 +- .../_config.js | 90 +- .../main.html | 30 +- .../_config.js | 62 +- .../main.html | 30 +- .../_config.js | 14 +- .../main.html | 30 +- .../transition-js-each-block-outro/_config.js | 6 +- .../transition-js-each-block-outro/main.html | 30 +- .../samples/transition-js-events/_config.js | 24 +- .../samples/transition-js-events/main.html | 89 +- .../transition-js-if-block-bidi/_config.js | 36 +- .../transition-js-if-block-bidi/main.html | 32 +- .../_config.js | 14 +- .../main.html | 33 +- .../_config.js | 14 +- .../main.html | 33 +- .../_config.js | 20 +- .../main.html | 30 +- .../_config.js | 62 +- .../main.html | 46 +- .../transition-js-if-block-intro/_config.js | 20 +- .../transition-js-if-block-intro/main.html | 30 +- .../_config.js | 12 +- .../main.html | 31 +- .../_config.js | 23 +- .../main.html | 34 +- .../_config.js | 26 +- .../main.html | 33 +- .../_config.js | 21 +- .../main.html | 33 +- .../_config.js | 24 +- .../main.html | 34 +- .../samples/transition-js-initial/_config.js | 4 +- .../samples/transition-js-initial/main.html | 28 +- .../_config.js | 5 +- .../main.html | 24 +- .../Widget.html | 24 +- .../_config.js | 4 +- .../main.html | 12 +- .../_config.js | 4 +- .../main.html | 24 +- .../transition-js-nested-await/_config.js | 11 +- .../transition-js-nested-await/main.html | 31 +- .../Widget.html | 24 +- .../transition-js-nested-component/_config.js | 11 +- .../transition-js-nested-component/main.html | 16 +- .../_config.js | 17 +- .../main.html | 29 +- .../_config.js | 8 +- .../main.html | 17 +- .../_config.js | 11 +- .../transition-js-nested-each-keyed/main.html | 31 +- .../transition-js-nested-each/_config.js | 11 +- .../transition-js-nested-each/main.html | 31 +- .../transition-js-nested-if/_config.js | 11 +- .../samples/transition-js-nested-if/main.html | 31 +- .../transition-js-nested-intro/Child.html | 26 +- .../transition-js-nested-intro/_config.js | 26 +- .../transition-js-nested-intro/main.html | 14 +- .../_config.js | 8 +- .../main.html | 31 +- .../transition-js-parameterised/_config.js | 6 +- .../transition-js-parameterised/main.html | 30 +- .../samples/whitespace-each-block/_config.js | 4 +- .../samples/whitespace-list/_config.js | 4 +- .../samples/whitespace-normal/_config.js | 4 +- .../window-bind-scroll-update/_config.js | 10 +- .../samples/window-binding-resize/_config.js | 14 +- .../samples/window-binding-resize/main.html | 2 +- .../samples/window-event-context/_config.js | 24 +- .../samples/window-event-context/main.html | 2 +- .../samples/window-event-custom/_config.js | 4 +- .../samples/window-event-custom/main.html | 38 +- test/runtime/samples/window-event/_config.js | 14 +- test/runtime/samples/window-event/main.html | 2 +- test/server-side-rendering/index.js | 33 +- .../samples/attribute-boolean/_actual.html | 1 - .../samples/attribute-dynamic/_actual.html | 1 - .../attribute-escaped-quotes-spread/main.html | 21 +- .../attribute-escaped-quotes/main.html | 13 +- .../samples/attribute-static/_actual.html | 1 - .../samples/bindings/main.html | 13 +- .../samples/comment/_actual.html | 3 - .../component-binding-renamed/Foo.html | 12 +- .../component-binding-renamed/_actual.html | 1 - .../component-binding-renamed/main.html | 11 +- .../samples/component-binding/Foo.html | 12 +- .../samples/component-binding/_actual.html | 1 - .../samples/component-binding/main.html | 10 +- .../component-data-dynamic/_actual.html | 6 - .../samples/component-data-dynamic/main.html | 15 +- .../samples/component-data-empty/_actual.html | 3 - .../samples/component-data-empty/main.html | 12 +- .../_actual.html | 1 - .../component-refs-and-attributes/main.html | 14 +- .../samples/component-refs/_actual.html | 1 - .../samples/component-refs/main.html | 10 +- .../main.svelte | 12 +- .../samples/component-yield/Widget.html | 12 +- .../samples/component-yield/_actual.html | 3 - .../samples/component-yield/main.html | 18 +- .../samples/component/_actual.html | 3 - .../samples/component/main.html | 12 +- .../samples/computed/_actual.html | 2 - .../samples/computed/main.html | 22 +- .../default-data-override/_actual.html | 1 - .../samples/default-data-override/main.html | 12 +- .../samples/default-data/_actual.html | 1 - .../samples/default-data/main.html | 12 +- .../samples/directives/_actual.html | 1 - .../samples/directives/main.html | 2 +- .../samples/dynamic-text-escaped/_actual.html | 1 - .../samples/dynamic-text/_actual.html | 1 - .../samples/each-block/_actual.html | 1 - .../empty-elements-closed/_actual.html | 2 - .../samples/entities/_actual.html | 1 - .../samples/helpers/_actual.html | 1 - .../samples/helpers/main.html | 16 +- .../samples/if-block-false/_actual.html | 0 .../samples/if-block-true/_actual.html | 1 - .../samples/import-non-component/_actual.html | 2 - .../samples/import-non-component/answer.js | 2 +- .../samples/import-non-component/main.html | 12 +- .../samples/import-non-component/problems.js | 2 +- .../samples/raw-mustaches/_actual.html | 1 - .../samples/sanitize-name/main.html | 8 +- .../samples/static-div/_actual.html | 1 - .../samples/static-text/_actual.html | 1 - .../samples/styles-nested/One.html | 14 +- .../samples/styles-nested/_actual.html | 8 - .../samples/styles-nested/main.html | 12 +- .../samples/styles/_actual.html | 1 - .../samples/textarea-children/main.html | 14 +- .../samples/textarea-value/main.html | 12 +- .../samples/triple/_actual.html | 1 - .../samples/triple/main.html | 12 +- test/setup.js | 11 +- test/sourcemaps/index.js | 5 +- test/sourcemaps/samples/basic/test.js | 2 +- .../input.html | 10 +- .../samples/binding-shorthand.skip/test.js | 21 + .../samples/binding-shorthand/test.js | 21 - test/sourcemaps/samples/binding/input.html | 2 +- test/sourcemaps/samples/binding/test.js | 12 +- test/sourcemaps/samples/css/test.js | 2 +- test/sourcemaps/samples/script/input.html | 14 +- test/sourcemaps/samples/script/test.js | 2 +- .../samples/static-no-script/test.js | 2 +- test/stats/index.js | 13 +- test/stats/samples/hooks/_config.js | 10 - test/stats/samples/hooks/input.html | 7 - test/stats/samples/props/_config.js | 2 +- test/stats/samples/props/input.html | 26 +- .../samples/template-references/_config.js | 8 + .../samples/template-references/input.html | 2 + test/store/index.js | 231 +- test/validator/index.js | 2 +- .../samples/a11y-not-on-components/input.html | 10 +- .../a11y-not-on-components/warnings.json | 10 +- .../{errors.json => warnings.json} | 4 +- .../samples/action-on-component/errors.json | 10 +- .../samples/action-on-component/input.html | 14 +- .../samples/animation-duplicate/errors.json | 10 +- .../samples/animation-duplicate/input.html | 21 +- .../{errors.json => warnings.json} | 4 +- .../samples/animation-not-in-each/errors.json | 10 +- .../samples/animation-not-in-each/input.html | 14 +- .../animation-not-in-keyed-each/errors.json | 10 +- .../animation-not-in-keyed-each/input.html | 16 +- .../samples/animation-siblings/errors.json | 10 +- .../samples/animation-siblings/input.html | 16 +- .../await-component-is-used/input.html | 16 +- .../samples/binding-input-checked/input.html | 2 +- .../binding-input-type-boolean/input.html | 2 +- .../binding-input-type-dynamic/input.html | 2 +- .../errors.json | 15 - .../input.html | 9 - .../errors.json | 12 +- .../input.html | 12 +- .../component-slotted-each-block/errors.json | 10 +- .../component-slotted-each-block/input.html | 16 +- .../component-slotted-if-block/errors.json | 10 +- .../component-slotted-if-block/input.html | 16 +- .../computed-purity-check-no-this/errors.json | 15 - .../computed-purity-check-no-this/input.html | 11 - .../errors.json | 15 - .../computed-purity-check-this-get/input.html | 11 - .../samples/default-export/errors.json | 15 + .../samples/default-export/input.html | 3 + .../directive-non-expression/errors.json | 15 + .../directive-non-expression/input.html | 1 + .../event-handler-ref-invalid/errors.json | 15 - .../event-handler-ref-invalid/input.html | 2 - .../samples/event-handler-ref/input.html | 2 - .../samples/event-handler-ref/warnings.json | 1 - .../errors.json | 4 +- .../input.html | 2 +- .../event-modifiers-invalid/errors.json | 4 +- .../event-modifiers-invalid/input.html | 2 +- .../samples/event-modifiers-legacy/input.html | 2 +- .../event-modifiers-redundant/input.html | 24 +- .../event-modifiers-redundant/warnings.json | 20 +- .../export-default-duplicated/errors.json | 15 - .../export-default-duplicated/input.html | 4 - .../export-default-must-be-object/errors.json | 15 - .../export-default-must-be-object/input.html | 3 - .../samples/helper-clash-context/input.html | 17 - .../helper-clash-context/warnings.json | 15 - .../input.html | 11 - .../warnings.json | 15 - .../helper-purity-check-no-this/errors.json | 15 - .../helper-purity-check-no-this/input.html | 11 - .../helper-purity-check-this-get/errors.json | 15 - .../helper-purity-check-this-get/input.html | 11 - .../input.html | 13 - .../warnings.json | 1 - .../samples/method-arrow-no-this/errors.json | 1 - .../samples/method-arrow-no-this/input.html | 9 - .../samples/method-arrow-this/errors.json | 15 - .../samples/method-arrow-this/input.html | 11 - .../method-nonexistent-helper/input.html | 17 - .../method-nonexistent-helper/warnings.json | 32 - .../samples/method-nonexistent/input.html | 11 - .../samples/method-nonexistent/warnings.json | 15 - .../samples/method-quoted/errors.json | 1 - .../samples/method-quoted/input.html | 10 - .../{errors.json => warnings.json} | 4 +- .../errors.json | 15 + .../input.html | 7 + .../errors.json | 15 + .../multiple-script-module-context/input.html | 7 + .../samples/named-export/errors.json | 15 - .../validator/samples/named-export/input.html | 3 - .../namespace-invalid-unguessable/errors.json | 14 +- .../namespace-invalid-unguessable/input.html | 6 +- .../samples/namespace-invalid/errors.json | 14 +- .../samples/namespace-invalid/input.html | 6 +- .../samples/namespace-non-literal/errors.json | 18 +- .../samples/namespace-non-literal/input.html | 8 +- .../non-object-literal-components/errors.json | 15 - .../non-object-literal-components/input.html | 5 - .../non-object-literal-events/errors.json | 15 - .../non-object-literal-events/input.html | 5 - .../non-object-literal-helpers/errors.json | 15 - .../non-object-literal-helpers/input.html | 5 - .../non-object-literal-methods/errors.json | 15 - .../non-object-literal-methods/input.html | 5 - .../errors.json | 15 - .../non-object-literal-transitions/input.html | 5 - .../oncreate-arrow-no-this/errors.json | 1 - .../samples/oncreate-arrow-no-this/input.html | 5 - .../samples/oncreate-arrow-this/errors.json | 15 - .../samples/oncreate-arrow-this/input.html | 7 - .../ondestroy-arrow-no-this/errors.json | 1 - .../ondestroy-arrow-no-this/input.html | 5 - .../samples/ondestroy-arrow-this/errors.json | 15 - .../samples/ondestroy-arrow-this/input.html | 7 - .../samples/onstate-arrow-no-this/errors.json | 1 - .../samples/onstate-arrow-no-this/input.html | 5 - .../samples/onstate-arrow-this/errors.json | 15 - .../samples/onstate-arrow-this/input.html | 7 - .../onupdate-arrow-no-this/errors.json | 1 - .../samples/onupdate-arrow-no-this/input.html | 5 - .../samples/onupdate-arrow-this/errors.json | 15 - .../samples/onupdate-arrow-this/input.html | 7 - .../errors.json | 15 - .../input.html | 9 - .../errors.json | 16 - .../input.html | 12 - .../errors.json | 15 - .../input.html | 7 - .../errors.json | 15 - .../input.html | 9 - .../errors.json | 15 - .../input.html | 12 - .../errors.json | 15 - .../input.html | 7 - .../errors.json | 15 - .../input.html | 9 - .../samples/properties-duplicated/errors.json | 15 - .../samples/properties-duplicated/input.html | 13 - .../errors.json | 15 - .../input.html | 9 - .../errors.json | 15 - .../input.html | 7 - .../errors.json | 15 - .../input.html | 7 - .../properties-unexpected-b/errors.json | 15 - .../properties-unexpected-b/input.html | 9 - .../samples/properties-unexpected/errors.json | 15 - .../samples/properties-unexpected/input.html | 11 - .../script-invalid-context/errors.json | 15 + .../samples/script-invalid-context/input.html | 3 + .../samples/store-invalid-callee/input.html | 1 - .../store-invalid-callee/warnings.json | 15 - .../input.html | 11 +- .../validator/samples/tag-invalid/errors.json | 14 +- test/validator/samples/tag-invalid/input.html | 6 +- .../samples/tag-non-string/errors.json | 16 +- .../samples/tag-non-string/input.html | 6 +- .../errors.json | 10 +- .../input.html | 14 +- .../transition-duplicate-in/errors.json | 10 +- .../transition-duplicate-in/input.html | 14 +- .../errors.json | 10 +- .../input.html | 14 +- .../transition-duplicate-out/errors.json | 10 +- .../transition-duplicate-out/input.html | 14 +- .../errors.json | 10 +- .../input.html | 14 +- .../errors.json | 10 +- .../input.html | 14 +- .../errors.json | 10 +- .../input.html | 14 +- .../{errors.json => warnings.json} | 4 +- .../transition-on-component/errors.json | 10 +- .../transition-on-component/input.html | 14 +- .../samples/undefined-value/input.html | 6 + .../samples/undefined-value/warnings.json | 15 + .../samples/unused-components/input.html | 11 - .../samples/unused-components/warnings.json | 32 - .../validator/samples/unused-event/input.html | 9 - .../samples/unused-event/warnings.json | 15 - .../samples/unused-helper/input.html | 7 - .../samples/unused-helper/warnings.json | 15 - .../samples/unused-transition/input.html | 9 - .../samples/unused-transition/warnings.json | 15 - .../input.html | 2 +- .../window-binding-invalid-value/input.html | 2 +- .../window-binding-invalid-width/input.html | 2 +- .../samples/window-binding-invalid/input.html | 2 +- .../samples/window-event-invalid/input.html | 1 - .../window-event-invalid/warnings.json | 15 - 1566 files changed, 14779 insertions(+), 17627 deletions(-) create mode 100644 index.js rename src/ssr/register.js => register.js (79%) delete mode 100644 rollup.store.config.js create mode 100644 src/compile/nodes/Meta.ts create mode 100644 src/compile/render-dom/wrappers/shared/addActions.ts create mode 100644 src/compile/render-dom/wrappers/shared/addEventHandlers.ts create mode 100644 src/compile/render-ssr/utils.ts delete mode 100644 src/compile/validate/js/propValidators/actions.ts delete mode 100644 src/compile/validate/js/propValidators/animations.ts delete mode 100644 src/compile/validate/js/propValidators/components.ts delete mode 100644 src/compile/validate/js/propValidators/computed.ts delete mode 100644 src/compile/validate/js/propValidators/data.ts delete mode 100644 src/compile/validate/js/propValidators/events.ts delete mode 100644 src/compile/validate/js/propValidators/helpers.ts delete mode 100644 src/compile/validate/js/propValidators/immutable.ts delete mode 100644 src/compile/validate/js/propValidators/index.ts delete mode 100644 src/compile/validate/js/propValidators/methods.ts delete mode 100644 src/compile/validate/js/propValidators/namespace.ts delete mode 100644 src/compile/validate/js/propValidators/oncreate.ts delete mode 100644 src/compile/validate/js/propValidators/ondestroy.ts delete mode 100644 src/compile/validate/js/propValidators/onrender.ts delete mode 100644 src/compile/validate/js/propValidators/onstate.ts delete mode 100644 src/compile/validate/js/propValidators/onteardown.ts delete mode 100644 src/compile/validate/js/propValidators/onupdate.ts delete mode 100644 src/compile/validate/js/propValidators/preload.ts delete mode 100644 src/compile/validate/js/propValidators/props.ts delete mode 100644 src/compile/validate/js/propValidators/setup.ts delete mode 100644 src/compile/validate/js/propValidators/store.ts delete mode 100644 src/compile/validate/js/propValidators/tag.ts delete mode 100644 src/compile/validate/js/propValidators/transitions.ts delete mode 100644 src/compile/validate/js/utils/checkForAccessors.ts delete mode 100644 src/compile/validate/js/utils/checkForComputedKeys.ts delete mode 100644 src/compile/validate/js/utils/checkForDupes.ts delete mode 100644 src/compile/validate/js/utils/usesThisOrArguments.ts delete mode 100644 src/compile/validate/utils/fuzzymatch.ts create mode 100644 src/internal/Component.js rename src/{shared => internal}/animations.js (100%) rename src/{shared => internal}/await-block.js (83%) rename src/{shared => internal}/dom.js (94%) create mode 100644 src/internal/index.js rename src/{shared => internal}/keyed-each.js (100%) create mode 100644 src/internal/lifecycle.js create mode 100644 src/internal/scheduler.js rename src/{shared => internal}/spread.js (100%) rename src/{shared => internal}/ssr.js (64%) rename src/{shared => internal}/transitions.js (96%) rename src/{shared => internal}/utils.js (61%) delete mode 100644 src/parse/read/directives.ts delete mode 100644 src/shared/.eslintrc.json delete mode 100644 src/shared/_build.js delete mode 100644 src/shared/index.js delete mode 100644 src/utils/deprecate.ts rename src/{compile/validate/utils/FuzzySet.ts => utils/fuzzymatch.ts} (95%) delete mode 100644 src/utils/getName.ts delete mode 100644 src/utils/getStaticAttributeValue.ts rename src/utils/{getTailSnippet.ts => get_tail_snippet.ts} (50%) create mode 100644 src/utils/indentation.ts delete mode 100644 src/utils/isThisGetCallExpression.ts delete mode 100644 src/utils/nodeToString.ts create mode 100644 src/utils/nodes_match.ts create mode 100644 src/utils/sanitize.ts delete mode 100644 src/utils/validCalleeObjects.ts delete mode 100644 src/utils/walkThroughTopFunctionScope.ts delete mode 100644 store.d.ts delete mode 100644 test/cli/samples/amd/command.sh delete mode 100644 test/cli/samples/amd/expected/Main.js delete mode 100644 test/cli/samples/amd/src/Main.html delete mode 100644 test/create/index.js create mode 100644 test/custom-elements/samples/nested.skip/Counter.html create mode 100644 test/custom-elements/samples/nested.skip/main.html rename test/custom-elements/samples/{nested => nested.skip}/test.js (83%) delete mode 100644 test/custom-elements/samples/nested/Counter.html delete mode 100644 test/custom-elements/samples/nested/main.html delete mode 100644 test/formats/index.js create mode 100644 test/js/samples/action-custom-event-handler/expected.js create mode 100644 test/js/samples/action-custom-event-handler/input.html delete mode 100644 test/js/samples/event-handlers-custom/expected.js delete mode 100644 test/js/samples/event-handlers-custom/input.html create mode 100644 test/js/samples/instrumentation-script-if-no-block/expected.js create mode 100644 test/js/samples/instrumentation-script-if-no-block/input.html create mode 100644 test/js/samples/instrumentation-script-x-equals-x/expected.js create mode 100644 test/js/samples/instrumentation-script-x-equals-x/input.html create mode 100644 test/js/samples/instrumentation-template-if-no-block/expected.js create mode 100644 test/js/samples/instrumentation-template-if-no-block/input.html create mode 100644 test/js/samples/instrumentation-template-x-equals-x/expected.js create mode 100644 test/js/samples/instrumentation-template-x-equals-x/input.html delete mode 100644 test/parser/samples/error-binding-mustaches/error.json delete mode 100644 test/parser/samples/error-binding-mustaches/input.html delete mode 100644 test/parser/samples/error-binding-rvalue/error.json delete mode 100644 test/parser/samples/error-binding-rvalue/input.html delete mode 100644 test/parser/samples/error-event-handler/error.json delete mode 100644 test/parser/samples/error-event-handler/input.html delete mode 100644 test/parser/samples/error-ref-value/error.json delete mode 100644 test/parser/samples/error-ref-value/input.html create mode 100644 test/runtime/samples/action-custom-event-handler-in-each-destructured/_config.js create mode 100644 test/runtime/samples/action-custom-event-handler-in-each-destructured/main.html create mode 100644 test/runtime/samples/action-custom-event-handler-in-each/_config.js create mode 100644 test/runtime/samples/action-custom-event-handler-in-each/main.html create mode 100644 test/runtime/samples/action-custom-event-handler-node-context/_config.js create mode 100644 test/runtime/samples/action-custom-event-handler-node-context/main.html rename test/runtime/samples/{event-handler-custom-this => action-custom-event-handler-this}/_config.js (87%) create mode 100644 test/runtime/samples/action-custom-event-handler-this/main.html create mode 100644 test/runtime/samples/action-custom-event-handler-with-context/_config.js create mode 100644 test/runtime/samples/action-custom-event-handler-with-context/main.html create mode 100644 test/runtime/samples/action-custom-event-handler/_config.js create mode 100644 test/runtime/samples/action-custom-event-handler/main.html rename test/runtime/samples/{onupdate => after-render-prevents-loop}/_config.js (63%) create mode 100644 test/runtime/samples/after-render-prevents-loop/main.html create mode 100644 test/runtime/samples/after-render-triggers-update/_config.js create mode 100644 test/runtime/samples/after-render-triggers-update/main.html create mode 100644 test/runtime/samples/assignment-in-init/_config.js create mode 100644 test/runtime/samples/assignment-in-init/main.html create mode 100644 test/runtime/samples/assignment-to-computed-property/_config.js create mode 100644 test/runtime/samples/assignment-to-computed-property/main.html delete mode 100644 test/runtime/samples/attribute-dynamic-reserved/_config.js delete mode 100644 test/runtime/samples/attribute-dynamic-reserved/main.html create mode 100644 test/runtime/samples/before-render-chain/Item.html create mode 100644 test/runtime/samples/before-render-chain/List.html create mode 100644 test/runtime/samples/before-render-chain/_config.js rename test/runtime/samples/{onrender-chain => before-render-chain}/main.html (58%) create mode 100644 test/runtime/samples/before-render-prevents-loop/_config.js create mode 100644 test/runtime/samples/before-render-prevents-loop/main.html delete mode 100644 test/runtime/samples/bindings-before-oncreate/One.html delete mode 100644 test/runtime/samples/bindings-before-oncreate/Two.html delete mode 100644 test/runtime/samples/bindings-before-oncreate/_config.js delete mode 100644 test/runtime/samples/bindings-before-oncreate/main.html create mode 100644 test/runtime/samples/bindings-before-onmount/One.html create mode 100644 test/runtime/samples/bindings-before-onmount/Two.html create mode 100644 test/runtime/samples/bindings-before-onmount/_config.js create mode 100644 test/runtime/samples/bindings-before-onmount/main.html delete mode 100644 test/runtime/samples/component-binding-invalid-identifier/Counter.html delete mode 100644 test/runtime/samples/component-binding-invalid-identifier/_config.js delete mode 100644 test/runtime/samples/component-binding-invalid-identifier/main.html delete mode 100644 test/runtime/samples/component-events-fire-finally/_config.js delete mode 100644 test/runtime/samples/component-events-fire-finally/main.html delete mode 100644 test/runtime/samples/component-invalid-identifier/Widget.html delete mode 100644 test/runtime/samples/component-invalid-identifier/_config.js delete mode 100644 test/runtime/samples/component-invalid-identifier/main.html delete mode 100644 test/runtime/samples/computed-empty/_config.js delete mode 100644 test/runtime/samples/computed-empty/main.html delete mode 100644 test/runtime/samples/computed-function/_config.js delete mode 100644 test/runtime/samples/computed-function/main.html delete mode 100644 test/runtime/samples/computed-state-object/_config.js delete mode 100644 test/runtime/samples/computed-state-object/main.html delete mode 100644 test/runtime/samples/computed-values-deconflicted/main.html delete mode 100644 test/runtime/samples/computed-values-default/_config.js delete mode 100644 test/runtime/samples/computed-values-default/main.html delete mode 100644 test/runtime/samples/computed-values-function-dependency/_config.js delete mode 100644 test/runtime/samples/computed-values-function-dependency/main.html delete mode 100644 test/runtime/samples/computed-values/_config.js delete mode 100644 test/runtime/samples/computed-values/main.html delete mode 100644 test/runtime/samples/computed-whole-state/_config.js delete mode 100644 test/runtime/samples/computed-whole-state/main.html delete mode 100644 test/runtime/samples/dev-accept-declarative-store/_config.js delete mode 100644 test/runtime/samples/dev-accept-declarative-store/main.html delete mode 100644 test/runtime/samples/dev-error-missing-store-option/_config.js delete mode 100644 test/runtime/samples/dev-error-missing-store-option/main.html delete mode 100644 test/runtime/samples/dev-warning-bad-set-argument/_config.js delete mode 100644 test/runtime/samples/dev-warning-bad-set-argument/main.html delete mode 100644 test/runtime/samples/dev-warning-dynamic-components-misplaced/Bar.html delete mode 100644 test/runtime/samples/dev-warning-dynamic-components-misplaced/Foo.html delete mode 100644 test/runtime/samples/dev-warning-dynamic-components-misplaced/_config.js delete mode 100644 test/runtime/samples/dev-warning-dynamic-components-misplaced/main.html delete mode 100644 test/runtime/samples/event-handler-custom-context/_config.js delete mode 100644 test/runtime/samples/event-handler-custom-context/main.html delete mode 100644 test/runtime/samples/event-handler-custom-each-destructured/_config.js delete mode 100644 test/runtime/samples/event-handler-custom-each-destructured/main.html delete mode 100644 test/runtime/samples/event-handler-custom-each/_config.js delete mode 100644 test/runtime/samples/event-handler-custom-each/main.html delete mode 100644 test/runtime/samples/event-handler-custom-node-context/_config.js delete mode 100644 test/runtime/samples/event-handler-custom-node-context/main.html delete mode 100644 test/runtime/samples/event-handler-custom-this/main.html delete mode 100644 test/runtime/samples/event-handler-custom/_config.js delete mode 100644 test/runtime/samples/event-handler-custom/main.html delete mode 100644 test/runtime/samples/event-handler-destroy/_config.js delete mode 100644 test/runtime/samples/event-handler-destroy/main.html create mode 100644 test/runtime/samples/event-handler-modifier-once/_config.js create mode 100644 test/runtime/samples/event-handler-modifier-once/main.html create mode 100644 test/runtime/samples/event-handler-modifier-prevent-default/_config.js create mode 100644 test/runtime/samples/event-handler-modifier-prevent-default/main.html create mode 100644 test/runtime/samples/event-handler-modifier-stop-propagation/_config.js create mode 100644 test/runtime/samples/event-handler-modifier-stop-propagation/main.html delete mode 100644 test/runtime/samples/event-handler-shorthand/_config.js delete mode 100644 test/runtime/samples/event-handler-shorthand/main.html delete mode 100644 test/runtime/samples/events-custom/_config.js delete mode 100644 test/runtime/samples/events-custom/main.html delete mode 100644 test/runtime/samples/events-lifecycle/_config.js delete mode 100644 test/runtime/samples/events-lifecycle/main.html delete mode 100644 test/runtime/samples/get-state/_config.js delete mode 100644 test/runtime/samples/get-state/main.html create mode 100644 test/runtime/samples/head-title-dynamic-simple/_config.js create mode 100644 test/runtime/samples/head-title-dynamic-simple/main.html delete mode 100644 test/runtime/samples/immutable-mutable/Nested.html delete mode 100644 test/runtime/samples/immutable-mutable/_config.js delete mode 100644 test/runtime/samples/immutable-mutable/main.html create mode 100644 test/runtime/samples/instrumentation-script-destructuring/_config.js create mode 100644 test/runtime/samples/instrumentation-script-destructuring/main.html create mode 100644 test/runtime/samples/instrumentation-script-loop-scope/_config.js create mode 100644 test/runtime/samples/instrumentation-script-loop-scope/main.html create mode 100644 test/runtime/samples/instrumentation-script-multiple-assignments/_config.js create mode 100644 test/runtime/samples/instrumentation-script-multiple-assignments/main.html create mode 100644 test/runtime/samples/instrumentation-script-update/_config.js create mode 100644 test/runtime/samples/instrumentation-script-update/main.html create mode 100644 test/runtime/samples/instrumentation-template-destructuring/_config.js create mode 100644 test/runtime/samples/instrumentation-template-destructuring/main.html create mode 100644 test/runtime/samples/instrumentation-template-loop-scope/_config.js create mode 100644 test/runtime/samples/instrumentation-template-loop-scope/main.html create mode 100644 test/runtime/samples/instrumentation-template-multiple-assignments/_config.js create mode 100644 test/runtime/samples/instrumentation-template-multiple-assignments/main.html create mode 100644 test/runtime/samples/instrumentation-template-update/_config.js create mode 100644 test/runtime/samples/instrumentation-template-update/main.html rename test/runtime/samples/{onstate-before-render => lifecycle-render-order}/_config.js (53%) create mode 100644 test/runtime/samples/lifecycle-render-order/main.html rename test/runtime/samples/{onstate-before-render => lifecycle-render-order}/order.js (100%) create mode 100644 test/runtime/samples/module-context/_config.js create mode 100644 test/runtime/samples/module-context/main.html delete mode 100644 test/runtime/samples/object-rest/_config.js delete mode 100644 test/runtime/samples/object-rest/main.html delete mode 100644 test/runtime/samples/observe-binding-ignores-unchanged/Nested.html delete mode 100644 test/runtime/samples/observe-binding-ignores-unchanged/_config.js delete mode 100644 test/runtime/samples/observe-binding-ignores-unchanged/main.html delete mode 100644 test/runtime/samples/observe-component-ignores-irrelevant-changes/Foo.html delete mode 100644 test/runtime/samples/observe-component-ignores-irrelevant-changes/_config.js delete mode 100644 test/runtime/samples/observe-component-ignores-irrelevant-changes/main.html delete mode 100644 test/runtime/samples/observe-deferred/_config.js delete mode 100644 test/runtime/samples/observe-deferred/main.html delete mode 100644 test/runtime/samples/observe-prevents-loop/_config.js delete mode 100644 test/runtime/samples/observe-prevents-loop/main.html delete mode 100644 test/runtime/samples/oncreate-async-arrow-block/_config.js delete mode 100644 test/runtime/samples/oncreate-async-arrow-block/main.html delete mode 100644 test/runtime/samples/oncreate-async-arrow/_config.js delete mode 100644 test/runtime/samples/oncreate-async-arrow/main.html delete mode 100644 test/runtime/samples/oncreate-async/_config.js delete mode 100644 test/runtime/samples/oncreate-async/main.html delete mode 100644 test/runtime/samples/oncreate-sibling-order/Nested.html delete mode 100644 test/runtime/samples/oncreate-sibling-order/main.html create mode 100644 test/runtime/samples/ondestroy-before-cleanup/container.js create mode 100644 test/runtime/samples/onmount-async/_config.js create mode 100644 test/runtime/samples/onmount-async/main.html rename test/runtime/samples/{onrender-fires-when-ready-nested => onmount-fires-when-ready-nested}/ParentWidget.html (63%) create mode 100644 test/runtime/samples/onmount-fires-when-ready-nested/Widget.html rename test/runtime/samples/{onrender-fires-when-ready-nested => onmount-fires-when-ready-nested}/_config.js (64%) rename test/runtime/samples/{onrender-fires-when-ready-nested => onmount-fires-when-ready-nested}/main.html (67%) create mode 100644 test/runtime/samples/onmount-fires-when-ready/Widget.html create mode 100644 test/runtime/samples/onmount-fires-when-ready/_config.js rename test/runtime/samples/{onrender-fires-when-ready => onmount-fires-when-ready}/main.html (68%) create mode 100644 test/runtime/samples/onmount-sibling-order/Nested.html rename test/runtime/samples/{oncreate-sibling-order => onmount-sibling-order}/_config.js (52%) create mode 100644 test/runtime/samples/onmount-sibling-order/main.html rename test/runtime/samples/{oncreate-sibling-order => onmount-sibling-order}/result.js (100%) delete mode 100644 test/runtime/samples/onrender-chain/Item.html delete mode 100644 test/runtime/samples/onrender-chain/List.html delete mode 100644 test/runtime/samples/onrender-chain/_config.js delete mode 100644 test/runtime/samples/onrender-fires-when-ready-nested/Widget.html delete mode 100644 test/runtime/samples/onrender-fires-when-ready/Widget.html delete mode 100644 test/runtime/samples/onrender-fires-when-ready/_config.js delete mode 100644 test/runtime/samples/onstate-before-oncreate/_config.js delete mode 100644 test/runtime/samples/onstate-before-oncreate/main.html delete mode 100644 test/runtime/samples/onstate-before-render/main.html delete mode 100644 test/runtime/samples/onstate-event/_config.js delete mode 100644 test/runtime/samples/onstate-event/main.html delete mode 100644 test/runtime/samples/onstate-no-template/_config.js delete mode 100644 test/runtime/samples/onstate-no-template/main.html delete mode 100644 test/runtime/samples/onstate/_config.js delete mode 100644 test/runtime/samples/onstate/main.html delete mode 100644 test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/_config.js delete mode 100644 test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/main.html delete mode 100644 test/runtime/samples/onupdate/main.html delete mode 100644 test/runtime/samples/options/_config.js delete mode 100644 test/runtime/samples/options/main.html create mode 100644 test/runtime/samples/reactive-function/_config.js create mode 100644 test/runtime/samples/reactive-function/main.html rename test/runtime/samples/{computed-values-deconflicted => reactive-values-deconflicted}/_config.js (64%) create mode 100644 test/runtime/samples/reactive-values-deconflicted/main.html create mode 100644 test/runtime/samples/reactive-values-function-dependency/_config.js create mode 100644 test/runtime/samples/reactive-values-function-dependency/main.html create mode 100644 test/runtime/samples/reactive-values-second-order/_config.js create mode 100644 test/runtime/samples/reactive-values-second-order/main.html create mode 100644 test/runtime/samples/reactive-values-self-dependency/_config.js create mode 100644 test/runtime/samples/reactive-values-self-dependency/main.html create mode 100644 test/runtime/samples/reactive-values/_config.js create mode 100644 test/runtime/samples/reactive-values/main.html delete mode 100644 test/runtime/samples/set-clones-input/_config.js delete mode 100644 test/runtime/samples/set-clones-input/main.html delete mode 100644 test/runtime/samples/set-in-ondestroy/_config.js delete mode 100644 test/runtime/samples/set-in-ondestroy/main.html delete mode 100644 test/runtime/samples/set-mutated-data/_config.js delete mode 100644 test/runtime/samples/set-mutated-data/main.html delete mode 100644 test/runtime/samples/setup/_config.js delete mode 100644 test/runtime/samples/setup/main.html create mode 100644 test/runtime/samples/spread-own-props/Widget.html create mode 100644 test/runtime/samples/spread-own-props/_config.js create mode 100644 test/runtime/samples/spread-own-props/main.html delete mode 100644 test/runtime/samples/store-binding/NameInput.html delete mode 100644 test/runtime/samples/store-binding/_config.js delete mode 100644 test/runtime/samples/store-binding/main.html delete mode 100644 test/runtime/samples/store-child-data/Component.html delete mode 100644 test/runtime/samples/store-child-data/_config.js delete mode 100644 test/runtime/samples/store-child-data/main.html delete mode 100644 test/runtime/samples/store-component-binding-deep/TextInput.html delete mode 100644 test/runtime/samples/store-component-binding-deep/_config.js delete mode 100644 test/runtime/samples/store-component-binding-deep/main.html delete mode 100644 test/runtime/samples/store-component-binding-each/Widget.html delete mode 100644 test/runtime/samples/store-component-binding-each/_config.js delete mode 100644 test/runtime/samples/store-component-binding-each/main.html delete mode 100644 test/runtime/samples/store-component-binding/TextInput.html delete mode 100644 test/runtime/samples/store-component-binding/_config.js delete mode 100644 test/runtime/samples/store-component-binding/main.html delete mode 100644 test/runtime/samples/store-computed-oncreate/_config.js delete mode 100644 test/runtime/samples/store-computed-oncreate/main.html delete mode 100644 test/runtime/samples/store-computed/Todo.html delete mode 100644 test/runtime/samples/store-computed/_config.js delete mode 100644 test/runtime/samples/store-computed/main.html delete mode 100644 test/runtime/samples/store-event/NameInput.html delete mode 100644 test/runtime/samples/store-event/_config.js delete mode 100644 test/runtime/samples/store-event/main.html delete mode 100644 test/runtime/samples/store-nested/Nested.html delete mode 100644 test/runtime/samples/store-nested/_config.js delete mode 100644 test/runtime/samples/store-nested/main.html delete mode 100644 test/runtime/samples/store-onstate-dollar/_config.js delete mode 100644 test/runtime/samples/store-onstate-dollar/main.html delete mode 100644 test/runtime/samples/store-root/Nested.html delete mode 100644 test/runtime/samples/store-root/_config.js delete mode 100644 test/runtime/samples/store-root/main.html delete mode 100644 test/runtime/samples/store/_config.js delete mode 100644 test/runtime/samples/store/main.html delete mode 100644 test/runtime/samples/svg-child-component-declared-namespace-backtick-string/Rect.html delete mode 100644 test/runtime/samples/svg-child-component-declared-namespace-backtick-string/_config.js delete mode 100644 test/runtime/samples/svg-child-component-declared-namespace-backtick-string/main.html delete mode 100644 test/server-side-rendering/samples/attribute-boolean/_actual.html delete mode 100644 test/server-side-rendering/samples/attribute-dynamic/_actual.html delete mode 100644 test/server-side-rendering/samples/attribute-static/_actual.html delete mode 100644 test/server-side-rendering/samples/comment/_actual.html delete mode 100644 test/server-side-rendering/samples/component-binding-renamed/_actual.html delete mode 100644 test/server-side-rendering/samples/component-binding/_actual.html delete mode 100644 test/server-side-rendering/samples/component-data-dynamic/_actual.html delete mode 100644 test/server-side-rendering/samples/component-data-empty/_actual.html delete mode 100644 test/server-side-rendering/samples/component-refs-and-attributes/_actual.html delete mode 100644 test/server-side-rendering/samples/component-refs/_actual.html delete mode 100644 test/server-side-rendering/samples/component-yield/_actual.html delete mode 100644 test/server-side-rendering/samples/component/_actual.html delete mode 100644 test/server-side-rendering/samples/computed/_actual.html delete mode 100644 test/server-side-rendering/samples/default-data-override/_actual.html delete mode 100644 test/server-side-rendering/samples/default-data/_actual.html delete mode 100644 test/server-side-rendering/samples/directives/_actual.html delete mode 100644 test/server-side-rendering/samples/dynamic-text-escaped/_actual.html delete mode 100644 test/server-side-rendering/samples/dynamic-text/_actual.html delete mode 100644 test/server-side-rendering/samples/each-block/_actual.html delete mode 100644 test/server-side-rendering/samples/empty-elements-closed/_actual.html delete mode 100644 test/server-side-rendering/samples/entities/_actual.html delete mode 100644 test/server-side-rendering/samples/helpers/_actual.html delete mode 100644 test/server-side-rendering/samples/if-block-false/_actual.html delete mode 100644 test/server-side-rendering/samples/if-block-true/_actual.html delete mode 100644 test/server-side-rendering/samples/import-non-component/_actual.html delete mode 100644 test/server-side-rendering/samples/raw-mustaches/_actual.html delete mode 100644 test/server-side-rendering/samples/static-div/_actual.html delete mode 100644 test/server-side-rendering/samples/static-text/_actual.html delete mode 100644 test/server-side-rendering/samples/styles-nested/_actual.html delete mode 100644 test/server-side-rendering/samples/styles/_actual.html delete mode 100644 test/server-side-rendering/samples/triple/_actual.html rename test/sourcemaps/samples/{binding-shorthand => binding-shorthand.skip}/input.html (59%) create mode 100644 test/sourcemaps/samples/binding-shorthand.skip/test.js delete mode 100644 test/sourcemaps/samples/binding-shorthand/test.js delete mode 100644 test/stats/samples/hooks/_config.js delete mode 100644 test/stats/samples/hooks/input.html create mode 100644 test/stats/samples/template-references/_config.js create mode 100644 test/stats/samples/template-references/input.html rename test/validator/samples/action-invalid/{errors.json => warnings.json} (64%) rename test/validator/samples/animation-missing/{errors.json => warnings.json} (65%) delete mode 100644 test/validator/samples/component-cannot-be-called-state/errors.json delete mode 100644 test/validator/samples/component-cannot-be-called-state/input.html delete mode 100644 test/validator/samples/computed-purity-check-no-this/errors.json delete mode 100644 test/validator/samples/computed-purity-check-no-this/input.html delete mode 100644 test/validator/samples/computed-purity-check-this-get/errors.json delete mode 100644 test/validator/samples/computed-purity-check-this-get/input.html create mode 100644 test/validator/samples/default-export/errors.json create mode 100644 test/validator/samples/default-export/input.html create mode 100644 test/validator/samples/directive-non-expression/errors.json create mode 100644 test/validator/samples/directive-non-expression/input.html delete mode 100644 test/validator/samples/event-handler-ref-invalid/errors.json delete mode 100644 test/validator/samples/event-handler-ref-invalid/input.html delete mode 100644 test/validator/samples/event-handler-ref/input.html delete mode 100644 test/validator/samples/event-handler-ref/warnings.json delete mode 100644 test/validator/samples/export-default-duplicated/errors.json delete mode 100644 test/validator/samples/export-default-duplicated/input.html delete mode 100644 test/validator/samples/export-default-must-be-object/errors.json delete mode 100644 test/validator/samples/export-default-must-be-object/input.html delete mode 100644 test/validator/samples/helper-clash-context/input.html delete mode 100644 test/validator/samples/helper-clash-context/warnings.json delete mode 100644 test/validator/samples/helper-purity-check-needs-arguments/input.html delete mode 100644 test/validator/samples/helper-purity-check-needs-arguments/warnings.json delete mode 100644 test/validator/samples/helper-purity-check-no-this/errors.json delete mode 100644 test/validator/samples/helper-purity-check-no-this/input.html delete mode 100644 test/validator/samples/helper-purity-check-this-get/errors.json delete mode 100644 test/validator/samples/helper-purity-check-this-get/input.html delete mode 100644 test/validator/samples/helper-purity-check-uses-arguments/input.html delete mode 100644 test/validator/samples/helper-purity-check-uses-arguments/warnings.json delete mode 100644 test/validator/samples/method-arrow-no-this/errors.json delete mode 100644 test/validator/samples/method-arrow-no-this/input.html delete mode 100644 test/validator/samples/method-arrow-this/errors.json delete mode 100644 test/validator/samples/method-arrow-this/input.html delete mode 100644 test/validator/samples/method-nonexistent-helper/input.html delete mode 100644 test/validator/samples/method-nonexistent-helper/warnings.json delete mode 100644 test/validator/samples/method-nonexistent/input.html delete mode 100644 test/validator/samples/method-nonexistent/warnings.json delete mode 100644 test/validator/samples/method-quoted/errors.json delete mode 100644 test/validator/samples/method-quoted/input.html rename test/validator/samples/missing-component/{errors.json => warnings.json} (63%) create mode 100644 test/validator/samples/multiple-script-default-context/errors.json create mode 100644 test/validator/samples/multiple-script-default-context/input.html create mode 100644 test/validator/samples/multiple-script-module-context/errors.json create mode 100644 test/validator/samples/multiple-script-module-context/input.html delete mode 100644 test/validator/samples/named-export/errors.json delete mode 100644 test/validator/samples/named-export/input.html delete mode 100644 test/validator/samples/non-object-literal-components/errors.json delete mode 100644 test/validator/samples/non-object-literal-components/input.html delete mode 100644 test/validator/samples/non-object-literal-events/errors.json delete mode 100644 test/validator/samples/non-object-literal-events/input.html delete mode 100644 test/validator/samples/non-object-literal-helpers/errors.json delete mode 100644 test/validator/samples/non-object-literal-helpers/input.html delete mode 100644 test/validator/samples/non-object-literal-methods/errors.json delete mode 100644 test/validator/samples/non-object-literal-methods/input.html delete mode 100644 test/validator/samples/non-object-literal-transitions/errors.json delete mode 100644 test/validator/samples/non-object-literal-transitions/input.html delete mode 100644 test/validator/samples/oncreate-arrow-no-this/errors.json delete mode 100644 test/validator/samples/oncreate-arrow-no-this/input.html delete mode 100644 test/validator/samples/oncreate-arrow-this/errors.json delete mode 100644 test/validator/samples/oncreate-arrow-this/input.html delete mode 100644 test/validator/samples/ondestroy-arrow-no-this/errors.json delete mode 100644 test/validator/samples/ondestroy-arrow-no-this/input.html delete mode 100644 test/validator/samples/ondestroy-arrow-this/errors.json delete mode 100644 test/validator/samples/ondestroy-arrow-this/input.html delete mode 100644 test/validator/samples/onstate-arrow-no-this/errors.json delete mode 100644 test/validator/samples/onstate-arrow-no-this/input.html delete mode 100644 test/validator/samples/onstate-arrow-this/errors.json delete mode 100644 test/validator/samples/onstate-arrow-this/input.html delete mode 100644 test/validator/samples/onupdate-arrow-no-this/errors.json delete mode 100644 test/validator/samples/onupdate-arrow-no-this/input.html delete mode 100644 test/validator/samples/onupdate-arrow-this/errors.json delete mode 100644 test/validator/samples/onupdate-arrow-this/input.html delete mode 100644 test/validator/samples/properties-components-must-be-capitalised/errors.json delete mode 100644 test/validator/samples/properties-components-must-be-capitalised/input.html delete mode 100644 test/validator/samples/properties-computed-cannot-be-reserved/errors.json delete mode 100644 test/validator/samples/properties-computed-cannot-be-reserved/input.html delete mode 100644 test/validator/samples/properties-computed-must-be-an-object/errors.json delete mode 100644 test/validator/samples/properties-computed-must-be-an-object/input.html delete mode 100644 test/validator/samples/properties-computed-must-be-functions/errors.json delete mode 100644 test/validator/samples/properties-computed-must-be-functions/input.html delete mode 100644 test/validator/samples/properties-computed-must-be-valid-function-names/errors.json delete mode 100644 test/validator/samples/properties-computed-must-be-valid-function-names/input.html delete mode 100644 test/validator/samples/properties-computed-values-needs-arguments/errors.json delete mode 100644 test/validator/samples/properties-computed-values-needs-arguments/input.html delete mode 100644 test/validator/samples/properties-data-must-be-function/errors.json delete mode 100644 test/validator/samples/properties-data-must-be-function/input.html delete mode 100644 test/validator/samples/properties-duplicated/errors.json delete mode 100644 test/validator/samples/properties-duplicated/input.html delete mode 100644 test/validator/samples/properties-methods-getters-setters/errors.json delete mode 100644 test/validator/samples/properties-methods-getters-setters/input.html delete mode 100644 test/validator/samples/properties-props-must-be-an-array/errors.json delete mode 100644 test/validator/samples/properties-props-must-be-an-array/input.html delete mode 100644 test/validator/samples/properties-props-must-be-array-of-strings/errors.json delete mode 100644 test/validator/samples/properties-props-must-be-array-of-strings/input.html delete mode 100644 test/validator/samples/properties-unexpected-b/errors.json delete mode 100644 test/validator/samples/properties-unexpected-b/input.html delete mode 100644 test/validator/samples/properties-unexpected/errors.json delete mode 100644 test/validator/samples/properties-unexpected/input.html create mode 100644 test/validator/samples/script-invalid-context/errors.json create mode 100644 test/validator/samples/script-invalid-context/input.html delete mode 100644 test/validator/samples/store-invalid-callee/input.html delete mode 100644 test/validator/samples/store-invalid-callee/warnings.json rename test/validator/samples/transition-missing/{errors.json => warnings.json} (64%) create mode 100644 test/validator/samples/undefined-value/input.html create mode 100644 test/validator/samples/undefined-value/warnings.json delete mode 100644 test/validator/samples/unused-components/input.html delete mode 100644 test/validator/samples/unused-components/warnings.json delete mode 100644 test/validator/samples/unused-event/input.html delete mode 100644 test/validator/samples/unused-event/warnings.json delete mode 100644 test/validator/samples/unused-helper/input.html delete mode 100644 test/validator/samples/unused-helper/warnings.json delete mode 100644 test/validator/samples/unused-transition/input.html delete mode 100644 test/validator/samples/unused-transition/warnings.json delete mode 100644 test/validator/samples/window-event-invalid/input.html delete mode 100644 test/validator/samples/window-event-invalid/warnings.json diff --git a/.gitignore b/.gitignore index 472328464..930c8dc86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,12 @@ .DS_Store .nyc_output node_modules +*.map /cli/ /compiler/ /ssr/ -/shared.js +/internal.js +/compiler.js /scratch/ /coverage/ /coverage.lcov/ @@ -13,7 +15,7 @@ node_modules /test/sourcemaps/samples/*/output.js.map /test/sourcemaps/samples/*/output.css /test/sourcemaps/samples/*/output.css.map -/src/compile/shared.ts /store.umd.js /yarn-error.log -_actual*.* \ No newline at end of file +_actual*.* +_*/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index de91162ec..aeadd48f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: node_js node_js: - - "6" - "node" env: diff --git a/appveyor.yml b/appveyor.yml index 19dcad4f1..249f61abf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,7 +10,7 @@ init: environment: matrix: # node.js - - nodejs_version: 6 + - nodejs_version: 10 install: - ps: Install-Product node $env:nodejs_version diff --git a/index.js b/index.js new file mode 100644 index 000000000..9fdeadb8f --- /dev/null +++ b/index.js @@ -0,0 +1,7 @@ +export { + onMount, + onDestroy, + beforeUpdate, + afterUpdate, + createEventDispatcher +} from './internal.js'; diff --git a/package-lock.json b/package-lock.json index f2cb89889..82ea06f55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "svelte", - "version": "2.15.1", + "version": "3.0.0-alpha1", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz", - "integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "dev": true, "requires": { - "@babel/highlight": "7.0.0-beta.51" + "@babel/highlight": "^7.0.0" } }, "@babel/generator": { @@ -27,9 +27,9 @@ }, "dependencies": { "jsesc": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", - "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, "source-map": { @@ -70,14 +70,14 @@ } }, "@babel/highlight": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.51.tgz", - "integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", "dev": true, "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", - "js-tokens": "^3.0.0" + "js-tokens": "^4.0.0" } }, "@babel/parser": { @@ -96,6 +96,34 @@ "@babel/parser": "7.0.0-beta.51", "@babel/types": "7.0.0-beta.51", "lodash": "^4.17.5" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz", + "integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.51" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.51.tgz", + "integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + } } }, "@babel/traverse": { @@ -114,6 +142,43 @@ "globals": "^11.1.0", "invariant": "^2.2.0", "lodash": "^4.17.5" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz", + "integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.51" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.51.tgz", + "integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + } } }, "@babel/types": { @@ -128,9 +193,9 @@ } }, "@types/estree": { - "version": "0.0.38", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.38.tgz", - "integrity": "sha512-F/v7t1LwS4vnXuPooJQGBRKRGIoxWUTmA4VHfqjOccFsNDThD5bfUNpITive6s352O7o384wcpEaDV8rHCehDA==", + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, "@types/mocha": { @@ -140,9 +205,9 @@ "dev": true }, "@types/node": { - "version": "10.5.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.6.tgz", - "integrity": "sha512-c5Z1j1ysgo4878ptz6gxLcgMfJ6Wf908R3l5KAGabr0XJ72ZFmOCgsaodPpNYTfp4iOrSwgTDvR/BxbFfB4zPQ==", + "version": "10.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.12.tgz", + "integrity": "sha512-Pr+6JRiKkfsFvmU/LK68oBRCQeEg36TyAbPhc2xpez24OOZZCuoIhWGTd39VZy6nGafSbxzGouFPTFD/rR1A0A==", "dev": true }, "abab": { @@ -152,9 +217,9 @@ "dev": true }, "acorn": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", - "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", "dev": true }, "acorn-dynamic-import": { @@ -167,22 +232,34 @@ } }, "acorn-globals": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz", - "integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", + "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", "dev": true, "requires": { - "acorn": "^5.0.0" + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", + "dev": true + } } }, "acorn-jsx": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz", - "integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==", - "dev": true, - "requires": { - "acorn": "^5.0.3" - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "dev": true + }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "dev": true }, "agadoo": { "version": "1.0.1", @@ -194,12 +271,6 @@ "rollup-plugin-virtual": "^1.0.1" }, "dependencies": { - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, "rollup": { "version": "0.64.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.64.1.tgz", @@ -213,33 +284,27 @@ } }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.1.tgz", + "integrity": "sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "ajv-keywords": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", - "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", - "dev": true - }, "ansi-escapes": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "ansi-styles": { @@ -291,9 +356,15 @@ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, "array-equal": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, @@ -303,21 +374,6 @@ "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, "array-unique": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", @@ -345,6 +401,18 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", @@ -363,6 +431,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -370,78 +444,97 @@ "dev": true }, "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "kind-of": "^6.0.0" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "kind-of": "^6.0.0" } }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, - "optional": true, "requires": { "tweetnacl": "^0.14.3" } }, "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", + "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", "dev": true }, "brace-expansion": { @@ -466,9 +559,9 @@ } }, "browser-process-hrtime": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", - "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", + "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", "dev": true }, "browser-stdout": { @@ -478,38 +571,19 @@ "dev": true }, "buble": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/buble/-/buble-0.19.3.tgz", - "integrity": "sha512-3B0Lcy2u6x6km0BqTz/FS3UnrOJlnIlBWsyjvtqzdtmWkqiS0+Sg4hc6L9Mmm63hZKTACpYS9vUeIoKSi1vcrQ==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/buble/-/buble-0.19.6.tgz", + "integrity": "sha512-9kViM6nJA1Q548Jrd06x0geh+BG2ru2+RMDkIHHgJY/8AcyCs34lTHwra9BX7YdPrZXd5aarkpr/SY8bmPgPdg==", "dev": true, "requires": { - "acorn": "^5.4.1", - "acorn-dynamic-import": "^3.0.0", - "acorn-jsx": "^4.1.1", - "chalk": "^2.3.1", - "magic-string": "^0.22.4", + "chalk": "^2.4.1", + "magic-string": "^0.25.1", "minimist": "^1.2.0", "os-homedir": "^1.0.1", + "regexpu-core": "^4.2.0", "vlq": "^1.0.0" }, "dependencies": { - "magic-string": { - "version": "0.22.5", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", - "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", - "dev": true, - "requires": { - "vlq": "^0.2.2" - }, - "dependencies": { - "vlq": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", - "dev": true - } - } - }, "minimist": { "version": "1.2.0", "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", @@ -530,6 +604,31 @@ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", @@ -541,7 +640,7 @@ }, "callsites": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, @@ -553,7 +652,7 @@ }, "camelcase-keys": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { @@ -579,9 +678,9 @@ } }, "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "chokidar": { @@ -607,6 +706,35 @@ "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", @@ -628,12 +756,6 @@ "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -641,36 +763,47 @@ "dev": true }, "codecov": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.4.tgz", - "integrity": "sha512-KJyzHdg9B8U9LxXa7hS6jnEW5b1cNckLYc2YpnJ1nEFiOW+/iSzDHp+5MYEIQd9fN3/tC6WmGZmYiwxzkuGp/A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.1.0.tgz", + "integrity": "sha512-aWQc/rtHbcWEQLka6WmBAOpV58J2TwyXqlpAQGhQaSiEUoigTTUk6lLd2vB3kXkhnDyzyH74RXfmV4dq2txmdA==", "dev": true, "requires": { "argv": "^0.0.2", "ignore-walk": "^3.0.1", + "js-yaml": "^3.12.0", "request": "^2.87.0", "urlgrey": "^0.4.4" } }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, "color-convert": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", - "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { - "color-name": "1.1.1" + "color-name": "1.1.3" } }, "color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "dev": true, "requires": { "delayed-stream": "~1.0.0" @@ -688,6 +821,12 @@ "integrity": "sha1-Htwfk2h/2XoyXFn1XkWgfbEGrKY=", "dev": true }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -704,20 +843,46 @@ "inherits": "^2.0.3", "readable-stream": "^2.2.2", "typedarray": "^0.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, - "console-group": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/console-group/-/console-group-0.3.3.tgz", - "integrity": "sha1-bY62uda3V6KJUoT2LQnHrUPyu84=", - "dev": true - }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -762,9 +927,9 @@ "dev": true }, "cssstyle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.0.0.tgz", - "integrity": "sha512-Bpuh47j2mRMY60X90mXaJAEtJwxvA2roZzbgwAXYhMbmwmakdRr4Cq9L5SkleKJNLOKqHIa2YWyOXDX3VgggSQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.1.1.tgz", + "integrity": "sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog==", "dev": true, "requires": { "cssom": "0.3.x" @@ -789,31 +954,36 @@ } }, "data-urls": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.0.0.tgz", - "integrity": "sha512-ai40PPQR0Fn1lD2PPie79CibnlMN2AYiDhwFX/rZHVsxbs5kNJSjegqXIprhouGXlRdEnfybva7kqRGnB6mypA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", + "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", "dev": true, "requires": { - "abab": "^1.0.4", - "whatwg-mimetype": "^2.0.0", - "whatwg-url": "^6.4.0" + "abab": "^2.0.0", + "whatwg-mimetype": "^2.2.0", + "whatwg-url": "^7.0.0" }, "dependencies": { - "abab": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", - "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", - "dev": true + "whatwg-url": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", + "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } } } }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "decamelize": { @@ -822,21 +992,19 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, "deep-defaults": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/deep-defaults/-/deep-defaults-1.0.4.tgz", - "integrity": "sha1-Gpdi4rbI1qTpkxuO5/+M3O4dF1A=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/deep-defaults/-/deep-defaults-1.0.5.tgz", + "integrity": "sha512-5ev/sNkiHTmeTqbDJEDgdQa/Ub0eOMQNix9l+dLLGbwOos7/in5HdvHXI014wqxsET4YeJG9Eq4qj0PJRL8rSw==", "dev": true, "requires": { - "lodash": "3.0.x" - }, - "dependencies": { - "lodash": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/lodash/-/lodash-3.0.1.tgz", - "integrity": "sha1-FNSQKKOLx0AkHRHi7NV+wG1zwZo=", - "dev": true - } + "lodash": "^4.17.5" } }, "deep-extend": { @@ -860,47 +1028,75 @@ "clone": "^1.0.2" } }, - "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", - "dev": true, - "requires": { - "foreach": "^2.0.5", - "object-keys": "^1.0.8" - } - }, - "del": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", - "dev": true, - "requires": { - "globby": "^5.0.0", - "is-path-cwd": "^1.0.0", - "is-path-in-cwd": "^1.0.0", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "rimraf": "^2.2.8" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -918,16 +1114,16 @@ "dependencies": { "domelementtype": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", "dev": true } } }, "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", "dev": true }, "domexception": { @@ -963,16 +1159,15 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, - "optional": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" } }, "electron": { - "version": "1.8.7", - "resolved": "https://registry.npmjs.org/electron/-/electron-1.8.7.tgz", - "integrity": "sha512-q6dn8bspX8u8z6tNU4bEas6ZrdNavnrjJ6d/oz49Nb4zFIPrdh8p29AFjFlSAavypGwAVR/PhYOAGwzZSQSSVQ==", + "version": "1.8.8", + "resolved": "https://registry.npmjs.org/electron/-/electron-1.8.8.tgz", + "integrity": "sha512-1f9zJehcTTGjrkb06o6ds+gsRq6SYhZJyxOk6zIWjRH8hVy03y/RzUDELzNas71f5vcvXmfGVvyjeEsadDI8tg==", "dev": true, "requires": { "@types/node": "^8.0.24", @@ -981,9 +1176,9 @@ }, "dependencies": { "@types/node": { - "version": "8.10.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.23.tgz", - "integrity": "sha512-aEp5ZTLr4mYhR9S85cJ+sEYkcsgFY10N1Si5m49iTAVzanZXOwp/pgw6ibFLKXxpflqm71aSWZCRtnTXXO56gA==", + "version": "8.10.38", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.38.tgz", + "integrity": "sha512-EibsnbJerd0hBFaDjJStFrVbVBAtOy4dgL8zZFw0uOvPqzBAX59Ci8cgjg3+RgJIWhsB5A4c+pi+D4P9tQQh/A==", "dev": true } } @@ -1019,6 +1214,12 @@ "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -1040,9 +1241,9 @@ } }, "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", "dev": true }, "error-ex": { @@ -1054,34 +1255,10 @@ "is-arrayish": "^0.2.1" } }, - "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.1.1", - "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" - } - }, - "es-to-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", - "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", - "dev": true, - "requires": { - "is-callable": "^1.1.1", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.1" - } - }, "es6-promise": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", - "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", + "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==", "dev": true }, "escape-string-regexp": { @@ -1112,32 +1289,31 @@ } }, "eslint": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.3.0.tgz", - "integrity": "sha512-N/tCqlMKkyNvAvLu+zI9AqDasnSLt00K+Hu8kdsERliC9jYEc8ck12XtjvOXrBKu8fK6RrBcN9bat6Xk++9jAg==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.10.0.tgz", + "integrity": "sha512-HpqzC+BHULKlnPwWae9MaVZ5AXJKpkxCVXQHrFaRw3hbDj26V/9ArYM4Rr/SQ8pi6qUPLXSSXC4RBJlyq2Z2OQ==", "dev": true, "requires": { - "ajv": "^6.5.0", - "babel-code-frame": "^6.26.0", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", - "debug": "^3.1.0", + "debug": "^4.0.1", "doctrine": "^2.1.0", "eslint-scope": "^4.0.0", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", - "espree": "^4.0.0", + "espree": "^5.0.0", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^2.0.0", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", - "ignore": "^4.0.2", + "ignore": "^4.0.6", "imurmurhash": "^0.1.4", - "inquirer": "^5.2.0", - "is-resolvable": "^1.1.0", - "js-yaml": "^3.11.0", + "inquirer": "^6.1.0", + "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", "lodash": "^4.17.5", @@ -1148,40 +1324,13 @@ "path-is-inside": "^1.0.2", "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^2.0.0", + "regexpp": "^2.0.1", "require-uncached": "^1.0.3", - "semver": "^5.5.0", - "string.prototype.matchall": "^2.0.0", + "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", - "table": "^4.0.3", + "table": "^5.0.2", "text-table": "^0.2.0" - }, - "dependencies": { - "ajv": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", - "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.1" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } } }, "eslint-import-resolver-node": { @@ -1202,6 +1351,12 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -1223,22 +1378,28 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, "eslint-plugin-html": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-4.0.5.tgz", - "integrity": "sha512-yULqYldzhYXTwZEaJXM30HhfgJdtTzuVH3LeoANybESHZ5+2ztLD72BsB2wR124/kk/PvQqZofDFSdNIk+kykw==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-4.0.6.tgz", + "integrity": "sha512-nj6A9oK+7BKnMm0E7dMRH3r75BfpkXtcVIb3pFC4AcDdBTNyg2NGxHXyFNT1emW4VsR7P2SZvRXXQtUR+kY08w==", "dev": true, "requires": { "htmlparser2": "^3.8.2" } }, "eslint-plugin-import": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.13.0.tgz", - "integrity": "sha512-t6hGKQDMIt9N8R7vLepsYXgDfeuhp6ZJSgtrLEDxonpSubyxUZHjhm6LsAaZX8q6GYVxkbT3kTsV9G5mBCFR6A==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz", + "integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==", "dev": true, "requires": { "contains-path": "^0.1.0", @@ -1264,13 +1425,19 @@ }, "doctrine": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "resolved": "http://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { "esutils": "^2.0.2", "isarray": "^1.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -1297,13 +1464,22 @@ "dev": true }, "espree": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-4.0.0.tgz", - "integrity": "sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", + "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", "dev": true, "requires": { - "acorn": "^5.6.0", - "acorn-jsx": "^4.1.1" + "acorn": "^6.0.2", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + }, + "dependencies": { + "acorn": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", + "dev": true + } } }, "esprima": { @@ -1337,9 +1513,9 @@ "dev": true }, "estree-walker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz", + "integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==", "dev": true }, "esutils": { @@ -1359,7 +1535,7 @@ }, "expand-range": { "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { @@ -1372,14 +1548,35 @@ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", "dev": true, "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, @@ -1412,6 +1609,12 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -1422,9 +1625,9 @@ "dev": true }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, "fast-json-stable-stringify": { @@ -1497,14 +1700,14 @@ } }, "flat-cache": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", - "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", + "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", "dev": true, "requires": { "circular-json": "^0.3.1", - "del": "^2.0.2", "graceful-fs": "^4.1.2", + "rimraf": "~2.6.2", "write": "^0.2.1" } }, @@ -1523,12 +1726,6 @@ "for-in": "^1.0.1" } }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -1536,19 +1733,28 @@ "dev": true }, "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" } }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, "fs-extra": { "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "dev": true, "requires": { @@ -2118,6 +2324,12 @@ "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", "dev": true }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -2128,9 +2340,9 @@ } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -2161,9 +2373,9 @@ } }, "globals": { - "version": "11.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", - "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", + "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", "dev": true }, "globalyzer": { @@ -2172,20 +2384,6 @@ "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", "dev": true }, - "globby": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "globrex": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.1.tgz", @@ -2193,9 +2391,9 @@ "dev": true }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, "growl": { @@ -2211,12 +2409,12 @@ "dev": true }, "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "dev": true, "requires": { - "ajv": "^5.1.0", + "ajv": "^6.5.5", "har-schema": "^2.0.0" } }, @@ -2229,26 +2427,71 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "has-symbols": { + "has-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } }, "he": { "version": "1.1.1", @@ -2278,9 +2521,9 @@ } }, "htmlparser2": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", - "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz", + "integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==", "dev": true, "requires": { "domelementtype": "^1.3.0", @@ -2288,7 +2531,7 @@ "domutils": "^1.5.1", "entities": "^1.1.1", "inherits": "^2.0.1", - "readable-stream": "^2.0.2" + "readable-stream": "^3.0.6" } }, "http-signature": { @@ -2303,18 +2546,18 @@ } }, "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" } }, "ignore": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.3.tgz", - "integrity": "sha512-Z/vAH2GGIEATQnBVXMclE2IGV6i0GyVngKThcGZ5kHgHMxLo9Ow2+XHRq1aEKEej5vOF1TPJNbvX6J/anT0M7A==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, "ignore-walk": { @@ -2364,24 +2607,41 @@ "dev": true }, "inquirer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", - "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz", + "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", "chalk": "^2.0.0", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.1.0", + "external-editor": "^3.0.0", "figures": "^2.0.0", - "lodash": "^4.3.0", + "lodash": "^4.17.10", "mute-stream": "0.0.7", "run-async": "^2.2.0", - "rxjs": "^5.5.2", + "rxjs": "^6.1.0", "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", + "strip-ansi": "^5.0.0", "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "dev": true + }, + "strip-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "dev": true, + "requires": { + "ansi-regex": "^4.0.0" + } + } } }, "interpret": { @@ -2399,6 +2659,15 @@ "loose-envify": "^1.0.0" } }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -2422,24 +2691,40 @@ }, "is-builtin-module": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { "builtin-modules": "^1.0.0" } }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } }, "is-dotfile": { "version": "1.0.3", @@ -2507,28 +2792,21 @@ "kind-of": "^3.0.2" } }, - "is-path-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", - "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", - "dev": true, - "requires": { - "is-path-inside": "^1.0.0" - } - }, - "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "path-is-inside": "^1.0.1" + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } } }, "is-posix-bracket": { @@ -2556,29 +2834,16 @@ "dev": true, "requires": { "@types/estree": "0.0.38" + }, + "dependencies": { + "@types/estree": { + "version": "0.0.38", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.38.tgz", + "integrity": "sha512-F/v7t1LwS4vnXuPooJQGBRKRGIoxWUTmA4VHfqjOccFsNDThD5bfUNpITive6s352O7o384wcpEaDV8rHCehDA==", + "dev": true + } } }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, - "is-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", - "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", - "dev": true - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -2591,6 +2856,12 @@ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -2640,9 +2911,9 @@ } }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { @@ -2659,8 +2930,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true + "dev": true }, "jsdom": { "version": "11.12.0", @@ -2698,7 +2968,7 @@ }, "jsesc": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true }, @@ -2709,9 +2979,9 @@ "dev": true }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { @@ -2772,9 +3042,9 @@ } }, "kleur": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.1.tgz", - "integrity": "sha512-Zq/jyANIJ2uX8UZjWlqLwbyhcxSXJtT/Y89lClyeZd3l++3ztL1I5SSCYrbcbwSunTjC88N3WuMk0kRDQD6gzA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.1.tgz", + "integrity": "sha512-P3kRv+B+Ra070ng2VKQqW4qW7gd/v3iD8sy/zOdcYRsfiD+QBokQNOps/AfP6Hr48cBhIIBFWckB9aO+IZhrWg==", "dev": true }, "left-pad": { @@ -2795,7 +3065,7 @@ }, "load-json-file": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { @@ -2830,9 +3100,9 @@ } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, "lodash.sortby": { @@ -2861,18 +3131,24 @@ } }, "magic-string": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.0.tgz", - "integrity": "sha512-Msbwa9oNYNPjwVh9ury5X2BHbTFWoirTlzuf4X+pIoSOQVKNRJHXTx1WmKYuXzRM4QZFv8dGXyZvhDMmWhGLPw==", + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.1.tgz", + "integrity": "sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg==", "dev": true, "requires": { "sourcemap-codec": "^1.4.1" } }, "make-error": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz", - "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "dev": true + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, "map-obj": { @@ -2881,6 +3157,15 @@ "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", "dev": true }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, "math-random": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", @@ -2888,14 +3173,14 @@ "dev": true }, "mdn-data": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz", - "integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.2.0.tgz", + "integrity": "sha512-esDqNvsJB2q5V28+u7NdtdMg6Rmg4khQmAVSjUiX7BY/7haIv0K2yWM43hYp0or+3nvG7+UaTF1JHz31hgU1TA==", "dev": true }, "meow": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { @@ -2913,7 +3198,7 @@ "dependencies": { "load-json-file": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { @@ -2995,18 +3280,18 @@ } }, "mime-db": { - "version": "1.35.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", - "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==", + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", "dev": true }, "mime-types": { - "version": "2.1.19", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", - "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", "dev": true, "requires": { - "mime-db": "~1.35.0" + "mime-db": "~1.37.0" } }, "mimic-fn": { @@ -3050,6 +3335,27 @@ } } }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -3076,6 +3382,46 @@ "minimatch": "3.0.4", "mkdirp": "0.5.1", "supports-color": "5.4.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "mri": { @@ -3085,14 +3431,14 @@ "dev": true }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, "multiline": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/multiline/-/multiline-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/multiline/-/multiline-1.0.2.tgz", "integrity": "sha1-abHyX/B00oKJBPJE3dBrfZbvbJM=", "dev": true, "requires": { @@ -3106,12 +3452,51 @@ "dev": true }, "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", + "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", "dev": true, "optional": true }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3119,9 +3504,9 @@ "dev": true }, "nice-try": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", - "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "nightmare": { @@ -3154,17 +3539,40 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, "node-resolve": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/node-resolve/-/node-resolve-1.3.3.tgz", - "integrity": "sha1-dMf10zc+S7L2AYLjqW3eD4qssM4=", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/node-resolve/-/node-resolve-1.3.4.tgz", + "integrity": "sha512-yQ8Qn3GGR4cyunvggEHg7fb37V/6atft1K/xU6b2OEfJDbi8zbRSNIKxClzJszAV6tjtYyZt1vHlBgdORMcPXg==", "dev": true, "requires": { - "is-builtin-module": "^1.0.0", + "is-builtin-module": "^3.0.0", "lodash": "^4.13.1" + }, + "dependencies": { + "builtin-modules": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz", + "integrity": "sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==", + "dev": true + }, + "is-builtin-module": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.0.0.tgz", + "integrity": "sha512-/93sDihsAD652hrMEbJGbMAVBf1qc96kyThHQ0CAOONHaE3aROLpTjDe4WQ5aoC5ITHFxEq1z8XqSU7km+8amw==", + "dev": true, + "requires": { + "builtin-modules": "^3.0.0" + } + } } }, "normalize-package-data": { @@ -3217,6 +3625,12 @@ "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -3227,9 +3641,9 @@ "dev": true }, "nwsapi": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.8.tgz", - "integrity": "sha512-7RZ+qbFGiVc6v14Y8DSZjPN1wZPOaMbiiP4tzf5eNuyOITAeOIA3cMhjuKUypVIqBgCSg1KaSyAv8Ocq/0ZJ1A==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.9.tgz", + "integrity": "sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ==", "dev": true }, "nyc": { @@ -5286,9 +5700,9 @@ } }, "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, "object-assign": { @@ -5297,12 +5711,51 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", "dev": true }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -5313,6 +5766,23 @@ "is-extendable": "^0.1.1" } }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -5347,13 +5817,13 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -5417,6 +5887,12 @@ "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", "dev": true }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", @@ -5428,7 +5904,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, @@ -5445,9 +5921,9 @@ "dev": true }, "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-type": { @@ -5473,7 +5949,7 @@ }, "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, @@ -5513,6 +5989,12 @@ "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", "dev": true }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -5526,14 +6008,14 @@ "dev": true }, "prettier": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.0.tgz", - "integrity": "sha512-KtQ2EGaUwf2EyDfp1fxyEb0PqGKakVm0WyXwDt6u+cAoxbO2Z2CwKvOe3+b4+F2IlO9lYHi1kqFuRM70ddBnow==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.15.3.tgz", + "integrity": "sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg==", "dev": true }, "pretty-bytes": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "resolved": "http://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", "dev": true, "requires": { @@ -5548,9 +6030,9 @@ "dev": true }, "progress": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", - "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "progress-stream": { @@ -5563,10 +6045,16 @@ "through2": "~0.2.3" } }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true + }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "qs": { @@ -5576,9 +6064,9 @@ "dev": true }, "randomatic": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", - "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", "dev": true, "requires": { "is-number": "^4.0.0", @@ -5653,141 +6141,496 @@ } }, "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.0.6.tgz", + "integrity": "sha512-9E1oLoOWfhSXHGv6QlwXJim7uNzd9EVlWK+21tCU9Ju/kR0/p2AZYPz4qSchgO8PlLIH4FpZYfzwS+rEksZjIg==", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "regexp.prototype.flags": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", - "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2" - } - }, - "regexpp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz", - "integrity": "sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA==", - "dev": true - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.87.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", - "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", - "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", - "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "tough-cookie": "~2.3.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" - } - }, - "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "requires": { - "lodash": "^4.13.1" - } - }, - "request-promise-native": { - "version": "1.0.5", + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz", + "integrity": "sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "regexpu-core": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.4.0.tgz", + "integrity": "sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^7.0.0", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.0.2" + } + }, + "regjsgen": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==", + "dev": true + }, + "regjsparser": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "dev": true, + "requires": { + "lodash": "^4.13.1" + } + }, + "request-promise-native": { + "version": "1.0.5", "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", "dev": true, @@ -5805,7 +6648,7 @@ }, "require-uncached": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { @@ -5828,6 +6671,12 @@ "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -5838,6 +6687,12 @@ "signal-exit": "^3.0.2" } }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", @@ -5855,68 +6710,51 @@ "requires": { "@types/estree": "0.0.39", "@types/node": "*" - }, - "dependencies": { - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - } } }, "rollup-plugin-buble": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-buble/-/rollup-plugin-buble-0.19.2.tgz", - "integrity": "sha512-dxK0prR8j/7qhI2EZDz/evKCRuhuZMpRlUGPrRWmpg5/2V8tP1XFW+Uk0WfxyNgFfJHvy0GmxnJSTb5dIaNljQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/rollup-plugin-buble/-/rollup-plugin-buble-0.19.4.tgz", + "integrity": "sha512-mahvTRn9mUVKEUyA5QbrfdybOH7tipHRe4zkKZjEGMB3YSaLW95kHFSB4Vdt7BofyG9r7zMCCmAsEqZKkRaN6A==", "dev": true, "requires": { - "buble": "^0.19.2", - "rollup-pluginutils": "^2.0.1" + "buble": "^0.19.4", + "rollup-pluginutils": "^2.3.3" } }, "rollup-plugin-commonjs": { - "version": "9.1.4", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.1.4.tgz", - "integrity": "sha512-dpPb6QxvEMG35Eat1yFbpVcuYWE33D2LZK8q2BlSWIBpjXiX2uaqCEMf9czqFChFsfewsA2c2eEoROTepEmyng==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz", + "integrity": "sha512-0RM5U4Vd6iHjL6rLvr3lKBwnPsaVml+qxOGaaNUWN1lSq6S33KhITOfHmvxV3z2vy9Mk4t0g4rNlVaJJsNQPWA==", "dev": true, "requires": { - "estree-walker": "^0.5.1", - "magic-string": "^0.22.4", - "resolve": "^1.5.0", - "rollup-pluginutils": "^2.0.1" + "estree-walker": "^0.5.2", + "magic-string": "^0.25.1", + "resolve": "^1.8.1", + "rollup-pluginutils": "^2.3.3" }, "dependencies": { - "magic-string": { - "version": "0.22.5", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", - "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", - "dev": true, - "requires": { - "vlq": "^0.2.2" - } - }, - "vlq": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", "dev": true } } }, "rollup-plugin-json": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-json/-/rollup-plugin-json-3.0.0.tgz", - "integrity": "sha512-WUAV9/I/uFWvHhyRTqFb+3SIapjISFJS7R1xN/cXxWESrfYo9I8ncHI7AxJHflKRXhBVSv7revBVJh2wvhWh5w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-json/-/rollup-plugin-json-3.1.0.tgz", + "integrity": "sha512-BlYk5VspvGpjz7lAwArVzBXR60JK+4EKtPkCHouAWg39obk9S61hZYJDBfMK+oitPdoe11i69TlxKlMQNFC/Uw==", "dev": true, "requires": { - "rollup-pluginutils": "^2.2.0" + "rollup-pluginutils": "^2.3.1" } }, "rollup-plugin-node-resolve": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.3.0.tgz", - "integrity": "sha512-9zHGr3oUJq6G+X0oRMYlzid9fXicBdiydhwGChdyeNRGPcN/majtegApRKHLR5drboUvEWU+QeUmGTyEZQs3WA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.4.0.tgz", + "integrity": "sha512-PJcd85dxfSBWih84ozRtBkB731OjXk0KnzN0oGp7WOWcarAFkVa71cV5hTJg2qpVsV2U8EUwrzHP3tvy9vS3qg==", "dev": true, "requires": { "builtin-modules": "^2.0.0", @@ -5933,36 +6771,19 @@ } }, "rollup-plugin-replace": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.0.0.tgz", - "integrity": "sha512-pK9mTd/FNrhtBxcTBXoh0YOwRIShV0gGhv9qvUtNcXHxIMRZMXqfiZKVBmCRGp8/2DJRy62z2JUE7/5tP6WxOQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.1.0.tgz", + "integrity": "sha512-SxrAIgpH/B5/W4SeULgreOemxcpEgKs2gcD42zXw50bhqGWmcnlXneVInQpAqzA/cIly4bJrOpeelmB9p4YXSQ==", "dev": true, "requires": { - "magic-string": "^0.22.4", + "magic-string": "^0.25.1", "minimatch": "^3.0.2", "rollup-pluginutils": "^2.0.1" - }, - "dependencies": { - "magic-string": { - "version": "0.22.5", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", - "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", - "dev": true, - "requires": { - "vlq": "^0.2.2" - } - }, - "vlq": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", - "dev": true - } } }, "rollup-plugin-typescript": { "version": "0.8.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript/-/rollup-plugin-typescript-0.8.1.tgz", + "resolved": "http://registry.npmjs.org/rollup-plugin-typescript/-/rollup-plugin-typescript-0.8.1.tgz", "integrity": "sha1-L/fuzCHPa7K0P8J+W2iJUs5xkko=", "dev": true, "requires": { @@ -5975,13 +6796,13 @@ "dependencies": { "estree-walker": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz", + "resolved": "http://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz", "integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4=", "dev": true }, "rollup-pluginutils": { "version": "1.5.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz", + "resolved": "http://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz", "integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=", "dev": true, "requires": { @@ -6004,13 +6825,21 @@ "dev": true }, "rollup-pluginutils": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.0.tgz", - "integrity": "sha512-xB6hsRsjdJdIYWEyYUJy/3ki5g69wrf0luHPGNK3ZSocV6HLNfio59l3dZ3TL4xUwEKgROhFi9jOCt6c5gfUWw==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz", + "integrity": "sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==", "dev": true, "requires": { "estree-walker": "^0.5.2", "micromatch": "^2.3.11" + }, + "dependencies": { + "estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "dev": true + } } }, "rollup-watch": { @@ -6034,12 +6863,12 @@ } }, "rxjs": { - "version": "5.5.11", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.11.tgz", - "integrity": "sha512-3bjO7UwWfA2CV7lmwYMBzj4fQ6Cq+ftHc2MvUe+WMS7wcdJ1LosDWmdjPQanYp2dBRj572p7PeU81JUxHKOcBA==", + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", "dev": true, "requires": { - "symbol-observable": "1.0.1" + "tslib": "^1.9.0" } }, "sade": { @@ -6058,6 +6887,15 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "safe-regex": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -6082,16 +6920,33 @@ "dev": true }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } }, "shebang-command": { "version": "1.2.0", @@ -6109,9 +6964,9 @@ "dev": true }, "shelljs": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.2.tgz", - "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", + "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", "dev": true, "requires": { "glob": "^7.0.0", @@ -6134,78 +6989,234 @@ "string-width": "^1.0.1" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "^1.0.0" + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "slice-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.0.0.tgz", + "integrity": "sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" } }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "kind-of": "^6.0.0" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true } } }, - "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0" + "kind-of": "^3.2.0" } }, - "sliced": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", - "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, "source-map-support": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz", - "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, "sourcemap-codec": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz", - "integrity": "sha512-hX1eNBNuilj8yfFnECh0DzLgwKpBLMIvmhgEhixXNui8lMLBInTI8Kyxt++RwJnMNu7cAUo635L2+N1TxMJCzA==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz", + "integrity": "sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==", "dev": true }, "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -6213,9 +7224,9 @@ } }, "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", "dev": true }, "spdx-expression-parse": { @@ -6229,9 +7240,9 @@ } }, "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz", + "integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==", "dev": true }, "speedometer": { @@ -6240,6 +7251,15 @@ "integrity": "sha1-mHbb0qFp0xFUAtSObqYynIgWpQ0=", "dev": true }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, "split2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", @@ -6249,13 +7269,37 @@ "through2": "^2.0.2" }, "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { - "readable-stream": "^2.1.5", + "readable-stream": "~2.3.6", "xtend": "~4.0.1" } }, @@ -6274,9 +7318,9 @@ "dev": true }, "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", + "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -6290,6 +7334,27 @@ "tweetnacl": "~0.14.0" } }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", @@ -6306,23 +7371,10 @@ "strip-ansi": "^4.0.0" } }, - "string.prototype.matchall": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz", - "integrity": "sha512-WoZ+B2ypng1dp4iFLF2kmZlwwlE19gmjgKuhL1FJfDgCREWb3ye3SDVHSzLH6bxfnvYmkCxbzkmWcQZHA4P//Q==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.10.0", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "regexp.prototype.flags": "^1.2.0" - } - }, "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -6335,14 +7387,6 @@ "dev": true, "requires": { "ansi-regex": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - } } }, "strip-bom": { @@ -6384,24 +7428,24 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" } }, - "symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", - "dev": true - }, "symbol-tree": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", @@ -6409,43 +7453,15 @@ "dev": true }, "table": { - "version": "4.0.3", - "resolved": "http://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.1.tgz", + "integrity": "sha512-NUjapYb/qd4PeFW03HnAuOJ7OMcBkJlqeClWxeNlQ0lXGSb52oZXGzkO0/I0ARegQ2eUT1g2VDJH0eUxDRcHmw==", "dev": true, "requires": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", + "ajv": "^6.6.1", + "lodash": "^4.17.11", + "slice-ansi": "2.0.0", "string-width": "^2.1.1" - }, - "dependencies": { - "ajv": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", - "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.1" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } } }, "text-table": { @@ -6462,13 +7478,13 @@ }, "through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, "through2": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz", + "resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz", "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", "dev": true, "requires": { @@ -6484,7 +7500,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -6496,16 +7512,16 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true } } }, "tiny-glob": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.2.tgz", - "integrity": "sha512-o8rak1FRmr55Nd1Bdcfd+yetPGclFCVHXiKmoBHYULc+FQXBbqb9S3zKAWyqk+RdWvutlGUOw0kCHC0JLF/T4Q==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.6.tgz", + "integrity": "sha512-A7ewMqPu1B5PWwC3m7KVgAu96Ch5LA0w4SnEN/LbDREj/gAD0nPWboRbn8YoP9ISZXqeNAlMvKSKoEuhcfK3Pw==", "dev": true, "requires": { "globalyzer": "^0.1.0", @@ -6533,13 +7549,64 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + } + } + }, "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { + "psl": "^1.1.24", "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } } }, "tr46": { @@ -6549,14 +7616,6 @@ "dev": true, "requires": { "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } } }, "trim-newlines": { @@ -6572,9 +7631,9 @@ "dev": true }, "ts-node": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.0.tgz", - "integrity": "sha512-klJsfswHP0FuOLsvBZ/zzCfUvakOSSxds78mVeK7I+qP76YWtxf16hEZsp3U+b0kIo82R5UatGFeblYMqabb2Q==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", + "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", "dev": true, "requires": { "arrify": "^1.0.0", @@ -6614,8 +7673,7 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true + "dev": true }, "type-check": { "version": "0.3.2", @@ -6633,11 +7691,120 @@ "dev": true }, "typescript": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.1.tgz", - "integrity": "sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", + "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==", + "dev": true + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz", + "integrity": "sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ==", "dev": true }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz", + "integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg==", + "dev": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -6645,22 +7812,26 @@ "dev": true, "requires": { "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } } }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, "urlgrey": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=", "dev": true }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -6674,9 +7845,9 @@ "dev": true }, "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -6716,26 +7887,18 @@ "dev": true }, "whatwg-encoding": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz", - "integrity": "sha512-jLBwwKUhi8WtBfsMQlL4bUUcT8sMkAtQinscJAe/M4KHCkHuUJAF6vuB0tueNIw4c8ziO6AkRmgY+jL3a0iiPw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", "dev": true, "requires": { - "iconv-lite": "0.4.19" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true - } + "iconv-lite": "0.4.24" } }, "whatwg-mimetype": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz", - "integrity": "sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", "dev": true }, "whatwg-url": { @@ -6801,14 +7964,6 @@ "dev": true, "requires": { "object-keys": "~0.4.0" - }, - "dependencies": { - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", - "dev": true - } } }, "yauzl": { diff --git a/package.json b/package.json index b2ff4eabe..88dfb3d2a 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,17 @@ { "name": "svelte", - "version": "2.15.4", + "version": "3.0.0-alpha2", "description": "The magical disappearing UI framework", - "main": "compiler/svelte.js", + "main": "index.js", "bin": { "svelte": "svelte" }, "files": [ "cli", - "compiler/*.js", - "ssr/*.js", - "shared.js", - "store.js", - "store.umd.js", - "store.d.ts", + "compiler.js", + "register.js", + "index.js", + "internal.js", "svelte", "README.md" ], @@ -25,11 +23,11 @@ "codecov": "codecov", "precodecov": "npm run coverage", "lint": "eslint src test/*.js", - "build": "node src/shared/_build.js && rollup -c && rollup -c rollup.store.config.js", + "build": "rollup -c", "prepare": "npm run build", - "dev": "node src/shared/_build.js && rollup -c -w", + "dev": "rollup -c -w", "pretest": "npm run build", - "posttest": "agadoo shared.js", + "posttest": "agadoo src/internal/index.js", "prepublishOnly": "npm run lint && npm test", "prettier": "prettier --write \"src/**/*.ts\"" }, @@ -55,17 +53,15 @@ "acorn": "^5.4.1", "acorn-dynamic-import": "^3.0.0", "agadoo": "^1.0.1", - "chalk": "^2.4.0", "codecov": "^3.0.0", - "console-group": "^0.3.2", "css-tree": "1.0.0-alpha22", "eslint": "^5.3.0", "eslint-plugin-html": "^4.0.3", "eslint-plugin-import": "^2.11.0", - "estree-walker": "^0.5.1", + "estree-walker": "^0.6.0", "is-reference": "^1.1.0", "jsdom": "^11.8.0", - "kleur": "^2.0.1", + "kleur": "^3.0.0", "locate-character": "^2.0.5", "magic-string": "^0.25.0", "mocha": "^5.2.0", diff --git a/src/ssr/register.js b/register.js similarity index 79% rename from src/ssr/register.js rename to register.js index fe1fe74c5..cbd4a387a 100644 --- a/src/ssr/register.js +++ b/register.js @@ -1,6 +1,6 @@ -import * as fs from 'fs'; -import * as path from 'path'; -import { compile } from '../index.ts'; +const fs = require('fs'); +const path = require('path'); +const { compile } = require('./compiler.js'); let compileOptions = { extensions: ['.html'] @@ -10,7 +10,7 @@ function capitalise(name) { return name[0].toUpperCase() + name.slice(1); } -export default function register(options) { +function register(options) { if (options.extensions) { compileOptions.extensions.forEach(deregisterExtension); options.extensions.forEach(registerExtension); @@ -33,7 +33,8 @@ function registerExtension(extension) { const options = Object.assign({}, compileOptions, { filename, name: capitalise(name), - generate: 'ssr' + generate: 'ssr', + format: 'cjs' }); const { js } = compile(fs.readFileSync(filename, 'utf-8'), options); @@ -42,4 +43,6 @@ function registerExtension(extension) { }; } -registerExtension('.html'); \ No newline at end of file +registerExtension('.html'); + +module.exports = register; \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js index b83f70ed9..3229a2800 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -20,43 +20,18 @@ export default [ json(), typescript({ include: 'src/**', - exclude: 'src/shared/**', + exclude: 'src/internal/**', typescript: require('typescript') }) ], output: { - file: 'compiler/svelte.js', + file: 'compiler.js', format: 'umd', name: 'svelte', sourcemap: true } }, - /* ssr/register.js */ - { - input: 'src/ssr/register.js', - plugins: [ - resolve(), - commonjs(), - buble({ - include: 'src/**', - exclude: 'src/shared/**', - target: { - node: 4 - } - }) - ], - external: [path.resolve('src/index.ts'), 'fs', 'path'], - output: { - file: 'ssr/register.js', - format: 'cjs', - paths: { - [path.resolve('src/index.ts')]: '../compiler/svelte.js' - }, - sourcemap: true - } - }, - /* cli/*.js */ { input: ['src/cli/index.ts'], @@ -64,7 +39,7 @@ export default [ dir: 'cli', format: 'cjs', paths: { - svelte: '../compiler/svelte.js' + svelte: '../compiler.js' } }, external: ['fs', 'path', 'os', 'svelte'], @@ -79,11 +54,11 @@ export default [ experimentalCodeSplitting: true }, - /* shared.js */ + /* internal.js */ { - input: 'src/shared/index.js', + input: 'src/internal/index.js', output: { - file: 'shared.js', + file: 'internal.js', format: 'es' } } diff --git a/rollup.store.config.js b/rollup.store.config.js deleted file mode 100644 index a3e4f395c..000000000 --- a/rollup.store.config.js +++ /dev/null @@ -1,9 +0,0 @@ -export default { - input: 'store.js', - output: { - file: 'store.umd.js', - format: 'umd', - name: 'svelte', - extend: true - } -}; diff --git a/src/Stats.ts b/src/Stats.ts index 091975974..33f651b2f 100644 --- a/src/Stats.ts +++ b/src/Stats.ts @@ -1,4 +1,4 @@ -import { Node, Warning } from './interfaces'; +import { Warning } from './interfaces'; import Component from './compile/Component'; const now = (typeof process !== 'undefined' && process.hrtime) @@ -96,21 +96,12 @@ export default class Stats { } }); - const hooks: Record = component && { - oncreate: !!component.templateProperties.oncreate, - ondestroy: !!component.templateProperties.ondestroy, - onstate: !!component.templateProperties.onstate, - onupdate: !!component.templateProperties.onupdate - }; - - const computed = new Set(component.computations.map(c => c.key)); - return { - props: Array.from(component.expectedProperties).filter(key => !computed.has(key)), + props: component.props.map(prop => prop.as), timings, warnings: this.warnings, imports, - hooks + templateReferences: component && component.template_references }; } @@ -118,4 +109,4 @@ export default class Stats { this.warnings.push(warning); this.onwarn(warning); } -} \ No newline at end of file +} diff --git a/src/cli/compile.ts b/src/cli/compile.ts index 47141f234..474a31e32 100644 --- a/src/cli/compile.ts +++ b/src/cli/compile.ts @@ -54,8 +54,7 @@ export function compile(input, opts) { immutable: opts.immutable, generate: opts.generate || 'dom', customElement: opts.customElement, - store: opts.store, - shared: opts.shared + sveltePath: opts.sveltePath }; if (isDir) { diff --git a/src/cli/index.ts b/src/cli/index.ts index d3a64e7d5..ca0ed51ca 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -7,7 +7,7 @@ prog .command('compile ') .option('-o, --output', 'Output (if absent, prints to stdout)') - .option('-f, --format', 'Type of output (amd, cjs, es, iife, umd)') + .option('-f, --format', 'Type of output (cjs or esm)', 'esm') .option('-g, --globals', 'Comma-separate list of `module ID:Global` pairs') .option('-n, --name', 'Name for IIFE/UMD export (inferred from filename by default)') .option('-m, --sourcemap', 'Generate sourcemap (`-m inline` for inline map)') diff --git a/src/compile/Component.ts b/src/compile/Component.ts index 4a249d228..bf874bbbe 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -1,161 +1,102 @@ -import { parseExpressionAt } from 'acorn'; import MagicString, { Bundle } from 'magic-string'; -import isReference from 'is-reference'; import { walk, childKeys } from 'estree-walker'; import { getLocator } from 'locate-character'; import Stats from '../Stats'; -import deindent from '../utils/deindent'; import reservedNames from '../utils/reservedNames'; -import namespaces from '../utils/namespaces'; +import { namespaces, validNamespaces } from '../utils/namespaces'; import { removeNode } from '../utils/removeNode'; -import nodeToString from '../utils/nodeToString'; import wrapModule from './wrapModule'; -import annotateWithScopes from '../utils/annotateWithScopes'; -import getName from '../utils/getName'; +import { createScopes, extractNames, Scope } from '../utils/annotateWithScopes'; import Stylesheet from './css/Stylesheet'; import { test } from '../config'; import Fragment from './nodes/Fragment'; -import shared from './shared'; -import { Node, ShorthandImport, Ast, CompileOptions, CustomElementOptions } from '../interfaces'; +import * as internal from '../internal/index'; +import { Node, Ast, CompileOptions } from '../interfaces'; import error from '../utils/error'; import getCodeFrame from '../utils/getCodeFrame'; -import checkForComputedKeys from './validate/js/utils/checkForComputedKeys'; -import checkForDupes from './validate/js/utils/checkForDupes'; -import propValidators from './validate/js/propValidators'; -import fuzzymatch from './validate/utils/fuzzymatch'; import flattenReference from '../utils/flattenReference'; +import addToSet from '../utils/addToSet'; +import isReference from 'is-reference'; +import TemplateScope from './nodes/shared/TemplateScope'; +import fuzzymatch from '../utils/fuzzymatch'; +import { remove_indentation, add_indentation } from '../utils/indentation'; +import getObject from '../utils/getObject'; +import deindent from '../utils/deindent'; +import globalWhitelist from '../utils/globalWhitelist'; -interface Computation { - key: string; - deps: string[]; - hasRestParam: boolean; -} - -interface Declaration { - type: string; - name: string; - node: Node; - block: string; -} - -function detectIndentation(str: string) { - const pattern = /^[\t\s]{1,4}/gm; - let match; - - while (match = pattern.exec(str)) { - if (match[0][0] === '\t') return '\t'; - if (match[0].length === 2) return ' '; - } - - return ' '; -} - -function getIndentationLevel(str: string, b: number) { - let a = b; - while (a > 0 && str[a - 1] !== '\n') a -= 1; - return /^\s*/.exec(str.slice(a, b))[0]; -} - -function getIndentExclusionRanges(node: Node) { - // TODO can we fold this into a different pass? - const ranges: Node[] = []; - walk(node, { - enter(node: Node) { - if (node.type === 'TemplateElement') ranges.push(node); - } - }); - return ranges; -} - -function removeIndentation( - code: MagicString, - start: number, - end: number, - indentationLevel: string, - ranges: Node[] -) { - const str = code.original.slice(start, end); - const pattern = new RegExp(`^${indentationLevel}`, 'gm'); - let match; - - while (match = pattern.exec(str)) { - // TODO bail if we're inside an exclusion range - code.remove(start + match.index, start + match.index + indentationLevel.length); - } -} +type Meta = { + namespace?: string; + tag?: string; + immutable?: boolean; + props?: string; + props_object?: string; +}; // We need to tell estree-walker that it should always // look for an `else` block, otherwise it might get // the wrong idea about the shape of each/if blocks childKeys.EachBlock = childKeys.IfBlock = ['children', 'else']; childKeys.Attribute = ['value']; +childKeys.ExportNamedDeclaration = ['declaration', 'specifiers']; export default class Component { stats: Stats; ast: Ast; source: string; + code: MagicString; name: string; options: CompileOptions; fragment: Fragment; + module_scope: Scope; + instance_scope: Scope; + instance_scope_map: WeakMap; - customElement: CustomElementOptions; - tag: string; - props: string[]; - - properties: Map; - - defaultExport: Node; - imports: Node[]; - shorthandImports: ShorthandImport[]; - helpers: Set; - components: Set; - events: Set; - methods: Set; - animations: Set; - transitions: Set; - actions: Set; - importedComponents: Map; + meta: Meta; namespace: string; - hasComponents: boolean; - computations: Computation[]; - templateProperties: Record; - javascript: [string, string]; - - used: { - components: Set; - helpers: Set; - events: Set; - animations: Set; - transitions: Set; - actions: Set; - }; - - declarations: Declaration[]; - - refCallees: Node[]; - - code: MagicString; + tag: string; - indirectDependencies: Map>; - expectedProperties: Set; - refs: Set; + instance_script: Node; + module_script: Node; + + imports: Node[] = []; + module_javascript: string; + javascript: string; + + declarations: string[] = []; + props: Array<{ name: string, as: string }> = []; + writable_declarations: Set = new Set(); + initialised_declarations: Set = new Set(); + imported_declarations: Set = new Set(); + hoistable_names: Set = new Set(); + hoistable_nodes: Set = new Set(); + node_for_declaration: Map = new Map(); + module_exports: Array<{ name: string, as: string }> = []; + partly_hoisted: string[] = []; + fully_hoisted: string[] = []; + reactive_declarations: Array<{ assignees: Set, dependencies: Set, snippet: string }> = []; + reactive_declaration_nodes: Set = new Set(); + has_reactive_assignments = false; + + indirectDependencies: Map> = new Map(); + template_references: Set = new Set(); + refs: Set = new Set(); file: string; locate: (c: number) => { line: number, column: number }; - stylesheet: Stylesheet; - - userVars: Set; - templateVars: Map; - aliases: Map; - usedNames: Set; - + // TODO this does the same as component.locate! remove one or the other locator: (search: number, startIndex?: number) => { line: number, column: number }; + stylesheet: Stylesheet; + + userVars: Set = new Set(); + aliases: Map = new Map(); + usedNames: Set = new Set(); + constructor( ast: Ast, source: string, @@ -163,130 +104,79 @@ export default class Component { options: CompileOptions, stats: Stats ) { - this.stats = stats; + this.name = this.getUniqueName(name); + this.stats = stats; this.ast = ast; this.source = source; this.options = options; - this.imports = []; - this.shorthandImports = []; - this.helpers = new Set(); - this.components = new Set(); - this.events = new Set(); - this.methods = new Set(); - this.animations = new Set(); - this.transitions = new Set(); - this.actions = new Set(); - this.importedComponents = new Map(); - - this.used = { - components: new Set(), - helpers: new Set(), - events: new Set(), - animations: new Set(), - transitions: new Set(), - actions: new Set(), - }; - - this.declarations = []; - - this.refs = new Set(); - this.refCallees = []; - - this.indirectDependencies = new Map(); - this.file = options.filename && ( typeof process !== 'undefined' ? options.filename.replace(process.cwd(), '').replace(/^[\/\\]/, '') : options.filename ); this.locate = getLocator(this.source); - // track which properties are needed, so we can provide useful info - // in dev mode - this.expectedProperties = new Set(); - this.code = new MagicString(source); // styles this.stylesheet = new Stylesheet(source, ast, options.filename, options.dev); this.stylesheet.validate(this); - // allow compiler to deconflict user's `import { get } from 'whatever'` and - // Svelte's builtin `import { get, ... } from 'svelte/shared.ts'`; - this.userVars = new Set(); - this.templateVars = new Map(); - this.aliases = new Map(); - this.usedNames = new Set(); + const module_scripts = ast.js.filter(script => this.get_context(script) === 'module'); + const instance_scripts = ast.js.filter(script => this.get_context(script) === 'default'); - this.computations = []; - this.templateProperties = {}; - this.properties = new Map(); + if (module_scripts.length > 1) { + this.error(module_scripts[1], { + code: `invalid-script`, + message: `A component can only have one \ No newline at end of file +

Hello world!

\ No newline at end of file diff --git a/test/cli/samples/dir-sourcemap/src/Main.html b/test/cli/samples/dir-sourcemap/src/Main.html index 0f123bb0c..cbcde3f1e 100644 --- a/test/cli/samples/dir-sourcemap/src/Main.html +++ b/test/cli/samples/dir-sourcemap/src/Main.html @@ -1,11 +1,5 @@ - - - export default { - components: { - Widget - } - }; - \ No newline at end of file + \ No newline at end of file diff --git a/test/cli/samples/dir-subdir/src/Main.html b/test/cli/samples/dir-subdir/src/Main.html index 01fdc800d..89391562d 100644 --- a/test/cli/samples/dir-subdir/src/Main.html +++ b/test/cli/samples/dir-subdir/src/Main.html @@ -1,11 +1,5 @@ - - - export default { - components: { - Widget - } - }; - \ No newline at end of file + \ No newline at end of file diff --git a/test/cli/samples/dir/src/Main.html b/test/cli/samples/dir/src/Main.html index 0f123bb0c..cbcde3f1e 100644 --- a/test/cli/samples/dir/src/Main.html +++ b/test/cli/samples/dir/src/Main.html @@ -1,11 +1,5 @@ - - - export default { - components: { - Widget - } - }; - \ No newline at end of file + \ No newline at end of file diff --git a/test/cli/samples/globals/src/Main.html b/test/cli/samples/globals/src/Main.html index 053f2ec0f..2fc0383a6 100644 --- a/test/cli/samples/globals/src/Main.html +++ b/test/cli/samples/globals/src/Main.html @@ -1,13 +1,5 @@ -

The answer is {answer}

- - export default { - data: function () { - return { - answer: answer - }; - } - }; - \ No newline at end of file +

The answer is {answer}

\ No newline at end of file diff --git a/test/cli/samples/sourcemap-inline/src/Main.html b/test/cli/samples/sourcemap-inline/src/Main.html index 944b54efb..6f3f80bbf 100644 --- a/test/cli/samples/sourcemap-inline/src/Main.html +++ b/test/cli/samples/sourcemap-inline/src/Main.html @@ -1,9 +1,9 @@ -

Hello world!

- \ No newline at end of file + import { onMount } from 'svelte'; + + onMount(() => { + console.log('here'); + }); + + +

Hello world!

\ No newline at end of file diff --git a/test/cli/samples/sourcemap/src/Main.html b/test/cli/samples/sourcemap/src/Main.html index 944b54efb..6f3f80bbf 100644 --- a/test/cli/samples/sourcemap/src/Main.html +++ b/test/cli/samples/sourcemap/src/Main.html @@ -1,9 +1,9 @@ -

Hello world!

- \ No newline at end of file + import { onMount } from 'svelte'; + + onMount(() => { + console.log('here'); + }); + + +

Hello world!

\ No newline at end of file diff --git a/test/create/index.js b/test/create/index.js deleted file mode 100644 index cb4beb623..000000000 --- a/test/create/index.js +++ /dev/null @@ -1,39 +0,0 @@ -import assert from "assert"; -import { svelte, deindent } from "../helpers.js"; - -describe("create", () => { - it("should return a component constructor", () => { - const source = deindent` -
{prop}
- `; - - const component = svelte.create(source); - assert(component instanceof Function); - }); - - it("should throw error when source is invalid ", done => { - const source = deindent` -
{prop
- `; - - const component = svelte.create(source, { - onerror: () => { - done(); - } - }); - - assert.equal(component, undefined); - }); - - it("should return undefined when source is invalid ", () => { - const source = deindent` -
{prop
- `; - - const component = svelte.create(source, { - onerror: () => {} - }); - - assert.equal(component, undefined); - }); -}); diff --git a/test/css/index.js b/test/css/index.js index 8af76f61c..237721daf 100644 --- a/test/css/index.js +++ b/test/css/index.js @@ -1,7 +1,6 @@ -import assert from 'assert'; +import * as assert from 'assert'; import * as fs from 'fs'; -import { parse } from 'acorn'; -import { addLineNumbers, env, normalizeHtml, svelte } from '../helpers.js'; +import { env, normalizeHtml, svelte } from '../helpers.js'; function tryRequire(file) { try { @@ -23,13 +22,18 @@ function normalizeWarning(warning) { return warning; } -function checkCodeIsValid(code) { - try { - parse(code); - } catch (err) { - console.error(addLineNumbers(code)); - throw new Error(err.message); - } +function create(code) { + const fn = new Function('module', 'exports', 'require', code); + + const module = { exports: {} }; + fn(module, module.exports, id => { + if (id === 'svelte') return require('../../index.js'); + if (id.startsWith('svelte/')) return require(id.replace('svelte', '../../')); + + return require(id); + }); + + return module.exports.default; } describe('css', () => { @@ -57,7 +61,7 @@ describe('css', () => { const dom = svelte.compile( input, Object.assign(config, { - format: 'iife', + format: 'cjs', name: 'SvelteComponent', onwarn: warning => { domWarnings.push(warning); @@ -68,7 +72,7 @@ describe('css', () => { const ssr = svelte.compile( input, Object.assign(config, { - format: 'iife', + format: 'cjs', generate: 'ssr', name: 'SvelteComponent', onwarn: warning => { @@ -77,10 +81,6 @@ describe('css', () => { }) ); - // check the code is valid - checkCodeIsValid(dom.js.code); - checkCodeIsValid(ssr.js.code); - assert.equal(dom.css.code, ssr.css.code); assert.deepEqual( @@ -97,18 +97,20 @@ describe('css', () => { assert.equal(dom.css.code.replace(/svelte(-ref)?-[a-z0-9]+/g, (m, $1) => $1 ? m : 'svelte-xyz'), expected.css); + // we do this here, rather than in the expected.html !== null + // block, to verify that valid code was generated + const ClientComponent = create(dom.js.code); + const ServerComponent = create(ssr.js.code); + // verify that the right elements have scoping selectors if (expected.html !== null) { const window = env(); // dom try { - const Component = eval( - `(function () { ${dom.js.code}; return SvelteComponent; }())` - ); const target = window.document.querySelector('main'); - new Component({ target, data: config.data }); + new ClientComponent({ target, props: config.props }); const html = target.innerHTML; fs.writeFileSync(`test/css/samples/${dir}/_actual.html`, html); @@ -126,14 +128,10 @@ describe('css', () => { // ssr try { - const component = eval( - `(function () { ${ssr.js.code}; return SvelteComponent; }())` - ); - assert.equal( normalizeHtml( window, - component.render(config.data).html.replace(/svelte(-ref)?-[a-z0-9]+/g, (m, $1) => $1 ? m : 'svelte-xyz') + ServerComponent.render(config.props).html.replace(/svelte(-ref)?-[a-z0-9]+/g, (m, $1) => $1 ? m : 'svelte-xyz') ), normalizeHtml(window, expected.html) ); diff --git a/test/css/samples/nested/_config.js b/test/css/samples/nested/_config.js index 7cf5c058a..e90f873ac 100644 --- a/test/css/samples/nested/_config.js +++ b/test/css/samples/nested/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { dynamic: 'x' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js b/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js index 83f70a7c0..2e954ca8e 100644 --- a/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js +++ b/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { dynamic: 'whatever' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-class-dynamic/input.html b/test/css/samples/omit-scoping-attribute-class-dynamic/input.html index 40c8ad0b3..63743b1da 100644 --- a/test/css/samples/omit-scoping-attribute-class-dynamic/input.html +++ b/test/css/samples/omit-scoping-attribute-class-dynamic/input.html @@ -1,3 +1,7 @@ + +

this is styled

this is unstyled

@@ -5,14 +9,4 @@ .foo { color: red; } - - - \ No newline at end of file + \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js index 4b4ce74d7..1ae834ca0 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js index 4b4ce74d7..1ae834ca0 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js index 4b4ce74d7..1ae834ca0 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js index 4b4ce74d7..1ae834ca0 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js index 4b4ce74d7..1ae834ca0 100644 --- a/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js +++ b/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/omit-scoping-attribute-global/_config.js b/test/css/samples/omit-scoping-attribute-global/_config.js index 4b4ce74d7..1ae834ca0 100644 --- a/test/css/samples/omit-scoping-attribute-global/_config.js +++ b/test/css/samples/omit-scoping-attribute-global/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { raw: '

raw

' } }; \ No newline at end of file diff --git a/test/css/samples/refs-qualified/_config.js b/test/css/samples/refs-qualified/_config.js index dbc3ac2b4..bc90dafae 100644 --- a/test/css/samples/refs-qualified/_config.js +++ b/test/css/samples/refs-qualified/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { active: true }, @@ -8,21 +8,21 @@ export default { message: 'Unused CSS selector', start: { column: 1, - line: 12, - character: 169 + line: 17, + character: 222 }, end: { column: 20, - line: 12, - character: 188 + line: 17, + character: 241 }, - pos: 169, + pos: 222, frame: ` - 10: } - 11: - 12: ref:button.inactive { + 15: } + 16: + 17: ref:button.inactive { ^ - 13: color: green; - 14: }` + 18: color: green; + 19: }` }] }; \ No newline at end of file diff --git a/test/css/samples/refs-qualified/input.html b/test/css/samples/refs-qualified/input.html index f23a4f184..08e31b748 100644 --- a/test/css/samples/refs-qualified/input.html +++ b/test/css/samples/refs-qualified/input.html @@ -1,3 +1,8 @@ + + {#if active} {:else} diff --git a/test/css/samples/unused-selector-ternary/_config.js b/test/css/samples/unused-selector-ternary/_config.js index f99ad9060..043a7addf 100644 --- a/test/css/samples/unused-selector-ternary/_config.js +++ b/test/css/samples/unused-selector-ternary/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { active: true }, diff --git a/test/custom-elements/index.js b/test/custom-elements/index.js index d1166bac2..1c4e64cf2 100644 --- a/test/custom-elements/index.js +++ b/test/custom-elements/index.js @@ -1,8 +1,9 @@ import * as fs from 'fs'; +import * as path from 'path'; import * as http from 'http'; import { rollup } from 'rollup'; -import virtual from 'rollup-plugin-virtual'; -import Nightmare from 'nightmare'; +import * as virtual from 'rollup-plugin-virtual'; +import * as Nightmare from 'nightmare'; import { addLineNumbers, loadConfig, loadSvelte } from "../helpers.js"; const page = ` @@ -49,14 +50,27 @@ describe('custom-elements', function() { if (dir[0] === '.') return; const solo = /\.solo$/.test(dir); + const skip = /\.skip$/.test(dir); + const internal = path.resolve('internal.js'); + const index = path.resolve('index.js'); - (solo ? it.only : it)(dir, () => { + (solo ? it.only : skip ? it.skip : it)(dir, () => { const config = loadConfig(`./custom-elements/samples/${dir}/_config.js`); return rollup({ input: `test/custom-elements/samples/${dir}/test.js`, plugins: [ { + resolveId(importee) { + if (importee === 'svelte/internal.js') { + return internal; + } + + if (importee === 'svelte') { + return index; + } + }, + transform(code, id) { if (id.endsWith('.html')) { const compiled = svelte.compile(code, { @@ -91,12 +105,14 @@ describe('custom-elements', function() { }) .then(result => { if (result) console.log(result); + return nightmare.end(); }) .catch(message => { console.log(addLineNumbers(bundle)); - throw new Error(message); - }) - .then(() => nightmare.end()); + return nightmare.end().then(() => { + throw new Error(message); + }); + }); }); diff --git a/test/custom-elements/samples/custom-method/main.html b/test/custom-elements/samples/custom-method/main.html index b388472f2..8b85a5257 100644 --- a/test/custom-elements/samples/custom-method/main.html +++ b/test/custom-elements/samples/custom-method/main.html @@ -1,13 +1,11 @@ -

{foo}

+ \ No newline at end of file + export let foo; + + +

{foo}

\ No newline at end of file diff --git a/test/custom-elements/samples/custom-method/test.js b/test/custom-elements/samples/custom-method/test.js index f6ef68c8c..2233f0b45 100644 --- a/test/custom-elements/samples/custom-method/test.js +++ b/test/custom-elements/samples/custom-method/test.js @@ -1,11 +1,11 @@ import * as assert from 'assert'; import './main.html'; -export default function (target) { - target.innerHTML = ''; +export default async function (target) { + target.innerHTML = ''; const el = target.querySelector('custom-element'); - el.updateFoo(42); + await el.updateFoo(42); const p = el.shadowRoot.querySelector('p'); assert.equal(p.textContent, '42'); diff --git a/test/custom-elements/samples/escaped-css/main.html b/test/custom-elements/samples/escaped-css/main.html index 1f86593b8..0a28900d8 100644 --- a/test/custom-elements/samples/escaped-css/main.html +++ b/test/custom-elements/samples/escaped-css/main.html @@ -1,13 +1,9 @@ + + - - \ No newline at end of file + \ No newline at end of file diff --git a/test/custom-elements/samples/html-slots/main.html b/test/custom-elements/samples/html-slots/main.html index 7a8e47c7e..fbc70b0ae 100644 --- a/test/custom-elements/samples/html-slots/main.html +++ b/test/custom-elements/samples/html-slots/main.html @@ -1,3 +1,5 @@ + +

default fallback content

@@ -6,10 +8,4 @@

foo fallback content

-
- - \ No newline at end of file + \ No newline at end of file diff --git a/test/custom-elements/samples/html/main.html b/test/custom-elements/samples/html/main.html index 67b0fa792..4765b5a15 100644 --- a/test/custom-elements/samples/html/main.html +++ b/test/custom-elements/samples/html/main.html @@ -1,7 +1,7 @@ -

Hello {name}!

+ \ No newline at end of file + export let name; + + +

Hello {name}!

\ No newline at end of file diff --git a/test/custom-elements/samples/html/test.js b/test/custom-elements/samples/html/test.js index 9f0a925b4..732d79f00 100644 --- a/test/custom-elements/samples/html/test.js +++ b/test/custom-elements/samples/html/test.js @@ -5,7 +5,7 @@ export default function (target) { target.innerHTML = ''; const el = target.querySelector('custom-element'); - assert.equal(el.get().name, 'world'); + assert.equal(el.name, 'world'); const h1 = el.shadowRoot.querySelector('h1'); assert.equal(h1.textContent, 'Hello world!'); diff --git a/test/custom-elements/samples/nested.skip/Counter.html b/test/custom-elements/samples/nested.skip/Counter.html new file mode 100644 index 000000000..d365ce764 --- /dev/null +++ b/test/custom-elements/samples/nested.skip/Counter.html @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/test/custom-elements/samples/nested.skip/main.html b/test/custom-elements/samples/nested.skip/main.html new file mode 100644 index 000000000..3e80f6015 --- /dev/null +++ b/test/custom-elements/samples/nested.skip/main.html @@ -0,0 +1,10 @@ + + + + + +

clicked {count} times

\ No newline at end of file diff --git a/test/custom-elements/samples/nested/test.js b/test/custom-elements/samples/nested.skip/test.js similarity index 83% rename from test/custom-elements/samples/nested/test.js rename to test/custom-elements/samples/nested.skip/test.js index b9303f1e2..d6d52426a 100644 --- a/test/custom-elements/samples/nested/test.js +++ b/test/custom-elements/samples/nested.skip/test.js @@ -1,7 +1,7 @@ import * as assert from 'assert'; import './main.html'; -export default function (target) { +export default async function (target) { target.innerHTML = ''; const el = target.querySelector('my-app'); const counter = el.shadowRoot.querySelector('my-counter'); @@ -10,7 +10,7 @@ export default function (target) { assert.equal(counter.count, 0); assert.equal(counter.shadowRoot.innerHTML, ``); - button.dispatchEvent(new MouseEvent('click')); + await button.dispatchEvent(new MouseEvent('click')); assert.equal(counter.count, 1); assert.equal(counter.shadowRoot.innerHTML, ``); diff --git a/test/custom-elements/samples/nested/Counter.html b/test/custom-elements/samples/nested/Counter.html deleted file mode 100644 index c25db21ac..000000000 --- a/test/custom-elements/samples/nested/Counter.html +++ /dev/null @@ -1,13 +0,0 @@ - - - \ No newline at end of file diff --git a/test/custom-elements/samples/nested/main.html b/test/custom-elements/samples/nested/main.html deleted file mode 100644 index f930d78a2..000000000 --- a/test/custom-elements/samples/nested/main.html +++ /dev/null @@ -1,12 +0,0 @@ - -

clicked {count} times

- - \ No newline at end of file diff --git a/test/custom-elements/samples/new-styled/main.html b/test/custom-elements/samples/new-styled/main.html index 4163b0732..be1b397fa 100644 --- a/test/custom-elements/samples/new-styled/main.html +++ b/test/custom-elements/samples/new-styled/main.html @@ -1,13 +1,9 @@ + +

styled

- - \ No newline at end of file + \ No newline at end of file diff --git a/test/custom-elements/samples/new/main.html b/test/custom-elements/samples/new/main.html index 67b0fa792..4765b5a15 100644 --- a/test/custom-elements/samples/new/main.html +++ b/test/custom-elements/samples/new/main.html @@ -1,7 +1,7 @@ -

Hello {name}!

+ \ No newline at end of file + export let name; + + +

Hello {name}!

\ No newline at end of file diff --git a/test/custom-elements/samples/new/test.js b/test/custom-elements/samples/new/test.js index ff27f5213..f37f4301f 100644 --- a/test/custom-elements/samples/new/test.js +++ b/test/custom-elements/samples/new/test.js @@ -4,7 +4,7 @@ import CustomElement from './main.html'; export default function (target) { new CustomElement({ target, - data: { + props: { name: 'world' } }); diff --git a/test/custom-elements/samples/no-missing-prop-warnings/main.html b/test/custom-elements/samples/no-missing-prop-warnings/main.html index 61d4e837f..a9baee2fa 100644 --- a/test/custom-elements/samples/no-missing-prop-warnings/main.html +++ b/test/custom-elements/samples/no-missing-prop-warnings/main.html @@ -1,8 +1,9 @@ -

foo: {foo}

-

bar: {bar}

+ \ No newline at end of file + export let foo; + export let bar; + + +

foo: {foo}

+

bar: {bar}

\ No newline at end of file diff --git a/test/custom-elements/samples/oncreate/main.html b/test/custom-elements/samples/oncreate/main.html index 0c9b1b5c1..1a521ed76 100644 --- a/test/custom-elements/samples/oncreate/main.html +++ b/test/custom-elements/samples/oncreate/main.html @@ -1,9 +1,12 @@ + + \ No newline at end of file + import { onMount } from 'svelte'; + + export let wasCreated; + + onMount(() => { + wasCreated = true; + }); + + diff --git a/test/custom-elements/samples/props/main.html b/test/custom-elements/samples/props/main.html index db8465591..bee06784e 100644 --- a/test/custom-elements/samples/props/main.html +++ b/test/custom-elements/samples/props/main.html @@ -1,15 +1,9 @@ - + - data() { - return { - items: ['a', 'b', 'c'] - }; - } - }; - \ No newline at end of file + \ No newline at end of file diff --git a/test/custom-elements/samples/props/my-widget.html b/test/custom-elements/samples/props/my-widget.html index b4ed9b38a..6aabe5a73 100644 --- a/test/custom-elements/samples/props/my-widget.html +++ b/test/custom-elements/samples/props/my-widget.html @@ -1,14 +1,8 @@ -

{items.length} items

-

{items.join(', ')}

+ - data() { - return { - items: [] - }; - } - }; - \ No newline at end of file +

{items.length} items

+

{items.join(', ')}

\ No newline at end of file diff --git a/test/formats/index.js b/test/formats/index.js deleted file mode 100644 index e61cf02bc..000000000 --- a/test/formats/index.js +++ /dev/null @@ -1,285 +0,0 @@ -import assert from "assert"; -import { svelte, deindent, env, setupHtmlEqual } from "../helpers.js"; - -function testAmd(code, expectedId, dependencies, html) { - const fn = new Function("define", code); - const window = env(); - - function define(id, deps, factory) { - assert.equal(id, expectedId); - assert.deepEqual(deps, Object.keys(dependencies)); - - const SvelteComponent = factory( - ...Object.keys(dependencies).map(key => dependencies[key]) - ); - - const main = window.document.body.querySelector("main"); - const component = new SvelteComponent({ target: main }); - - assert.htmlEqual(main.innerHTML, html); - - component.destroy(); - } - - define.amd = true; - - fn(define); -} - -function testCjs(code, dependencyById, html) { - const fn = new Function("module", "exports", "require", code); - const window = env(); - - const module = { exports: {} }; - const require = id => { - return dependencyById[id]; - }; - - fn(module, module.exports, require); - - const SvelteComponent = module.exports; - - const main = window.document.body.querySelector("main"); - const component = new SvelteComponent({ target: main }); - - assert.htmlEqual(main.innerHTML, html); - - component.destroy(); -} - -function testIife(code, name, globals, html) { - const fn = new Function(Object.keys(globals), `${code}\n\nreturn ${name};`); - const window = env(); - - const SvelteComponent = fn( - ...Object.keys(globals).map(key => globals[key]) - ); - - const main = window.document.body.querySelector("main"); - const component = new SvelteComponent({ target: main }); - - assert.htmlEqual(main.innerHTML, html); - - component.destroy(); -} - -function testEval(code, name, globals, html) { - const fn = new Function(Object.keys(globals), `return ${code};`); - const window = env(); - - const SvelteComponent = fn( - ...Object.keys(globals).map(key => globals[key]) - ); - - const main = window.document.body.querySelector("main"); - const component = new SvelteComponent({ target: main }); - - assert.htmlEqual(main.innerHTML, html); - - component.destroy(); -} - -describe("formats", () => { - before(setupHtmlEqual); - - describe("amd", () => { - it("generates an AMD module", () => { - const source = deindent` -
{answer}
- - - `; - - const { js } = svelte.compile(source, { - format: "amd", - amd: { id: "foo" } - }); - - return testAmd(js.code, "foo", { answer: 42 }, `
42
`); - }); - }); - - describe("cjs", () => { - it("generates a CommonJS module", () => { - const source = deindent` -
{answer}
- - - `; - - const { js } = svelte.compile(source, { - format: "cjs" - }); - - return testCjs(js.code, { answer: 42 }, `
42
`); - }); - }); - - describe("iife", () => { - it("generates a self-executing script", () => { - const source = deindent` -
{answer}
- - - `; - - const { js } = svelte.compile(source, { - format: "iife", - name: "Foo", - globals: { - answer: "answer" - } - }); - - return testIife(js.code, "Foo", { answer: 42 }, `
42
`); - }); - - it('requires options.name', () => { - assert.throws(() => { - svelte.compile('', { - format: 'iife' - }); - }, /Missing required 'name' option for IIFE export/); - }); - - it('suggests using options.globals for default imports', () => { - const warnings = []; - - svelte.compile(` - - `, - { - format: 'iife', - name: 'App', - onwarn: warning => { - warnings.push(warning); - } - } - ); - - assert.deepEqual(warnings, [{ - code: `options-missing-globals`, - message: `No name was supplied for imported module 'lodash'. Guessing '_', but you should use options.globals` - }]); - }); - - it('insists on options.globals for named imports', () => { - assert.throws(() => { - svelte.compile(` - - `, - { - format: 'iife', - name: 'App' - } - ); - }, /Could not determine name for imported module 'svelte-transitions' – use options.globals/); - }); - }); - - describe("umd", () => { - it("generates a UMD build", () => { - const source = deindent` -
{answer}
- - - `; - - const { js } = svelte.compile(source, { - format: "umd", - name: "Foo", - globals: { - answer: "answer" - }, - amd: { - id: "foo" - } - }); - - testAmd(js.code, "foo", { answer: 42 }, `
42
`); - testCjs(js.code, { answer: 42 }, `
42
`); - testIife(js.code, "Foo", { answer: 42 }, `
42
`); - }); - - it('requires options.name', () => { - assert.throws(() => { - svelte.compile('', { - format: 'umd' - }); - }, /Missing required 'name' option for UMD export/); - }); - }); - - describe("eval", () => { - it("generates a self-executing script that returns the component on eval", () => { - const source = deindent` -
{answer}
- - - `; - - const { js } = svelte.compile(source, { - format: "eval", - globals: { - answer: "answer" - } - }); - - return testEval(js.code, "Foo", { answer: 42 }, `
42
`); - }); - }); - - describe('unknown format', () => { - it('throws an error', () => { - assert.throws(() => { - svelte.compile('', { - format: 'nope' - }); - }, /options.format is invalid \(must be es, amd, cjs, iife, umd or eval\)/); - }); - }); -}); diff --git a/test/helpers.js b/test/helpers.js index 7b1f08bb4..53b62aca5 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -1,16 +1,16 @@ -import jsdom from 'jsdom'; -import assert from 'assert'; -import glob from 'tiny-glob/sync.js'; -import fs from 'fs'; -import path from 'path'; -import chalk from 'chalk'; +import * as jsdom from 'jsdom'; +import * as assert from 'assert'; +import * as glob from 'tiny-glob/sync.js'; +import * as fs from 'fs'; +import * as path from 'path'; +import * as colors from 'kleur'; // for coverage purposes, we need to test source files, // but for sanity purposes, we need to test dist files export function loadSvelte(test) { process.env.TEST = test ? 'true' : ''; - const resolved = require.resolve('../compiler/svelte.js'); + const resolved = require.resolve('../compiler.js'); delete require.cache[resolved]; return require(resolved); @@ -164,7 +164,7 @@ export function addLineNumbers(code) { while (i.length < 3) i = ` ${i}`; return ( - chalk.grey(` ${i}: `) + + colors.gray(` ${i}: `) + line.replace(/^\t+/, match => match.split('\t').join(' ')) ); }) @@ -193,7 +193,7 @@ export function showOutput(cwd, options = {}, compile = svelte.compile) { ); console.log( // eslint-disable-line no-console - `\n>> ${chalk.cyan.bold(file)}\n${addLineNumbers(js.code)}\n<< ${chalk.cyan.bold(file)}` + `\n>> ${colors.cyan().bold(file)}\n${addLineNumbers(js.code)}\n<< ${colors.cyan().bold(file)}` ); }); } diff --git a/test/hydration/index.js b/test/hydration/index.js index 81634ea15..e73bee495 100644 --- a/test/hydration/index.js +++ b/test/hydration/index.js @@ -1,6 +1,6 @@ -import assert from 'assert'; -import path from 'path'; -import fs from 'fs'; +import * as assert from 'assert'; +import * as path from 'path'; +import * as fs from 'fs'; import { showOutput, @@ -17,13 +17,21 @@ function getName(filename) { return base[0].toUpperCase() + base.slice(1); } +const sveltePath = process.cwd(); + describe('hydration', () => { before(() => { const svelte = loadSvelte(); require.extensions['.html'] = function(module, filename) { const options = Object.assign( - { filename, name: getName(filename), hydratable: true, format: 'cjs' }, + { + filename, + name: getName(filename), + hydratable: true, + format: 'cjs', + sveltePath + }, compileOptions ); @@ -48,7 +56,7 @@ describe('hydration', () => { const cwd = path.resolve(`test/hydration/samples/${dir}`); compileOptions = config.compileOptions || {}; - compileOptions.shared = path.resolve('shared.js'); + compileOptions.shared = path.resolve('internal.js'); compileOptions.dev = config.dev; compileOptions.hydrate = true; @@ -60,7 +68,7 @@ describe('hydration', () => { let SvelteComponent; try { - SvelteComponent = require(`${cwd}/main.html`); + SvelteComponent = require(`${cwd}/main.html`).default; } catch (err) { throw err; } @@ -73,7 +81,7 @@ describe('hydration', () => { const component = new SvelteComponent({ target, hydrate: true, - data: config.data + props: config.props }); assert.htmlEqual(target.innerHTML, fs.readFileSync(`${cwd}/_after.html`, 'utf-8')); @@ -85,11 +93,17 @@ describe('hydration', () => { assert.equal(target.innerHTML, ''); } } catch (err) { - showOutput(cwd, { shared: 'svelte/shared.js' }); // eslint-disable-line no-console + showOutput(cwd, { + shared: 'svelte/internal.js', + hydratable: true + }); throw err; } - if (config.show) showOutput(cwd, { shared: 'svelte/shared.js' }); + if (config.show) showOutput(cwd, { + shared: 'svelte/internal.js', + hydratable: true + }); }); } diff --git a/test/hydration/samples/binding-input/_config.js b/test/hydration/samples/binding-input/_config.js index 7dc18c8a6..9004d0649 100644 --- a/test/hydration/samples/binding-input/_config.js +++ b/test/hydration/samples/binding-input/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { name: 'world' }, @@ -10,7 +10,7 @@ export default { }; }, - test(assert, target, snapshot, component, window) { + async test(assert, target, snapshot, component, window) { const input = target.querySelector('input'); const p = target.querySelector('p'); @@ -18,9 +18,9 @@ export default { assert.equal(p, snapshot.p); input.value = 'everybody'; - input.dispatchEvent(new window.Event('input')); + await input.dispatchEvent(new window.Event('input')); - assert.equal(component.get().name, 'everybody'); + assert.equal(component.name, 'everybody'); assert.htmlEqual(target.innerHTML, `

Hello everybody!

diff --git a/test/hydration/samples/binding-input/main.html b/test/hydration/samples/binding-input/main.html index 12c7b9ea4..e521cf7f9 100644 --- a/test/hydration/samples/binding-input/main.html +++ b/test/hydration/samples/binding-input/main.html @@ -1,2 +1,2 @@ - +

Hello {name}!

\ No newline at end of file diff --git a/test/hydration/samples/component-in-element/main.html b/test/hydration/samples/component-in-element/main.html index d639570c5..4367a831e 100644 --- a/test/hydration/samples/component-in-element/main.html +++ b/test/hydration/samples/component-in-element/main.html @@ -1,13 +1,7 @@ -
- -
- - export default { - components: { - Nested - } - }; - \ No newline at end of file +
+ +
\ No newline at end of file diff --git a/test/hydration/samples/component/main.html b/test/hydration/samples/component/main.html index c669ca09a..583835f46 100644 --- a/test/hydration/samples/component/main.html +++ b/test/hydration/samples/component/main.html @@ -1,11 +1,5 @@ - - - export default { - components: { - Nested - } - }; - \ No newline at end of file + \ No newline at end of file diff --git a/test/hydration/samples/dynamic-text-changed/_config.js b/test/hydration/samples/dynamic-text-changed/_config.js index e836ebf4b..467aef49a 100644 --- a/test/hydration/samples/dynamic-text-changed/_config.js +++ b/test/hydration/samples/dynamic-text-changed/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { name: 'everybody' }, diff --git a/test/hydration/samples/dynamic-text/_config.js b/test/hydration/samples/dynamic-text/_config.js index 3ca70ee5d..a7f0fc3d8 100644 --- a/test/hydration/samples/dynamic-text/_config.js +++ b/test/hydration/samples/dynamic-text/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { name: 'world' }, diff --git a/test/hydration/samples/each-block-arg-clash/_config.js b/test/hydration/samples/each-block-arg-clash/_config.js index 3efdf81ce..1b0439362 100644 --- a/test/hydration/samples/each-block-arg-clash/_config.js +++ b/test/hydration/samples/each-block-arg-clash/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { things: { foo: [ 'animal', diff --git a/test/hydration/samples/each-block-arg-clash/main.html b/test/hydration/samples/each-block-arg-clash/main.html index f42706e15..7f04cd5e2 100644 --- a/test/hydration/samples/each-block-arg-clash/main.html +++ b/test/hydration/samples/each-block-arg-clash/main.html @@ -2,4 +2,4 @@ {#each things.foo as foo}
  • {foo}
  • {/each} - + \ No newline at end of file diff --git a/test/hydration/samples/each-block/_config.js b/test/hydration/samples/each-block/_config.js index 065ae25cb..5c58a4c23 100644 --- a/test/hydration/samples/each-block/_config.js +++ b/test/hydration/samples/each-block/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { things: [ 'animal', 'vegetable', diff --git a/test/hydration/samples/element-attribute-added/_config.js b/test/hydration/samples/element-attribute-added/_config.js index a1cfe933c..fb4a90bd3 100644 --- a/test/hydration/samples/element-attribute-added/_config.js +++ b/test/hydration/samples/element-attribute-added/_config.js @@ -1,6 +1,6 @@ export default { - data: { - class: 'bar' + props: { + className: 'bar' }, snapshot(target) { diff --git a/test/hydration/samples/element-attribute-added/main.html b/test/hydration/samples/element-attribute-added/main.html index 335e3d4e1..c47595732 100644 --- a/test/hydration/samples/element-attribute-added/main.html +++ b/test/hydration/samples/element-attribute-added/main.html @@ -1 +1 @@ -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/test/hydration/samples/element-attribute-changed/_config.js b/test/hydration/samples/element-attribute-changed/_config.js index a1cfe933c..05881f748 100644 --- a/test/hydration/samples/element-attribute-changed/_config.js +++ b/test/hydration/samples/element-attribute-changed/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { class: 'bar' }, diff --git a/test/hydration/samples/element-attribute-removed/_config.js b/test/hydration/samples/element-attribute-removed/_config.js index a1cfe933c..05881f748 100644 --- a/test/hydration/samples/element-attribute-removed/_config.js +++ b/test/hydration/samples/element-attribute-removed/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { class: 'bar' }, diff --git a/test/hydration/samples/element-ref/_config.js b/test/hydration/samples/element-ref/_config.js index 21743569b..772fad982 100644 --- a/test/hydration/samples/element-ref/_config.js +++ b/test/hydration/samples/element-ref/_config.js @@ -11,6 +11,6 @@ export default { const h1 = target.querySelector('h1'); assert.equal(h1, snapshot.h1); - assert.equal(component.refs.h1, h1); + assert.equal(component.h1, h1); } }; \ No newline at end of file diff --git a/test/hydration/samples/element-ref/main.html b/test/hydration/samples/element-ref/main.html index 95c029976..bf046f16b 100644 --- a/test/hydration/samples/element-ref/main.html +++ b/test/hydration/samples/element-ref/main.html @@ -1 +1,5 @@ + +

    Hello world!

    \ No newline at end of file diff --git a/test/hydration/samples/event-handler/_config.js b/test/hydration/samples/event-handler/_config.js index 233bafe38..cdf743183 100644 --- a/test/hydration/samples/event-handler/_config.js +++ b/test/hydration/samples/event-handler/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { clicked: false }, @@ -11,13 +11,13 @@ export default { }; }, - test(assert, target, snapshot, component, window) { + async test(assert, target, snapshot, component, window) { const button = target.querySelector('button'); assert.equal(button, snapshot.button); - button.dispatchEvent(new window.MouseEvent('click')); + await button.dispatchEvent(new window.MouseEvent('click')); - assert.ok(component.get().clicked); + assert.ok(component.clicked); assert.htmlEqual(target.innerHTML, `

    clicked!

    diff --git a/test/hydration/samples/event-handler/main.html b/test/hydration/samples/event-handler/main.html index 83ecadb0d..d51636617 100644 --- a/test/hydration/samples/event-handler/main.html +++ b/test/hydration/samples/event-handler/main.html @@ -1,4 +1,4 @@ - + {#if clicked}

    clicked!

    diff --git a/test/hydration/samples/if-block-anchor/_config.js b/test/hydration/samples/if-block-anchor/_config.js index f9acaa30e..ee5ed39ad 100644 --- a/test/hydration/samples/if-block-anchor/_config.js +++ b/test/hydration/samples/if-block-anchor/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { foo: true, bar: true }, diff --git a/test/hydration/samples/if-block-false/_config.js b/test/hydration/samples/if-block-false/_config.js index ba071e991..6be30614f 100644 --- a/test/hydration/samples/if-block-false/_config.js +++ b/test/hydration/samples/if-block-false/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { foo: false }, diff --git a/test/hydration/samples/if-block-update/_config.js b/test/hydration/samples/if-block-update/_config.js index 185dacb1e..75d056e04 100644 --- a/test/hydration/samples/if-block-update/_config.js +++ b/test/hydration/samples/if-block-update/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { foo: true, bar: false }, @@ -17,7 +17,8 @@ export default { assert.equal(p, snapshot.p); - component.set({ foo: false, bar: true }); + component.foo = false; + component.bar = true; assert.htmlEqual(target.innerHTML, `

    bar!

    `); } }; \ No newline at end of file diff --git a/test/hydration/samples/if-block/_config.js b/test/hydration/samples/if-block/_config.js index 465c32c2a..7aca2ce55 100644 --- a/test/hydration/samples/if-block/_config.js +++ b/test/hydration/samples/if-block/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { foo: true }, diff --git a/test/hydration/samples/raw/_config.js b/test/hydration/samples/raw/_config.js index e1108714e..4af36b099 100644 --- a/test/hydration/samples/raw/_config.js +++ b/test/hydration/samples/raw/_config.js @@ -1,7 +1,7 @@ export default { skip: true, // existing nodes are blown away - data: { + props: { raw: `

    this is some html

    and so is this

    ` }, diff --git a/test/js/index.js b/test/js/index.js index 9b9805f47..715a43a47 100644 --- a/test/js/index.js +++ b/test/js/index.js @@ -1,4 +1,4 @@ -import assert from "assert"; +import * as assert from "assert"; import * as fs from "fs"; import * as path from "path"; import { loadConfig, svelte } from "../helpers.js"; @@ -27,7 +27,7 @@ describe("js", () => { shared: true }); - actual = svelte.compile(input, options).js.code.replace(/generated by Svelte v\d+\.\d+\.\d+/, 'generated by Svelte vX.Y.Z'); + actual = svelte.compile(input, options).js.code.replace(/generated by Svelte v\d+\.\d+\.\d+(-\w+)?/, 'generated by Svelte vX.Y.Z'); } catch (err) { console.log(err.frame); throw err; diff --git a/test/js/samples/action-custom-event-handler/expected.js b/test/js/samples/action-custom-event-handler/expected.js new file mode 100644 index 000000000..3451ef6dc --- /dev/null +++ b/test/js/samples/action-custom-event-handler/expected.js @@ -0,0 +1,76 @@ +/* generated by Svelte vX.Y.Z */ +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, noop, run, safe_not_equal } from "svelte/internal.js"; + +function create_fragment(component, ctx) { + var button, foo_action, current; + + return { + c() { + button = createElement("button"); + button.textContent = "foo"; + }, + + m(target, anchor) { + insert(target, button, anchor); + foo_action = foo.call(null, button, ctx.foo_function) || {}; + current = true; + }, + + p: noop, + + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + + d(detach) { + if (detach) { + detachNode(button); + } + + if (foo_action && typeof foo_action.destroy === 'function') foo_action.destroy(); + } + }; +} + +function handleFoo(bar) { + console.log(bar); +} + +function foo(node, callback) { + // code goes here +} + +function define($$self, $$props) { + let { bar } = $$props; + + function foo_function() { + return handleFoo(bar); + } + + $$self.$$.get = () => ({ bar, foo_function }); + + $$self.$$.set = $$props => { + if ('bar' in $$props) bar = $$props.bar; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get bar() { + return this.$$.get().bar; + } + + set bar(value) { + this.$set({ bar: value }); + flush(); + } +} + +export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/action-custom-event-handler/input.html b/test/js/samples/action-custom-event-handler/input.html new file mode 100644 index 000000000..12234b808 --- /dev/null +++ b/test/js/samples/action-custom-event-handler/input.html @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js index eac96a80c..b3e8fe20d 100644 --- a/test/js/samples/action/expected.js +++ b/test/js/samples/action/expected.js @@ -1,24 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, init, insert, noop, run, safe_not_equal } from "svelte/internal.js"; -function link(node) { - - function onClick(event) { - event.preventDefault(); - history.pushState(null, null, event.target.href); - } - - node.addEventListener('click', onClick); - - return { - destroy() { - node.removeEventListener('click', onClick); - } - } -}; - -function create_main_fragment(component, ctx) { - var a, link_action; +function create_fragment(component, ctx) { + var a, link_action, current; return { c() { @@ -29,33 +13,49 @@ function create_main_fragment(component, ctx) { m(target, anchor) { insert(target, a, anchor); - link_action = link.call(component, a) || {}; + link_action = link.call(null, a) || {}; + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(a); } - if (link_action && typeof link_action.destroy === 'function') link_action.destroy.call(component); + if (link_action && typeof link_action.destroy === 'function') link_action.destroy(); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function link(node) { + function onClick(event) { + event.preventDefault(); + history.pushState(null, null, event.target.href); + } - this._fragment = create_main_fragment(this, this._state); + node.addEventListener('click', onClick); + + return { + destroy() { + node.removeEventListener('click', onClick); + } + } +} - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, noop, create_fragment, safe_not_equal); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/action/input.html b/test/js/samples/action/input.html index 5b42061fe..372258703 100644 --- a/test/js/samples/action/input.html +++ b/test/js/samples/action/input.html @@ -1,23 +1,18 @@ -Test - + +Test \ No newline at end of file diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js index a401dbce1..42c4d087b 100644 --- a/test/js/samples/bind-width-height/expected.js +++ b/test/js/samples/bind-width-height/expected.js @@ -1,27 +1,31 @@ /* generated by Svelte vX.Y.Z */ -import { addResizeListener, assign, createElement, detachNode, flush, init, insert, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, addResizeListener, add_render_callback, createElement, detachNode, flush, init, insert, noop, run, safe_not_equal } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var div, div_resize_listener; - - function div_resize_handler() { - component.set({ w: div.offsetWidth, h: div.offsetHeight }); - } +function create_fragment(component, ctx) { + var div, div_resize_listener, current; return { c() { div = createElement("div"); div.textContent = "some content"; - component.root._aftercreate.push(div_resize_handler); + add_render_callback(() => ctx.div_resize_handler.call(div)); }, m(target, anchor) { insert(target, div, anchor); - div_resize_listener = addResizeListener(div, div_resize_handler); + div_resize_listener = addResizeListener(div, ctx.div_resize_handler); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div); @@ -32,20 +36,47 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props, $$make_dirty) { + let { w, h } = $$props; - this._fragment = create_main_fragment(this, this._state); + function div_resize_handler() { + w = this.offsetWidth; + h = this.offsetHeight; + $$make_dirty('w'); + $$make_dirty('h'); + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + $$self.$$.get = () => ({ w, h, div_resize_handler }); + + $$self.$$.set = $$props => { + if ('w' in $$props) w = $$props.w; + if ('h' in $$props) h = $$props.h; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get w() { + return this.$$.get().w; + } + + set w(value) { + this.$set({ w: value }); + flush(); + } + + get h() { + return this.$$.get().h; + } - flush(this); + set h(value) { + this.$set({ h: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/bind-width-height/input.html b/test/js/samples/bind-width-height/input.html index c48fe356d..5c53d688b 100644 --- a/test/js/samples/bind-width-height/input.html +++ b/test/js/samples/bind-width-height/input.html @@ -1,3 +1,3 @@ -
    +
    some content
    \ No newline at end of file diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index 93ae37f84..df67257c9 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -1,9 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { append, assign, createElement, createText, detachNode, init, insert, proto, setData } from "svelte/shared.js"; - -function data() { - return { foo: 42 } -}; +import { SvelteComponent as SvelteComponent_1, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; function add_css() { var style = createElement("style"); @@ -12,8 +8,8 @@ function add_css() { append(document.head, style); } -function create_main_fragment(component, ctx) { - var p, text; +function create_fragment(component, ctx) { + var p, text, current; return { c() { @@ -25,6 +21,7 @@ function create_main_fragment(component, ctx) { m(target, anchor) { insert(target, p, anchor); append(p, text); + current = true; }, p(changed, ctx) { @@ -33,6 +30,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(p); @@ -41,20 +45,31 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign(data(), options.data); - this._intro = true; +function define($$self, $$props) { + let { foo = 42 } = $$props; + + $$self.$$.get = () => ({ foo }); - if (!document.getElementById("svelte-1a7i8ec-style")) add_css(); + $$self.$$.set = $$props => { + if ('foo' in $$props) foo = $$props.foo; + }; +} - this._fragment = create_main_fragment(this, this._state); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + if (!document.getElementById("svelte-1a7i8ec-style")) add_css(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get foo() { + return this.$$.get().foo; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set foo(value) { + this.$set({ foo: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/collapses-text-around-comments/input.html b/test/js/samples/collapses-text-around-comments/input.html index 54c15b792..a368b09ca 100644 --- a/test/js/samples/collapses-text-around-comments/input.html +++ b/test/js/samples/collapses-text-around-comments/input.html @@ -1,3 +1,6 @@ + @@ -17,13 +20,7 @@ - + diff --git a/test/js/samples/component-static-array/expected.js b/test/js/samples/component-static-array/expected.js index 2b18d210a..dc8ea8354 100644 --- a/test/js/samples/component-static-array/expected.js +++ b/test/js/samples/component-static-array/expected.js @@ -1,48 +1,52 @@ /* generated by Svelte vX.Y.Z */ -import { assign, flush, init, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, safe_not_equal } from "svelte/internal.js"; -var Nested = window.Nested; +function create_fragment(component, ctx) { + var current; -function create_main_fragment(component, ctx) { - - var nested_initial_data = { foo: [1, 2, 3] }; - var nested = new Nested({ - root: component.root, - store: component.store, - data: nested_initial_data - }); + var nested = new ctx.Nested({ props: { foo: [1, 2, 3] } }); return { c() { - nested._fragment.c(); + nested.$$.fragment.c(); }, m(target, anchor) { - nested._mount(target, anchor); + mount_component(nested, target, anchor); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o(outrocallback) { + if (!current) return; + + if (nested) nested.$$.fragment.o(outrocallback); + current = false; + }, + d(detach) { - nested.destroy(detach); + nested.$destroy(detach); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self) { + const Nested = window.Nested; - this._fragment = create_main_fragment(this, this._state); - - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + $$self.$$.get = () => ({ Nested }); +} - flush(this); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/component-static-array/input.html b/test/js/samples/component-static-array/input.html index f87ea0a7e..3f4ecbe3c 100644 --- a/test/js/samples/component-static-array/input.html +++ b/test/js/samples/component-static-array/input.html @@ -1,9 +1,5 @@ - - \ No newline at end of file + const Nested = window.Nested; + + + \ No newline at end of file diff --git a/test/js/samples/component-static-immutable/expected.js b/test/js/samples/component-static-immutable/expected.js index 72e03ffe7..357d7c20e 100644 --- a/test/js/samples/component-static-immutable/expected.js +++ b/test/js/samples/component-static-immutable/expected.js @@ -1,50 +1,52 @@ /* generated by Svelte vX.Y.Z */ -import { _differsImmutable, assign, flush, init, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, not_equal } from "svelte/internal.js"; -var Nested = window.Nested; +function create_fragment(component, ctx) { + var current; -function create_main_fragment(component, ctx) { - - var nested_initial_data = { foo: "bar" }; - var nested = new Nested({ - root: component.root, - store: component.store, - data: nested_initial_data - }); + var nested = new ctx.Nested({ props: { foo: "bar" } }); return { c() { - nested._fragment.c(); + nested.$$.fragment.c(); }, m(target, anchor) { - nested._mount(target, anchor); + mount_component(nested, target, anchor); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o(outrocallback) { + if (!current) return; + + if (nested) nested.$$.fragment.o(outrocallback); + current = false; + }, + d(detach) { - nested.destroy(detach); + nested.$destroy(detach); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; - - this._fragment = create_main_fragment(this, this._state); +function define($$self) { + const Nested = window.Nested; - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + $$self.$$.get = () => ({ Nested }); +} - flush(this); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, not_equal); } } -assign(SvelteComponent.prototype, proto); - -SvelteComponent.prototype._differs = _differsImmutable; export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/component-static-immutable/input.html b/test/js/samples/component-static-immutable/input.html index df6c82ea8..d3c9d8066 100644 --- a/test/js/samples/component-static-immutable/input.html +++ b/test/js/samples/component-static-immutable/input.html @@ -1,10 +1,7 @@ - + \ No newline at end of file + const Nested = window.Nested; + + + \ No newline at end of file diff --git a/test/js/samples/component-static-immutable2/expected.js b/test/js/samples/component-static-immutable2/expected.js index 72e03ffe7..357d7c20e 100644 --- a/test/js/samples/component-static-immutable2/expected.js +++ b/test/js/samples/component-static-immutable2/expected.js @@ -1,50 +1,52 @@ /* generated by Svelte vX.Y.Z */ -import { _differsImmutable, assign, flush, init, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, not_equal } from "svelte/internal.js"; -var Nested = window.Nested; +function create_fragment(component, ctx) { + var current; -function create_main_fragment(component, ctx) { - - var nested_initial_data = { foo: "bar" }; - var nested = new Nested({ - root: component.root, - store: component.store, - data: nested_initial_data - }); + var nested = new ctx.Nested({ props: { foo: "bar" } }); return { c() { - nested._fragment.c(); + nested.$$.fragment.c(); }, m(target, anchor) { - nested._mount(target, anchor); + mount_component(nested, target, anchor); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o(outrocallback) { + if (!current) return; + + if (nested) nested.$$.fragment.o(outrocallback); + current = false; + }, + d(detach) { - nested.destroy(detach); + nested.$destroy(detach); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; - - this._fragment = create_main_fragment(this, this._state); +function define($$self) { + const Nested = window.Nested; - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + $$self.$$.get = () => ({ Nested }); +} - flush(this); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, not_equal); } } -assign(SvelteComponent.prototype, proto); - -SvelteComponent.prototype._differs = _differsImmutable; export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/component-static-immutable2/input.html b/test/js/samples/component-static-immutable2/input.html index 44a2bf2bc..0eeff6aeb 100644 --- a/test/js/samples/component-static-immutable2/input.html +++ b/test/js/samples/component-static-immutable2/input.html @@ -1,9 +1,5 @@ - - \ No newline at end of file + const Nested = window.Nested; + + + \ No newline at end of file diff --git a/test/js/samples/component-static/expected.js b/test/js/samples/component-static/expected.js index e619014b6..4201f86c2 100644 --- a/test/js/samples/component-static/expected.js +++ b/test/js/samples/component-static/expected.js @@ -1,48 +1,52 @@ /* generated by Svelte vX.Y.Z */ -import { assign, flush, init, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, safe_not_equal } from "svelte/internal.js"; -var Nested = window.Nested; +function create_fragment(component, ctx) { + var current; -function create_main_fragment(component, ctx) { - - var nested_initial_data = { foo: "bar" }; - var nested = new Nested({ - root: component.root, - store: component.store, - data: nested_initial_data - }); + var nested = new ctx.Nested({ props: { foo: "bar" } }); return { c() { - nested._fragment.c(); + nested.$$.fragment.c(); }, m(target, anchor) { - nested._mount(target, anchor); + mount_component(nested, target, anchor); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o(outrocallback) { + if (!current) return; + + if (nested) nested.$$.fragment.o(outrocallback); + current = false; + }, + d(detach) { - nested.destroy(detach); + nested.$destroy(detach); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self) { + const Nested = window.Nested; - this._fragment = create_main_fragment(this, this._state); - - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + $$self.$$.get = () => ({ Nested }); +} - flush(this); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/component-static/input.html b/test/js/samples/component-static/input.html index 44a2bf2bc..0eeff6aeb 100644 --- a/test/js/samples/component-static/input.html +++ b/test/js/samples/component-static/input.html @@ -1,9 +1,5 @@ - - \ No newline at end of file + const Nested = window.Nested; + + + \ No newline at end of file diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js index 79b41d00d..3e5ed4f08 100644 --- a/test/js/samples/computed-collapsed-if/expected.js +++ b/test/js/samples/computed-collapsed-if/expected.js @@ -1,48 +1,59 @@ /* generated by Svelte vX.Y.Z */ -import { assign, init, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, flush, init, noop, run, safe_not_equal } from "svelte/internal.js"; -function a({ x }) { - return x * 2; -} - -function b({ x }) { - return x * 3; -} - -function create_main_fragment(component, ctx) { +function create_fragment(component, ctx) { + var current; return { c: noop, - m: noop, - p: noop, - + i: noop, + o: run, d: noop }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - - this._recompute({ x: 1 }, this._state); - this._intro = true; +function define($$self, $$props) { + let { x } = $$props; - this._fragment = create_main_fragment(this, this._state); + function a() { + return x * 2; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + function b() { + return x * 3; } + + $$self.$$.get = () => ({ x, a, b }); + + $$self.$$.set = $$props => { + if ('x' in $$props) x = $$props.x; + }; } -assign(SvelteComponent.prototype, proto); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get x() { + return this.$$.get().x; + } + + set x(value) { + this.$set({ x: value }); + flush(); + } -SvelteComponent.prototype._recompute = function _recompute(changed, state) { - if (changed.x) { - if (this._differs(state.a, (state.a = a(state)))) changed.a = true; - if (this._differs(state.b, (state.b = b(state)))) changed.b = true; + get a() { + return this.$$.get().a; + } + + get b() { + return this.$$.get().b; } } + export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/computed-collapsed-if/input.html b/test/js/samples/computed-collapsed-if/input.html index c7280e5ef..779bb2fda 100644 --- a/test/js/samples/computed-collapsed-if/input.html +++ b/test/js/samples/computed-collapsed-if/input.html @@ -1,8 +1,11 @@ \ No newline at end of file diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index 95180bc7d..330aa036c 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { append, assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, init, insert, noop, run, safe_not_equal } from "svelte/internal.js"; function add_css() { var style = createElement("style"); @@ -8,8 +8,8 @@ function add_css() { append(document.head, style); } -function create_main_fragment(component, ctx) { - var div; +function create_fragment(component, ctx) { + var div, current; return { c() { @@ -19,10 +19,18 @@ function create_main_fragment(component, ctx) { m(target, anchor) { insert(target, div, anchor); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div); @@ -31,20 +39,12 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; - - if (!document.getElementById("svelte-1slhpfn-style")) add_css(); - - this._fragment = create_main_fragment(this, this._state); - - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + if (!document.getElementById("svelte-1slhpfn-style")) add_css(); + init(this, options, noop, create_fragment, safe_not_equal); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index e9375bf00..a5b82a4fa 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js"; +import { SvelteElement, createElement, detachNode, init, insert, noop, run, safe_not_equal } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var div; +function create_fragment(component, ctx) { + var div, current; return { c() { @@ -13,10 +13,18 @@ function create_main_fragment(component, ctx) { m(target, anchor) { insert(target, div, anchor); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div); @@ -25,39 +33,26 @@ function create_main_fragment(component, ctx) { }; } -class SvelteComponent extends HTMLElement { - constructor(options = {}) { +class SvelteComponent extends SvelteElement { + constructor(options) { super(); - init(this, options); - this._state = assign({}, options.data); - this._intro = true; - this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ``; - this._fragment = create_main_fragment(this, this._state); + init(this, { target: this.shadowRoot }, noop, create_fragment, safe_not_equal); - this._fragment.c(); - this._fragment.m(this.shadowRoot, null); - - if (options.target) this._mount(options.target, options.anchor); + if (options) { + if (options.target) { + insert(options.target, this, options.anchor); + } + } } static get observedAttributes() { return []; } - - attributeChangedCallback(attr, oldValue, newValue) { - this.set({ [attr]: newValue }); - } } -assign(SvelteComponent.prototype, proto); -assign(SvelteComponent.prototype, { - _mount(target, anchor) { - target.insertBefore(this, anchor); - } -}); - customElements.define("custom-element", SvelteComponent); + export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/css-shadow-dom-keyframes/input.html b/test/js/samples/css-shadow-dom-keyframes/input.html index fcdc7a9f0..cc1274d7f 100644 --- a/test/js/samples/css-shadow-dom-keyframes/input.html +++ b/test/js/samples/css-shadow-dom-keyframes/input.html @@ -1,3 +1,5 @@ + +
    fades in
    - - \ No newline at end of file + \ No newline at end of file diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 482eb26e2..9bc95aa30 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -1,10 +1,10 @@ /* generated by Svelte vX.Y.Z */ -import { addLoc, append, assign, createElement, createText, detachNode, init, insert, protoDev, setData } from "svelte/shared.js"; +import { SvelteComponentDev, addLoc, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; const file = undefined; -function create_main_fragment(component, ctx) { - var h1, text0, text1, text2, text3; +function create_fragment(component, ctx) { + var h1, text0, text1, text2, text3, current; return { c: function create() { @@ -17,12 +17,17 @@ function create_main_fragment(component, ctx) { addLoc(h1, file, 0, 0, 0); }, + l: function claim(nodes) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function mount(target, anchor) { insert(target, h1, anchor); append(h1, text0); append(h1, text1); append(h1, text2); insert(target, text3, anchor); + current = true; }, p: function update(changed, ctx) { @@ -33,6 +38,13 @@ function create_main_fragment(component, ctx) { debugger; }, + i: function intro(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d: function destroy(detach) { if (detach) { detachNode(h1); @@ -42,28 +54,35 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - this._debugName = ''; - if (!options || (!options.target && !options.root)) { - throw new Error("'target' is a required option"); - } +function define($$self, $$props) { + let { name } = $$props; - init(this, options); - this._state = assign({}, options.data); - if (!('name' in this._state)) console.warn(" was created without expected data property 'name'"); - this._intro = true; + $$self.$$.get = () => ({ name }); - this._fragment = create_main_fragment(this, this._state); + $$self.$$.set = $$props => { + if ('name' in $$props) name = $$props.name; + }; +} - if (options.target) { - if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - this._fragment.c(); - this._mount(options.target, options.anchor); +class SvelteComponent extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, define, create_fragment, safe_not_equal); + + const state = this.$$.get(); + if (state.name === undefined) { + console.warn(" was created without expected data property 'name'"); + } } -} -assign(SvelteComponent.prototype, protoDev); + get name() { + return this.$$.get().name; + } + + set name(value) { + this.$set({ name: value }); + flush(); + } +} -SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) { -}; export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js index 0ecaab9c5..0875f766d 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { addLoc, append, assign, createElement, createText, destroyEach, detachNode, init, insert, protoDev, setData } from "svelte/shared.js"; +import { SvelteComponentDev, addLoc, append, createElement, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; const file = undefined; @@ -9,8 +9,53 @@ function get_each_context(ctx, list, i) { return child_ctx; } -function create_main_fragment(component, ctx) { - var text0, p, text1, text2; +// (1:0) {#each things as thing} +function create_each_block(component, ctx) { + var span, text0_value = ctx.thing.name, text0, text1; + + return { + c: function create() { + span = createElement("span"); + text0 = createText(text0_value); + text1 = createText("\n\t"); + + { + const { foo, bar, baz, thing } = ctx; + console.log({ foo, bar, baz, thing }); + debugger; + } + addLoc(span, file, 1, 1, 25); + }, + + m: function mount(target, anchor) { + insert(target, span, anchor); + append(span, text0); + insert(target, text1, anchor); + }, + + p: function update(changed, ctx) { + if ((changed.things) && text0_value !== (text0_value = ctx.thing.name)) { + setData(text0, text0_value); + } + + if (changed.foo || changed.bar || changed.baz || changed.things) { + const { foo, bar, baz, thing } = ctx; + console.log({ foo, bar, baz, thing }); + debugger; + } + }, + + d: function destroy(detach) { + if (detach) { + detachNode(span); + detachNode(text1); + } + } + }; +} + +function create_fragment(component, ctx) { + var text0, p, text1, text2, current; var each_value = ctx.things; @@ -33,6 +78,10 @@ function create_main_fragment(component, ctx) { addLoc(p, file, 5, 0, 91); }, + l: function claim(nodes) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function mount(target, anchor) { for (var i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); @@ -42,6 +91,7 @@ function create_main_fragment(component, ctx) { insert(target, p, anchor); append(p, text1); append(p, text2); + current = true; }, p: function update(changed, ctx) { @@ -71,6 +121,13 @@ function create_main_fragment(component, ctx) { } }, + i: function intro(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d: function destroy(detach) { destroyEach(each_blocks, detach); @@ -82,76 +139,74 @@ function create_main_fragment(component, ctx) { }; } -// (1:0) {#each things as thing} -function create_each_block(component, ctx) { - var span, text0_value = ctx.thing.name, text0, text1; +function define($$self, $$props) { + let { things, foo, bar, baz } = $$props; - return { - c: function create() { - span = createElement("span"); - text0 = createText(text0_value); - text1 = createText("\n\t"); + $$self.$$.get = () => ({ things, foo, bar, baz }); - { - const { foo, bar, baz, thing } = ctx; - console.log({ foo, bar, baz, thing }); - debugger; - } - addLoc(span, file, 1, 1, 25); - }, + $$self.$$.set = $$props => { + if ('things' in $$props) things = $$props.things; + if ('foo' in $$props) foo = $$props.foo; + if ('bar' in $$props) bar = $$props.bar; + if ('baz' in $$props) baz = $$props.baz; + }; +} - m: function mount(target, anchor) { - insert(target, span, anchor); - append(span, text0); - insert(target, text1, anchor); - }, +class SvelteComponent extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, define, create_fragment, safe_not_equal); - p: function update(changed, ctx) { - if ((changed.things) && text0_value !== (text0_value = ctx.thing.name)) { - setData(text0, text0_value); - } + const state = this.$$.get(); + if (state.things === undefined) { + console.warn(" was created without expected data property 'things'"); + } + if (state.foo === undefined) { + console.warn(" was created without expected data property 'foo'"); + } + if (state.bar === undefined) { + console.warn(" was created without expected data property 'bar'"); + } + if (state.baz === undefined) { + console.warn(" was created without expected data property 'baz'"); + } + } - if (changed.foo || changed.bar || changed.baz || changed.things) { - const { foo, bar, baz, thing } = ctx; - console.log({ foo, bar, baz, thing }); - debugger; - } - }, + get things() { + return this.$$.get().things; + } - d: function destroy(detach) { - if (detach) { - detachNode(span); - detachNode(text1); - } - } - }; -} + set things(value) { + this.$set({ things: value }); + flush(); + } -function SvelteComponent(options) { - this._debugName = ''; - if (!options || (!options.target && !options.root)) { - throw new Error("'target' is a required option"); + get foo() { + return this.$$.get().foo; } - init(this, options); - this._state = assign({}, options.data); - if (!('things' in this._state)) console.warn(" was created without expected data property 'things'"); - if (!('foo' in this._state)) console.warn(" was created without expected data property 'foo'"); - if (!('bar' in this._state)) console.warn(" was created without expected data property 'bar'"); - if (!('baz' in this._state)) console.warn(" was created without expected data property 'baz'"); - this._intro = true; + set foo(value) { + this.$set({ foo: value }); + flush(); + } - this._fragment = create_main_fragment(this, this._state); + get bar() { + return this.$$.get().bar; + } - if (options.target) { - if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - this._fragment.c(); - this._mount(options.target, options.anchor); + set bar(value) { + this.$set({ bar: value }); + flush(); + } + + get baz() { + return this.$$.get().baz; } -} -assign(SvelteComponent.prototype, protoDev); + set baz(value) { + this.$set({ baz: value }); + flush(); + } +} -SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) { -}; export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 564a18df8..15fbd9951 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { addLoc, append, assign, createElement, createText, destroyEach, detachNode, init, insert, protoDev, setData } from "svelte/shared.js"; +import { SvelteComponentDev, addLoc, append, createElement, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; const file = undefined; @@ -9,8 +9,53 @@ function get_each_context(ctx, list, i) { return child_ctx; } -function create_main_fragment(component, ctx) { - var text0, p, text1, text2; +// (1:0) {#each things as thing} +function create_each_block(component, ctx) { + var span, text0_value = ctx.thing.name, text0, text1; + + return { + c: function create() { + span = createElement("span"); + text0 = createText(text0_value); + text1 = createText("\n\t"); + + { + const { foo } = ctx; + console.log({ foo }); + debugger; + } + addLoc(span, file, 1, 1, 25); + }, + + m: function mount(target, anchor) { + insert(target, span, anchor); + append(span, text0); + insert(target, text1, anchor); + }, + + p: function update(changed, ctx) { + if ((changed.things) && text0_value !== (text0_value = ctx.thing.name)) { + setData(text0, text0_value); + } + + if (changed.foo) { + const { foo } = ctx; + console.log({ foo }); + debugger; + } + }, + + d: function destroy(detach) { + if (detach) { + detachNode(span); + detachNode(text1); + } + } + }; +} + +function create_fragment(component, ctx) { + var text0, p, text1, text2, current; var each_value = ctx.things; @@ -33,6 +78,10 @@ function create_main_fragment(component, ctx) { addLoc(p, file, 5, 0, 74); }, + l: function claim(nodes) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function mount(target, anchor) { for (var i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); @@ -42,6 +91,7 @@ function create_main_fragment(component, ctx) { insert(target, p, anchor); append(p, text1); append(p, text2); + current = true; }, p: function update(changed, ctx) { @@ -71,6 +121,13 @@ function create_main_fragment(component, ctx) { } }, + i: function intro(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d: function destroy(detach) { destroyEach(each_blocks, detach); @@ -82,74 +139,48 @@ function create_main_fragment(component, ctx) { }; } -// (1:0) {#each things as thing} -function create_each_block(component, ctx) { - var span, text0_value = ctx.thing.name, text0, text1; - - return { - c: function create() { - span = createElement("span"); - text0 = createText(text0_value); - text1 = createText("\n\t"); - - { - const { foo } = ctx; - console.log({ foo }); - debugger; - } - addLoc(span, file, 1, 1, 25); - }, +function define($$self, $$props) { + let { things, foo } = $$props; - m: function mount(target, anchor) { - insert(target, span, anchor); - append(span, text0); - insert(target, text1, anchor); - }, + $$self.$$.get = () => ({ things, foo }); - p: function update(changed, ctx) { - if ((changed.things) && text0_value !== (text0_value = ctx.thing.name)) { - setData(text0, text0_value); - } + $$self.$$.set = $$props => { + if ('things' in $$props) things = $$props.things; + if ('foo' in $$props) foo = $$props.foo; + }; +} - if (changed.foo) { - const { foo } = ctx; - console.log({ foo }); - debugger; - } - }, +class SvelteComponent extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, define, create_fragment, safe_not_equal); - d: function destroy(detach) { - if (detach) { - detachNode(span); - detachNode(text1); - } + const state = this.$$.get(); + if (state.things === undefined) { + console.warn(" was created without expected data property 'things'"); } - }; -} + if (state.foo === undefined) { + console.warn(" was created without expected data property 'foo'"); + } + } -function SvelteComponent(options) { - this._debugName = ''; - if (!options || (!options.target && !options.root)) { - throw new Error("'target' is a required option"); + get things() { + return this.$$.get().things; } - init(this, options); - this._state = assign({}, options.data); - if (!('things' in this._state)) console.warn(" was created without expected data property 'things'"); - if (!('foo' in this._state)) console.warn(" was created without expected data property 'foo'"); - this._intro = true; + set things(value) { + this.$set({ things: value }); + flush(); + } - this._fragment = create_main_fragment(this, this._state); + get foo() { + return this.$$.get().foo; + } - if (options.target) { - if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - this._fragment.c(); - this._mount(options.target, options.anchor); + set foo(value) { + this.$set({ foo: value }); + flush(); } } -assign(SvelteComponent.prototype, protoDev); - -SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) { -}; export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/debug-ssr-foo/expected.js b/test/js/samples/debug-ssr-foo/expected.js index 43f1be1db..db9b35477 100644 --- a/test/js/samples/debug-ssr-foo/expected.js +++ b/test/js/samples/debug-ssr-foo/expected.js @@ -1,51 +1,13 @@ -"use strict"; +/* generated by Svelte vX.Y.Z */ +import { create_ssr_component, debug, each, escape } from "svelte/internal.js"; -var { debug, each, escape } = require("svelte/shared.js"); +const SvelteComponent = create_ssr_component(($$result, $$props, $$bindings, $$slots) => { + let { things, foo } = $$props; -var SvelteComponent = {};; + return `${each(things, (thing) => `${escape(thing.name)} + ${debug(null, 2, 2, { foo })}`)} -SvelteComponent.data = function() { - return {}; -}; +

    foo: ${escape(foo)}

    `; +}); -SvelteComponent.render = function(state, options = {}) { - var components = new Set(); - - function addComponent(component) { - components.add(component); - } - - var result = { head: '', addComponent }; - var html = SvelteComponent._render(result, state, options); - - var cssCode = Array.from(components).map(c => c.css && c.css.code).filter(Boolean).join('\n'); - - return { - html, - head: result.head, - css: { code: cssCode, map: null }, - toString() { - return html; - } - }; -} - -SvelteComponent._render = function(__result, ctx, options) { - __result.addComponent(SvelteComponent); - - ctx = Object.assign({}, ctx); - - return `${ each(ctx.things, item => Object.assign({}, ctx, { thing: item }), ctx => `${escape(ctx.thing.name)} - ${debug(null, 2, 2, { foo: ctx.foo })}`)} - -

    foo: ${escape(ctx.foo)}

    `; -}; - -SvelteComponent.css = { - code: '', - map: null -}; - -var warned = false; - -module.exports = SvelteComponent; \ No newline at end of file +export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js index 0a8dbc75f..34488cc16 100644 --- a/test/js/samples/deconflict-builtins/expected.js +++ b/test/js/samples/deconflict-builtins/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { append, assign, createComment, createElement, createText, destroyEach, detachNode, init, insert, proto, setData } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, append, createComment, createElement, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); @@ -7,8 +7,37 @@ function get_each_context(ctx, list, i) { return child_ctx; } -function create_main_fragment(component, ctx) { - var each_anchor; +// (1:0) {#each createElement as node} +function create_each_block(component, ctx) { + var span, text_value = ctx.node, text; + + return { + c() { + span = createElement("span"); + text = createText(text_value); + }, + + m(target, anchor) { + insert(target, span, anchor); + append(span, text); + }, + + p(changed, ctx) { + if ((changed.createElement) && text_value !== (text_value = ctx.node)) { + setData(text, text_value); + } + }, + + d(detach) { + if (detach) { + detachNode(span); + } + } + }; +} + +function create_fragment(component, ctx) { + var each_anchor, current; var each_value = ctx.createElement; @@ -33,6 +62,7 @@ function create_main_fragment(component, ctx) { } insert(target, each_anchor, anchor); + current = true; }, p(changed, ctx) { @@ -58,6 +88,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { destroyEach(each_blocks, detach); @@ -68,47 +105,30 @@ function create_main_fragment(component, ctx) { }; } -// (1:0) {#each createElement as node} -function create_each_block(component, ctx) { - var span, text_value = ctx.node, text; +function define($$self, $$props) { + let { createElement } = $$props; - return { - c() { - span = createElement("span"); - text = createText(text_value); - }, + $$self.$$.get = () => ({ createElement }); - m(target, anchor) { - insert(target, span, anchor); - append(span, text); - }, - - p(changed, ctx) { - if ((changed.createElement) && text_value !== (text_value = ctx.node)) { - setData(text, text_value); - } - }, - - d(detach) { - if (detach) { - detachNode(span); - } - } + $$self.$$.set = $$props => { + if ('createElement' in $$props) createElement = $$props.createElement; }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get createElement() { + return this.$$.get().createElement; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set createElement(value) { + this.$set({ createElement: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js index daaf8005c..768c03e02 100644 --- a/test/js/samples/deconflict-globals/expected.js +++ b/test/js/samples/deconflict-globals/expected.js @@ -1,48 +1,48 @@ /* generated by Svelte vX.Y.Z */ -import { assign, assignTrue, flush, init, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, flush, init, noop, run, safe_not_equal } from "svelte/internal.js"; +import { onMount } from "svelte"; -function data_1() { - return { - foo: 'bar' -}; -} - -function oncreate() { - alert(JSON.stringify(data())); -}; - -function create_main_fragment(component, ctx) { +function create_fragment(component, ctx) { + var current; return { c: noop, - m: noop, - p: noop, - + i: noop, + o: run, d: noop }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign(data_1(), options.data); - this._intro = true; - - this._fragment = create_main_fragment(this, this._state); +function define($$self, $$props) { + let { foo = 'bar' } = $$props; - this.root._oncreate.push(() => { - oncreate.call(this); - this.fire("update", { changed: assignTrue({}, this._state), current: this._state }); + onMount(() => { + alert(JSON.stringify(data())); }); - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + $$self.$$.get = () => ({ foo }); + + $$self.$$.set = $$props => { + if ('foo' in $$props) foo = $$props.foo; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get foo() { + return this.$$.get().foo; + } - flush(this); + set foo(value) { + this.$set({ foo: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/deconflict-globals/input.html b/test/js/samples/deconflict-globals/input.html index 6c3dc88e8..4e0b72d2d 100644 --- a/test/js/samples/deconflict-globals/input.html +++ b/test/js/samples/deconflict-globals/input.html @@ -1,11 +1,9 @@ \ No newline at end of file diff --git a/test/js/samples/dev-warning-missing-data-computed/expected.js b/test/js/samples/dev-warning-missing-data-computed/expected.js index 141bcc917..76893018d 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -1,14 +1,10 @@ /* generated by Svelte vX.Y.Z */ -import { addLoc, append, assign, createElement, createText, detachNode, init, insert, protoDev, setData } from "svelte/shared.js"; - -function bar({ foo }) { - return foo * 2; -} +import { SvelteComponentDev, addLoc, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; const file = undefined; -function create_main_fragment(component, ctx) { - var p, text0_value = ctx.Math.max(0, ctx.foo), text0, text1, text2; +function create_fragment(component, ctx) { + var p, text0_value = Math.max(0, ctx.foo), text0, text1, text2, current; return { c: function create() { @@ -16,7 +12,11 @@ function create_main_fragment(component, ctx) { text0 = createText(text0_value); text1 = createText("\n\t"); text2 = createText(ctx.bar); - addLoc(p, file, 0, 0, 0); + addLoc(p, file, 7, 0, 67); + }, + + l: function claim(nodes) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); }, m: function mount(target, anchor) { @@ -24,10 +24,11 @@ function create_main_fragment(component, ctx) { append(p, text0); append(p, text1); append(p, text2); + current = true; }, p: function update(changed, ctx) { - if ((changed.Math || changed.foo) && text0_value !== (text0_value = ctx.Math.max(0, ctx.foo))) { + if ((changed.foo) && text0_value !== (text0_value = Math.max(0, ctx.foo))) { setData(text0, text0_value); } @@ -36,6 +37,13 @@ function create_main_fragment(component, ctx) { } }, + i: function intro(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d: function destroy(detach) { if (detach) { detachNode(p); @@ -44,37 +52,43 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - this._debugName = ''; - if (!options || (!options.target && !options.root)) { - throw new Error("'target' is a required option"); - } +function define($$self, $$props, $$make_dirty) { + let { foo } = $$props; - init(this, options); - this._state = assign({ Math : Math }, options.data); + let bar; - this._recompute({ foo: 1 }, this._state); - if (!('foo' in this._state)) console.warn(" was created without expected data property 'foo'"); - this._intro = true; + $$self.$$.get = () => ({ foo, bar }); - this._fragment = create_main_fragment(this, this._state); + $$self.$$.set = $$props => { + if ('foo' in $$props) foo = $$props.foo; + }; - if (options.target) { - if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - this._fragment.c(); - this._mount(options.target, options.anchor); - } + $$self.$$.update = ($$dirty = { foo: 1 }) => { + if ($$dirty.foo) { + bar = foo * 2; $$make_dirty('bar'); + } + }; } -assign(SvelteComponent.prototype, protoDev); +class SvelteComponent extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, define, create_fragment, safe_not_equal); + + const state = this.$$.get(); + if (state.foo === undefined) { + console.warn(" was created without expected data property 'foo'"); + } + } -SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) { - if ('bar' in newState && !this._updatingReadonlyProperty) throw new Error(": Cannot set read-only property 'bar'"); -}; + get foo() { + return this.$$.get().foo; + } -SvelteComponent.prototype._recompute = function _recompute(changed, state) { - if (changed.foo) { - if (this._differs(state.bar, (state.bar = bar(state)))) changed.bar = true; + set foo(value) { + this.$set({ foo: value }); + flush(); } } + export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/dev-warning-missing-data-computed/input.html b/test/js/samples/dev-warning-missing-data-computed/input.html index 06eb21049..fc510caba 100644 --- a/test/js/samples/dev-warning-missing-data-computed/input.html +++ b/test/js/samples/dev-warning-missing-data-computed/input.html @@ -1,12 +1,11 @@ + +

    {Math.max(0, foo)} {bar} -

    - - \ No newline at end of file +

    \ No newline at end of file diff --git a/test/js/samples/do-use-dataset/expected.js b/test/js/samples/do-use-dataset/expected.js index 0f5ad2ce9..b7e0e38dc 100644 --- a/test/js/samples/do-use-dataset/expected.js +++ b/test/js/samples/do-use-dataset/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createElement, createText, detachNode, init, insert, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var div0, text, div1; +function create_fragment(component, ctx) { + var div0, text, div1, current; return { c() { @@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) { insert(target, div0, anchor); insert(target, text, anchor); insert(target, div1, anchor); + current = true; }, p(changed, ctx) { @@ -25,6 +26,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div0); @@ -35,18 +43,30 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props) { + let { bar } = $$props; + + $$self.$$.get = () => ({ bar }); + + $$self.$$.set = $$props => { + if ('bar' in $$props) bar = $$props.bar; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get bar() { + return this.$$.get().bar; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set bar(value) { + this.$set({ bar: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/do-use-dataset/input.html b/test/js/samples/do-use-dataset/input.html index fcd821731..ffd72ac6e 100644 --- a/test/js/samples/do-use-dataset/input.html +++ b/test/js/samples/do-use-dataset/input.html @@ -1,2 +1,2 @@
    -
    +
    \ No newline at end of file diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected.js b/test/js/samples/dont-use-dataset-in-legacy/expected.js index c9cbb1b34..38fa59d4e 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createElement, createText, detachNode, init, insert, proto, setAttribute } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var div0, text, div1; +function create_fragment(component, ctx) { + var div0, text, div1, current; return { c() { @@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) { insert(target, div0, anchor); insert(target, text, anchor); insert(target, div1, anchor); + current = true; }, p(changed, ctx) { @@ -25,6 +26,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div0); @@ -35,18 +43,30 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props) { + let { bar } = $$props; + + $$self.$$.get = () => ({ bar }); + + $$self.$$.set = $$props => { + if ('bar' in $$props) bar = $$props.bar; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get bar() { + return this.$$.get().bar; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set bar(value) { + this.$set({ bar: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/dont-use-dataset-in-legacy/input.html b/test/js/samples/dont-use-dataset-in-legacy/input.html index fcd821731..ffd72ac6e 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/input.html +++ b/test/js/samples/dont-use-dataset-in-legacy/input.html @@ -1,2 +1,2 @@
    -
    +
    \ No newline at end of file diff --git a/test/js/samples/dont-use-dataset-in-svg/expected.js b/test/js/samples/dont-use-dataset-in-svg/expected.js index a94b8b685..7f53da9b1 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { append, assign, createSvgElement, detachNode, init, insert, proto, setAttribute } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, append, createSvgElement, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var svg, g0, g1; +function create_fragment(component, ctx) { + var svg, g0, g1, current; return { c() { @@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) { insert(target, svg, anchor); append(svg, g0); append(svg, g1); + current = true; }, p(changed, ctx) { @@ -25,6 +26,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(svg); @@ -33,18 +41,30 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props) { + let { bar } = $$props; + + $$self.$$.get = () => ({ bar }); + + $$self.$$.set = $$props => { + if ('bar' in $$props) bar = $$props.bar; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get bar() { + return this.$$.get().bar; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set bar(value) { + this.$set({ bar: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/dont-use-dataset-in-svg/input.html b/test/js/samples/dont-use-dataset-in-svg/input.html index 3032322b8..fe6c4eba9 100644 --- a/test/js/samples/dont-use-dataset-in-svg/input.html +++ b/test/js/samples/dont-use-dataset-in-svg/input.html @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/test/js/samples/dynamic-import/expected.js b/test/js/samples/dynamic-import/expected.js index c30b82a9b..1d2b58c23 100644 --- a/test/js/samples/dynamic-import/expected.js +++ b/test/js/samples/dynamic-import/expected.js @@ -1,46 +1,51 @@ /* generated by Svelte vX.Y.Z */ -import { assign, flush, init, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, safe_not_equal } from "svelte/internal.js"; +import LazyLoad from "./LazyLoad.html"; -function create_main_fragment(component, ctx) { +function create_fragment(component, ctx) { + var current; - var lazyload_initial_data = { load: () => import('./Foo.html') }; - var lazyload = new LazyLoad({ - root: component.root, - store: component.store, - data: lazyload_initial_data - }); + var lazyload = new LazyLoad({ props: { load: func } }); return { c() { - lazyload._fragment.c(); + lazyload.$$.fragment.c(); }, m(target, anchor) { - lazyload._mount(target, anchor); + mount_component(lazyload, target, anchor); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o(outrocallback) { + if (!current) return; + + if (lazyload) lazyload.$$.fragment.o(outrocallback); + current = false; + }, + d(detach) { - lazyload.destroy(detach); + lazyload.$destroy(detach); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; - - this._fragment = create_main_fragment(this, this._state); - - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); +function func() { + return import('./Foo.html'); +} - flush(this); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, noop, create_fragment, safe_not_equal); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/dynamic-import/input.html b/test/js/samples/dynamic-import/input.html index cda0dbfba..3640ef516 100644 --- a/test/js/samples/dynamic-import/input.html +++ b/test/js/samples/dynamic-import/input.html @@ -1,9 +1,5 @@ - - \ No newline at end of file + import LazyLoad from './LazyLoad.html'; + + + \ No newline at end of file diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index ea2e52770..d4e528c46 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { append, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insert, proto, setData } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, append, createElement, createText, destroyEach, detachAfter, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); @@ -8,8 +8,67 @@ function get_each_context(ctx, list, i) { return child_ctx; } -function create_main_fragment(component, ctx) { - var text0, p, text1; +// (1:0) {#each comments as comment, i} +function create_each_block(component, ctx) { + var div, strong, text0, text1, span, text2_value = ctx.comment.author, text2, text3, text4_value = ctx.elapsed(ctx.comment.time, ctx.time), text4, text5, text6, raw_value = ctx.comment.html, raw_before; + + return { + c() { + div = createElement("div"); + strong = createElement("strong"); + text0 = createText(ctx.i); + text1 = createText("\n\n\t\t"); + span = createElement("span"); + text2 = createText(text2_value); + text3 = createText(" wrote "); + text4 = createText(text4_value); + text5 = createText(" ago:"); + text6 = createText("\n\n\t\t"); + raw_before = createElement('noscript'); + span.className = "meta"; + div.className = "comment"; + }, + + m(target, anchor) { + insert(target, div, anchor); + append(div, strong); + append(strong, text0); + append(div, text1); + append(div, span); + append(span, text2); + append(span, text3); + append(span, text4); + append(span, text5); + append(div, text6); + append(div, raw_before); + raw_before.insertAdjacentHTML("afterend", raw_value); + }, + + p(changed, ctx) { + if ((changed.comments) && text2_value !== (text2_value = ctx.comment.author)) { + setData(text2, text2_value); + } + + if ((changed.elapsed || changed.comments || changed.time) && text4_value !== (text4_value = ctx.elapsed(ctx.comment.time, ctx.time))) { + setData(text4, text4_value); + } + + if ((changed.comments) && raw_value !== (raw_value = ctx.comment.html)) { + detachAfter(raw_before); + raw_before.insertAdjacentHTML("afterend", raw_value); + } + }, + + d(detach) { + if (detach) { + detachNode(div); + } + } + }; +} + +function create_fragment(component, ctx) { + var text0, p, text1, current; var each_value = ctx.comments; @@ -38,6 +97,7 @@ function create_main_fragment(component, ctx) { insert(target, text0, anchor); insert(target, p, anchor); append(p, text1); + current = true; }, p(changed, ctx) { @@ -67,6 +127,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { destroyEach(each_blocks, detach); @@ -78,77 +145,60 @@ function create_main_fragment(component, ctx) { }; } -// (1:0) {#each comments as comment, i} -function create_each_block(component, ctx) { - var div, strong, text0, text1, span, text2_value = ctx.comment.author, text2, text3, text4_value = ctx.elapsed(ctx.comment.time, ctx.time), text4, text5, text6, raw_value = ctx.comment.html, raw_before; +function define($$self, $$props) { + let { comments, elapsed, time, foo } = $$props; - return { - c() { - div = createElement("div"); - strong = createElement("strong"); - text0 = createText(ctx.i); - text1 = createText("\n\n\t\t"); - span = createElement("span"); - text2 = createText(text2_value); - text3 = createText(" wrote "); - text4 = createText(text4_value); - text5 = createText(" ago:"); - text6 = createText("\n\n\t\t"); - raw_before = createElement('noscript'); - span.className = "meta"; - div.className = "comment"; - }, + $$self.$$.get = () => ({ comments, elapsed, time, foo }); - m(target, anchor) { - insert(target, div, anchor); - append(div, strong); - append(strong, text0); - append(div, text1); - append(div, span); - append(span, text2); - append(span, text3); - append(span, text4); - append(span, text5); - append(div, text6); - append(div, raw_before); - raw_before.insertAdjacentHTML("afterend", raw_value); - }, + $$self.$$.set = $$props => { + if ('comments' in $$props) comments = $$props.comments; + if ('elapsed' in $$props) elapsed = $$props.elapsed; + if ('time' in $$props) time = $$props.time; + if ('foo' in $$props) foo = $$props.foo; + }; +} - p(changed, ctx) { - if ((changed.comments) && text2_value !== (text2_value = ctx.comment.author)) { - setData(text2, text2_value); - } +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - if ((changed.elapsed || changed.comments || changed.time) && text4_value !== (text4_value = ctx.elapsed(ctx.comment.time, ctx.time))) { - setData(text4, text4_value); - } + get comments() { + return this.$$.get().comments; + } - if ((changed.comments) && raw_value !== (raw_value = ctx.comment.html)) { - detachAfter(raw_before); - raw_before.insertAdjacentHTML("afterend", raw_value); - } - }, + set comments(value) { + this.$set({ comments: value }); + flush(); + } - d(detach) { - if (detach) { - detachNode(div); - } - } - }; -} + get elapsed() { + return this.$$.get().elapsed; + } + + set elapsed(value) { + this.$set({ elapsed: value }); + flush(); + } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; + get time() { + return this.$$.get().time; + } - this._fragment = create_main_fragment(this, this._state); + set time(value) { + this.$set({ time: value }); + flush(); + } + + get foo() { + return this.$$.get().foo; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set foo(value) { + this.$set({ foo: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js index d469562fa..9b6bf69e6 100644 --- a/test/js/samples/each-block-keyed-animated/expected.js +++ b/test/js/samples/each-block-keyed-animated/expected.js @@ -1,19 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { append, assign, blankObject, createComment, createElement, createText, detachNode, fixAndOutroAndDestroyBlock, fixPosition, init, insert, proto, setData, updateKeyedEach, wrapAnimation } from "svelte/shared.js"; - -function foo(node, animation, params) { - const dx = animation.from.left - animation.to.left; - const dy = animation.from.top - animation.to.top; - - return { - delay: params.delay, - duration: 100, - tick: (t, u) => { - node.dx = u * dx; - node.dy = u * dy; - } - }; -}; +import { SvelteComponent as SvelteComponent_1, append, blankObject, createComment, createElement, createText, detachNode, fixAndOutroAndDestroyBlock, fixPosition, flush, init, insert, run, safe_not_equal, setData, updateKeyedEach, wrapAnimation } from "svelte/internal.js"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); @@ -21,8 +7,56 @@ function get_each_context(ctx, list, i) { return child_ctx; } -function create_main_fragment(component, ctx) { - var each_blocks_1 = [], each_lookup = blankObject(), each_anchor; +// (19:0) {#each things as thing (thing.id)} +function create_each_block(component, key_1, ctx) { + var div, text_value = ctx.thing.name, text, rect, animation; + + return { + key: key_1, + + first: null, + + c() { + div = createElement("div"); + text = createText(text_value); + this.first = div; + }, + + m(target, anchor) { + insert(target, div, anchor); + append(div, text); + }, + + p(changed, ctx) { + if ((changed.things) && text_value !== (text_value = ctx.thing.name)) { + setData(text, text_value); + } + }, + + r() { + rect = div.getBoundingClientRect(); + }, + + f() { + fixPosition(div); + if (animation) animation.stop(); + }, + + a() { + if (animation) animation.stop(); + animation = wrapAnimation(div, rect, foo, {}); + }, + + d(detach) { + if (detach) { + detachNode(div); + } + } + }; +} + +function create_fragment(component, ctx) { + var each_blocks_1 = [], each_lookup = blankObject(), each_anchor, current; var each_value = ctx.things; @@ -45,6 +79,7 @@ function create_main_fragment(component, ctx) { for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].m(target, anchor); insert(target, each_anchor, anchor); + current = true; }, p(changed, ctx) { @@ -54,6 +89,13 @@ function create_main_fragment(component, ctx) { for (let i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].a(); }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].d(detach); @@ -64,66 +106,44 @@ function create_main_fragment(component, ctx) { }; } -// (1:0) {#each things as thing (thing.id)} -function create_each_block(component, key_1, ctx) { - var div, text_value = ctx.thing.name, text, rect, animation; +function foo(node, animation, params) { + const dx = animation.from.left - animation.to.left; + const dy = animation.from.top - animation.to.top; return { - key: key_1, - - first: null, - - c() { - div = createElement("div"); - text = createText(text_value); - this.first = div; - }, - - m(target, anchor) { - insert(target, div, anchor); - append(div, text); - }, - - p(changed, ctx) { - if ((changed.things) && text_value !== (text_value = ctx.thing.name)) { - setData(text, text_value); - } - }, - - r() { - rect = div.getBoundingClientRect(); - }, + delay: params.delay, + duration: 100, + tick: (t, u) => { + node.dx = u * dx; + node.dy = u * dy; + } + }; +} - f() { - fixPosition(div); - if (animation) animation.stop(); - }, +function define($$self, $$props) { + let { things } = $$props; - a() { - if (animation) animation.stop(); - animation = wrapAnimation(div, rect, foo, {}); - }, + $$self.$$.get = () => ({ things }); - d(detach) { - if (detach) { - detachNode(div); - } - } + $$self.$$.set = $$props => { + if ('things' in $$props) things = $$props.things; }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get things() { + return this.$$.get().things; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set things(value) { + this.$set({ things: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/each-block-keyed-animated/input.html b/test/js/samples/each-block-keyed-animated/input.html index 8c2e2f872..53bcb463b 100644 --- a/test/js/samples/each-block-keyed-animated/input.html +++ b/test/js/samples/each-block-keyed-animated/input.html @@ -1,23 +1,21 @@ -{#each things as thing (thing.id)} -
    {thing.name}
    -{/each} - \ No newline at end of file + }; + } + + +{#each things as thing (thing.id)} +
    {thing.name}
    +{/each} \ No newline at end of file diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js index 94fce5580..c6cc65ae4 100644 --- a/test/js/samples/each-block-keyed/expected.js +++ b/test/js/samples/each-block-keyed/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { append, assign, blankObject, createComment, createElement, createText, destroyBlock, detachNode, init, insert, proto, setData, updateKeyedEach } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, append, blankObject, createComment, createElement, createText, destroyBlock, detachNode, flush, init, insert, run, safe_not_equal, setData, updateKeyedEach } from "svelte/internal.js"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); @@ -7,8 +7,42 @@ function get_each_context(ctx, list, i) { return child_ctx; } -function create_main_fragment(component, ctx) { - var each_blocks_1 = [], each_lookup = blankObject(), each_anchor; +// (1:0) {#each things as thing (thing.id)} +function create_each_block(component, key_1, ctx) { + var div, text_value = ctx.thing.name, text; + + return { + key: key_1, + + first: null, + + c() { + div = createElement("div"); + text = createText(text_value); + this.first = div; + }, + + m(target, anchor) { + insert(target, div, anchor); + append(div, text); + }, + + p(changed, ctx) { + if ((changed.things) && text_value !== (text_value = ctx.thing.name)) { + setData(text, text_value); + } + }, + + d(detach) { + if (detach) { + detachNode(div); + } + } + }; +} + +function create_fragment(component, ctx) { + var each_blocks_1 = [], each_lookup = blankObject(), each_anchor, current; var each_value = ctx.things; @@ -31,6 +65,7 @@ function create_main_fragment(component, ctx) { for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].m(target, anchor); insert(target, each_anchor, anchor); + current = true; }, p(changed, ctx) { @@ -38,6 +73,13 @@ function create_main_fragment(component, ctx) { each_blocks_1 = updateKeyedEach(each_blocks_1, component, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, destroyBlock, create_each_block, "m", each_anchor, get_each_context); }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].d(detach); @@ -48,52 +90,30 @@ function create_main_fragment(component, ctx) { }; } -// (1:0) {#each things as thing (thing.id)} -function create_each_block(component, key_1, ctx) { - var div, text_value = ctx.thing.name, text; - - return { - key: key_1, - - first: null, - - c() { - div = createElement("div"); - text = createText(text_value); - this.first = div; - }, - - m(target, anchor) { - insert(target, div, anchor); - append(div, text); - }, +function define($$self, $$props) { + let { things } = $$props; - p(changed, ctx) { - if ((changed.things) && text_value !== (text_value = ctx.thing.name)) { - setData(text, text_value); - } - }, + $$self.$$.get = () => ({ things }); - d(detach) { - if (detach) { - detachNode(div); - } - } + $$self.$$.set = $$props => { + if ('things' in $$props) things = $$props.things; }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get things() { + return this.$$.get().things; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set things(value) { + this.$set({ things: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/event-handlers-custom/expected.js b/test/js/samples/event-handlers-custom/expected.js deleted file mode 100644 index 7ae23e883..000000000 --- a/test/js/samples/event-handlers-custom/expected.js +++ /dev/null @@ -1,60 +0,0 @@ -/* generated by Svelte vX.Y.Z */ -import { assign, createElement, detachNode, init, insert, proto } from "svelte/shared.js"; - -function foo( node, callback ) { - // code goes here -}; - -var methods = { - foo ( bar ) { - console.log( bar ); - } -}; - -function create_main_fragment(component, ctx) { - var button, foo_handler; - - return { - c() { - button = createElement("button"); - button.textContent = "foo"; - foo_handler = foo.call(component, button, function(event) { - component.foo( ctx.bar ); - }); - }, - - m(target, anchor) { - insert(target, button, anchor); - }, - - p(changed, _ctx) { - ctx = _ctx; - - }, - - d(detach) { - if (detach) { - detachNode(button); - } - - foo_handler.destroy(); - } - }; -} - -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; - - this._fragment = create_main_fragment(this, this._state); - - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); - } -} - -assign(SvelteComponent.prototype, proto); -assign(SvelteComponent.prototype, methods); -export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/event-handlers-custom/input.html b/test/js/samples/event-handlers-custom/input.html deleted file mode 100644 index 00d79363f..000000000 --- a/test/js/samples/event-handlers-custom/input.html +++ /dev/null @@ -1,16 +0,0 @@ - - - \ No newline at end of file diff --git a/test/js/samples/event-modifiers/expected.js b/test/js/samples/event-modifiers/expected.js index e0b355f21..7050f20f0 100644 --- a/test/js/samples/event-modifiers/expected.js +++ b/test/js/samples/event-modifiers/expected.js @@ -1,36 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { addListener, append, assign, createElement, createText, detachNode, init, insert, noop, proto, removeListener } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, noop, preventDefault, run, run_all, safe_not_equal, stopPropagation } from "svelte/internal.js"; -var methods = { - handleTouchstart() { - // ... - }, - - handleClick() { - // ... - } -}; - -function create_main_fragment(component, ctx) { - var div, button0, text1, button1, text3, button2; - - function click_handler(event) { - event.preventDefault(); - event.stopPropagation(); - component.handleClick(); - } - - function click_handler_1(event) { - component.handleClick(); - } - - function click_handler_2(event) { - component.handleClick(); - } - - function touchstart_handler(event) { - component.handleTouchstart(); - } +function create_fragment(component, ctx) { + var div, button0, text1, button1, text3, button2, current, dispose; return { c() { @@ -43,10 +15,12 @@ function create_main_fragment(component, ctx) { text3 = createText("\n\t"); button2 = createElement("button"); button2.textContent = "or me!"; - addListener(button0, "click", click_handler); - addListener(button1, "click", click_handler_1, { once: true, capture: true }); - addListener(button2, "click", click_handler_2, true); - addListener(div, "touchstart", touchstart_handler, { passive: true }); + dispose = [ + addListener(button0, "click", stopPropagation(preventDefault(handleClick))), + addListener(button1, "click", handleClick, { once: true, capture: true }), + addListener(button2, "click", handleClick, true), + addListener(div, "touchstart", handleTouchstart, { passive: true }) + ]; }, m(target, anchor) { @@ -56,36 +30,41 @@ function create_main_fragment(component, ctx) { append(div, button1); append(div, text3); append(div, button2); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div); } - removeListener(button0, "click", click_handler); - removeListener(button1, "click", click_handler_1, { once: true, capture: true }); - removeListener(button2, "click", click_handler_2, true); - removeListener(div, "touchstart", touchstart_handler, { passive: true }); + run_all(dispose); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function handleTouchstart() { + // ... +} - this._fragment = create_main_fragment(this, this._state); +function handleClick() { + // ... +} - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, noop, create_fragment, safe_not_equal); } } -assign(SvelteComponent.prototype, proto); -assign(SvelteComponent.prototype, methods); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/event-modifiers/input.html b/test/js/samples/event-modifiers/input.html index 4726d96c7..5bbcebb72 100644 --- a/test/js/samples/event-modifiers/input.html +++ b/test/js/samples/event-modifiers/input.html @@ -1,19 +1,15 @@ -
    - - - -
    - - handleClick() { - // ... - } - } - }; - \ No newline at end of file +
    + + + +
    \ No newline at end of file diff --git a/test/js/samples/head-no-whitespace/expected.js b/test/js/samples/head-no-whitespace/expected.js index 9d016e027..4b6d2a1b9 100644 --- a/test/js/samples/head-no-whitespace/expected.js +++ b/test/js/samples/head-no-whitespace/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { append, assign, createElement, detachNode, init, noop, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, init, noop, run, safe_not_equal } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var meta0, meta1; +function create_fragment(component, ctx) { + var meta0, meta1, current; return { c() { @@ -17,10 +17,18 @@ function create_main_fragment(component, ctx) { m(target, anchor) { append(document.head, meta0); append(document.head, meta1); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { detachNode(meta0); detachNode(meta1); @@ -28,18 +36,11 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; - - this._fragment = create_main_fragment(this, this._state); - - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, noop, create_fragment, safe_not_equal); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index d39c77fcc..554392af4 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -1,54 +1,36 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createComment, createElement, detachNode, init, insert, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createComment, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var if_block_anchor; - - function select_block_type(ctx) { - if (ctx.foo) return create_if_block; - return create_else_block; - } - - var current_block_type = select_block_type(ctx); - var if_block = current_block_type(component, ctx); +// (3:0) {:else} +function create_else_block(component, ctx) { + var p; return { c() { - if_block.c(); - if_block_anchor = createComment(); + p = createElement("p"); + p.textContent = "not foo!"; }, m(target, anchor) { - if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); - }, - - p(changed, ctx) { - if (current_block_type !== (current_block_type = select_block_type(ctx))) { - if_block.d(1); - if_block = current_block_type(component, ctx); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } + insert(target, p, anchor); }, d(detach) { - if_block.d(detach); if (detach) { - detachNode(if_block_anchor); + detachNode(p); } } }; } -// (3:0) {:else} -function create_else_block(component, ctx) { +// (1:0) {#if foo} +function create_if_block(component, ctx) { var p; return { c() { p = createElement("p"); - p.textContent = "not foo!"; + p.textContent = "foo!"; }, m(target, anchor) { @@ -63,40 +45,78 @@ function create_else_block(component, ctx) { }; } -// (1:0) {#if foo} -function create_if_block(component, ctx) { - var p; +function create_fragment(component, ctx) { + var if_block_anchor, current; + + function select_block_type(ctx) { + if (ctx.foo) return create_if_block; + return create_else_block; + } + + var current_block_type = select_block_type(ctx); + var if_block = current_block_type(component, ctx); return { c() { - p = createElement("p"); - p.textContent = "foo!"; + if_block.c(); + if_block_anchor = createComment(); }, m(target, anchor) { - insert(target, p, anchor); + if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); + current = true; + }, + + p(changed, ctx) { + if (current_block_type !== (current_block_type = select_block_type(ctx))) { + if_block.d(1); + if_block = current_block_type(component, ctx); + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + }, + + i(target, anchor) { + if (current) return; + this.m(target, anchor); }, + o: run, + d(detach) { + if_block.d(detach); if (detach) { - detachNode(p); + detachNode(if_block_anchor); } } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props) { + let { foo } = $$props; + + $$self.$$.get = () => ({ foo }); - this._fragment = create_main_fragment(this, this._state); + $$self.$$.set = $$props => { + if ('foo' in $$props) foo = $$props.foo; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get foo() { + return this.$$.get().foo; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set foo(value) { + this.$set({ foo: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index 1592464f9..da53b9b6a 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -1,8 +1,30 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createComment, createElement, detachNode, init, insert, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createComment, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var if_block_anchor; +// (1:0) {#if foo} +function create_if_block(component, ctx) { + var p; + + return { + c() { + p = createElement("p"); + p.textContent = "foo!"; + }, + + m(target, anchor) { + insert(target, p, anchor); + }, + + d(detach) { + if (detach) { + detachNode(p); + } + } + }; +} + +function create_fragment(component, ctx) { + var if_block_anchor, current; var if_block = (ctx.foo) && create_if_block(component, ctx); @@ -15,6 +37,7 @@ function create_main_fragment(component, ctx) { m(target, anchor) { if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); + current = true; }, p(changed, ctx) { @@ -30,6 +53,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (if_block) if_block.d(detach); if (detach) { @@ -39,40 +69,30 @@ function create_main_fragment(component, ctx) { }; } -// (1:0) {#if foo} -function create_if_block(component, ctx) { - var p; - - return { - c() { - p = createElement("p"); - p.textContent = "foo!"; - }, +function define($$self, $$props) { + let { foo } = $$props; - m(target, anchor) { - insert(target, p, anchor); - }, + $$self.$$.get = () => ({ foo }); - d(detach) { - if (detach) { - detachNode(p); - } - } + $$self.$$.set = $$props => { + if ('foo' in $$props) foo = $$props.foo; }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get foo() { + return this.$$.get().foo; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set foo(value) { + this.$set({ foo: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index 2768d3c8d..1add4c0b5 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createElement, detachNode, init, insert, proto, setStyle } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, run, safe_not_equal, setStyle } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var div; +function create_fragment(component, ctx) { + var div, current; return { c() { @@ -13,6 +13,7 @@ function create_main_fragment(component, ctx) { m(target, anchor) { insert(target, div, anchor); + current = true; }, p(changed, ctx) { @@ -25,6 +26,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div); @@ -33,18 +41,50 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props) { + let { color, x, y } = $$props; + + $$self.$$.get = () => ({ color, x, y }); + + $$self.$$.set = $$props => { + if ('color' in $$props) color = $$props.color; + if ('x' in $$props) x = $$props.x; + if ('y' in $$props) y = $$props.y; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get color() { + return this.$$.get().color; + } - this._fragment = create_main_fragment(this, this._state); + set color(value) { + this.$set({ color: value }); + flush(); + } + + get x() { + return this.$$.get().x; + } + + set x(value) { + this.$set({ x: value }); + flush(); + } + + get y() { + return this.$$.get().y; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set y(value) { + this.$set({ y: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index 5257071ee..74e4ce343 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createElement, detachNode, init, insert, proto, setStyle } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, run, safe_not_equal, setStyle } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var div; +function create_fragment(component, ctx) { + var div, current; return { c() { @@ -12,6 +12,7 @@ function create_main_fragment(component, ctx) { m(target, anchor) { insert(target, div, anchor); + current = true; }, p(changed, ctx) { @@ -20,6 +21,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div); @@ -28,18 +36,30 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props) { + let { data } = $$props; + + $$self.$$.get = () => ({ data }); + + $$self.$$.set = $$props => { + if ('data' in $$props) data = $$props.data; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get data() { + return this.$$.get().data; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set data(value) { + this.$set({ data: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index 4765fe8cb..21d07e81f 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createElement, detachNode, init, insert, proto, setStyle } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, run, safe_not_equal, setStyle } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var div; +function create_fragment(component, ctx) { + var div, current; return { c() { @@ -12,6 +12,7 @@ function create_main_fragment(component, ctx) { m(target, anchor) { insert(target, div, anchor); + current = true; }, p(changed, ctx) { @@ -20,6 +21,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div); @@ -28,18 +36,30 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props) { + let { color } = $$props; + + $$self.$$.get = () => ({ color }); + + $$self.$$.set = $$props => { + if ('color' in $$props) color = $$props.color; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get color() { + return this.$$.get().color; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set color(value) { + this.$set({ color: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index fd7ba4103..25e4f6518 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createElement, createText, detachNode, init, insert, proto } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var div0, text, div1, div1_style_value; +function create_fragment(component, ctx) { + var div0, text, div1, div1_style_value, current; return { c() { @@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) { insert(target, div0, anchor); insert(target, text, anchor); insert(target, div1, anchor); + current = true; }, p(changed, ctx) { @@ -29,6 +30,13 @@ function create_main_fragment(component, ctx) { } }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(div0); @@ -39,18 +47,50 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props) { + let { style, key, value } = $$props; + + $$self.$$.get = () => ({ style, key, value }); + + $$self.$$.set = $$props => { + if ('style' in $$props) style = $$props.style; + if ('key' in $$props) key = $$props.key; + if ('value' in $$props) value = $$props.value; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get style() { + return this.$$.get().style; + } - this._fragment = create_main_fragment(this, this._state); + set style(value) { + this.$set({ style: value }); + flush(); + } + + get key() { + return this.$$.get().key; + } + + set key(value) { + this.$set({ key: value }); + flush(); + } + + get value() { + return this.$$.get().value; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set value(value) { + this.$set({ value: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/input-files/expected.js b/test/js/samples/input-files/expected.js index 028e15bd2..86fa17198 100644 --- a/test/js/samples/input-files/expected.js +++ b/test/js/samples/input-files/expected.js @@ -1,55 +1,75 @@ /* generated by Svelte vX.Y.Z */ -import { addListener, assign, createElement, detachNode, init, insert, proto, removeListener, setAttribute } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var input, input_updating = false; - - function input_input_handler() { - input_updating = true; - component.set({ files: input.files }); - input_updating = false; - } +function create_fragment(component, ctx) { + var input, input_updating = false, current, dispose; return { c() { input = createElement("input"); - addListener(input, "input", input_input_handler); setAttribute(input, "type", "file"); input.multiple = true; + dispose = addListener(input, "input", ctx.input_input_handler); }, m(target, anchor) { insert(target, input, anchor); input.files = ctx.files; + + current = true; }, p(changed, ctx) { if (!input_updating && changed.files) input.files = ctx.files; }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(input); } - removeListener(input, "input", input_input_handler); + dispose(); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props, $$make_dirty) { + let { files } = $$props; - this._fragment = create_main_fragment(this, this._state); + function input_input_handler() { + files = this.files; + $$make_dirty('files'); + } + + $$self.$$.get = () => ({ files, input_input_handler }); + + $$self.$$.set = $$props => { + if ('files' in $$props) files = $$props.files; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get files() { + return this.$$.get().files; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set files(value) { + this.$set({ files: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/input-range/expected.js b/test/js/samples/input-range/expected.js index bb430b0e9..e7719faaa 100644 --- a/test/js/samples/input-range/expected.js +++ b/test/js/samples/input-range/expected.js @@ -1,54 +1,78 @@ /* generated by Svelte vX.Y.Z */ -import { addListener, assign, createElement, detachNode, init, insert, proto, removeListener, setAttribute, toNumber } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, run, run_all, safe_not_equal, setAttribute, toNumber } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var input; - - function input_change_input_handler() { - component.set({ value: toNumber(input.value) }); - } +function create_fragment(component, ctx) { + var input, current, dispose; return { c() { input = createElement("input"); - addListener(input, "change", input_change_input_handler); - addListener(input, "input", input_change_input_handler); setAttribute(input, "type", "range"); + + dispose = [ + addListener(input, "change", ctx.input_change_input_handler), + addListener(input, "input", ctx.input_change_input_handler) + ]; }, m(target, anchor) { insert(target, input, anchor); input.value = ctx.value; + + current = true; }, p(changed, ctx) { if (changed.value) input.value = ctx.value; }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(input); } - removeListener(input, "change", input_change_input_handler); - removeListener(input, "input", input_change_input_handler); + run_all(dispose); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props, $$make_dirty) { + let { value } = $$props; + + function input_change_input_handler() { + value = toNumber(this.value); + $$make_dirty('value'); + } + + $$self.$$.get = () => ({ value, input_change_input_handler }); + + $$self.$$.set = $$props => { + if ('value' in $$props) value = $$props.value; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - this._fragment = create_main_fragment(this, this._state); + get value() { + return this.$$.get().value; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set value(value) { + this.$set({ value: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index cff06b1e6..12d3fb41a 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -1,52 +1,74 @@ /* generated by Svelte vX.Y.Z */ -import { addListener, assign, createElement, detachNode, init, insert, proto, removeListener, setAttribute } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var input; - - function input_change_handler() { - component.set({ foo: input.checked }); - } +function create_fragment(component, ctx) { + var input, current, dispose; return { c() { input = createElement("input"); - addListener(input, "change", input_change_handler); setAttribute(input, "type", "checkbox"); + dispose = addListener(input, "change", ctx.input_change_handler); }, m(target, anchor) { insert(target, input, anchor); input.checked = ctx.foo; + + current = true; }, p(changed, ctx) { if (changed.foo) input.checked = ctx.foo; }, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(input); } - removeListener(input, "change", input_change_handler); + dispose(); } }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; +function define($$self, $$props, $$make_dirty) { + let { foo } = $$props; - this._fragment = create_main_fragment(this, this._state); + function input_change_handler() { + foo = this.checked; + $$make_dirty('foo'); + } + + $$self.$$.get = () => ({ foo, input_change_handler }); + + $$self.$$.set = $$props => { + if ('foo' in $$props) foo = $$props.foo; + }; +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } + + get foo() { + return this.$$.get().foo; + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + set foo(value) { + this.$set({ foo: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/input-without-blowback-guard/input.html b/test/js/samples/input-without-blowback-guard/input.html index ae28ef4f7..991c5e33a 100644 --- a/test/js/samples/input-without-blowback-guard/input.html +++ b/test/js/samples/input-without-blowback-guard/input.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/test/js/samples/instrumentation-script-if-no-block/expected.js b/test/js/samples/instrumentation-script-if-no-block/expected.js new file mode 100644 index 000000000..8ccf2cbbb --- /dev/null +++ b/test/js/samples/instrumentation-script-if-no-block/expected.js @@ -0,0 +1,69 @@ +/* generated by Svelte vX.Y.Z */ +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; + +function create_fragment(component, ctx) { + var button, text1, p, text2, text3, current, dispose; + + return { + c() { + button = createElement("button"); + button.textContent = "foo"; + text1 = createText("\n\n"); + p = createElement("p"); + text2 = createText("x: "); + text3 = createText(ctx.x); + dispose = addListener(button, "click", ctx.foo); + }, + + m(target, anchor) { + insert(target, button, anchor); + insert(target, text1, anchor); + insert(target, p, anchor); + append(p, text2); + append(p, text3); + current = true; + }, + + p(changed, ctx) { + if (changed.x) { + setData(text3, ctx.x); + } + }, + + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + + d(detach) { + if (detach) { + detachNode(button); + detachNode(text1); + detachNode(p); + } + + dispose(); + } + }; +} + +function define($$self, $$props, $$make_dirty) { + let x = 0; + + function foo() { + if (true) { x += 1; $$make_dirty('x'); } + } + + $$self.$$.get = () => ({ x, foo }); +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } +} + +export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/instrumentation-script-if-no-block/input.html b/test/js/samples/instrumentation-script-if-no-block/input.html new file mode 100644 index 000000000..59184bafd --- /dev/null +++ b/test/js/samples/instrumentation-script-if-no-block/input.html @@ -0,0 +1,11 @@ + + + + +

    x: {x}

    \ No newline at end of file diff --git a/test/js/samples/instrumentation-script-x-equals-x/expected.js b/test/js/samples/instrumentation-script-x-equals-x/expected.js new file mode 100644 index 000000000..e34525d97 --- /dev/null +++ b/test/js/samples/instrumentation-script-x-equals-x/expected.js @@ -0,0 +1,70 @@ +/* generated by Svelte vX.Y.Z */ +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; + +function create_fragment(component, ctx) { + var button, text1, p, text2, text3_value = ctx.things.length, text3, current, dispose; + + return { + c() { + button = createElement("button"); + button.textContent = "foo"; + text1 = createText("\n\n"); + p = createElement("p"); + text2 = createText("number of things: "); + text3 = createText(text3_value); + dispose = addListener(button, "click", ctx.foo); + }, + + m(target, anchor) { + insert(target, button, anchor); + insert(target, text1, anchor); + insert(target, p, anchor); + append(p, text2); + append(p, text3); + current = true; + }, + + p(changed, ctx) { + if ((changed.things) && text3_value !== (text3_value = ctx.things.length)) { + setData(text3, text3_value); + } + }, + + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + + d(detach) { + if (detach) { + detachNode(button); + detachNode(text1); + detachNode(p); + } + + dispose(); + } + }; +} + +function define($$self, $$props, $$make_dirty) { + let things = []; + + function foo() { + things.push(1); + $$make_dirty('things'); + } + + $$self.$$.get = () => ({ things, foo }); +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } +} + +export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/instrumentation-script-x-equals-x/input.html b/test/js/samples/instrumentation-script-x-equals-x/input.html new file mode 100644 index 000000000..0873e9fa8 --- /dev/null +++ b/test/js/samples/instrumentation-script-x-equals-x/input.html @@ -0,0 +1,12 @@ + + + + +

    number of things: {things.length}

    \ No newline at end of file diff --git a/test/js/samples/instrumentation-template-if-no-block/expected.js b/test/js/samples/instrumentation-template-if-no-block/expected.js new file mode 100644 index 000000000..5c8742f12 --- /dev/null +++ b/test/js/samples/instrumentation-template-if-no-block/expected.js @@ -0,0 +1,69 @@ +/* generated by Svelte vX.Y.Z */ +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; + +function create_fragment(component, ctx) { + var button, text1, p, text2, text3, current, dispose; + + return { + c() { + button = createElement("button"); + button.textContent = "foo"; + text1 = createText("\n\n"); + p = createElement("p"); + text2 = createText("x: "); + text3 = createText(ctx.x); + dispose = addListener(button, "click", ctx.click_handler); + }, + + m(target, anchor) { + insert(target, button, anchor); + insert(target, text1, anchor); + insert(target, p, anchor); + append(p, text2); + append(p, text3); + current = true; + }, + + p(changed, ctx) { + if (changed.x) { + setData(text3, ctx.x); + } + }, + + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + + d(detach) { + if (detach) { + detachNode(button); + detachNode(text1); + detachNode(p); + } + + dispose(); + } + }; +} + +function define($$self, $$props, $$make_dirty) { + let x = 0; + + function click_handler() { + if (true) { x += 1; $$make_dirty('x'); } + } + + $$self.$$.get = () => ({ x, click_handler }); +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } +} + +export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/instrumentation-template-if-no-block/input.html b/test/js/samples/instrumentation-template-if-no-block/input.html new file mode 100644 index 000000000..5115544bc --- /dev/null +++ b/test/js/samples/instrumentation-template-if-no-block/input.html @@ -0,0 +1,9 @@ + + + + +

    x: {x}

    \ No newline at end of file diff --git a/test/js/samples/instrumentation-template-x-equals-x/expected.js b/test/js/samples/instrumentation-template-x-equals-x/expected.js new file mode 100644 index 000000000..15a1994cf --- /dev/null +++ b/test/js/samples/instrumentation-template-x-equals-x/expected.js @@ -0,0 +1,67 @@ +/* generated by Svelte vX.Y.Z */ +import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, run, safe_not_equal, setData } from "svelte/internal.js"; + +function create_fragment(component, ctx) { + var button, text1, p, text2, text3_value = ctx.things.length, text3, current, dispose; + + return { + c() { + button = createElement("button"); + button.textContent = "foo"; + text1 = createText("\n\n"); + p = createElement("p"); + text2 = createText("number of things: "); + text3 = createText(text3_value); + dispose = addListener(button, "click", ctx.click_handler); + }, + + m(target, anchor) { + insert(target, button, anchor); + insert(target, text1, anchor); + insert(target, p, anchor); + append(p, text2); + append(p, text3); + current = true; + }, + + p(changed, ctx) { + if ((changed.things) && text3_value !== (text3_value = ctx.things.length)) { + setData(text3, text3_value); + } + }, + + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + + d(detach) { + if (detach) { + detachNode(button); + detachNode(text1); + detachNode(p); + } + + dispose(); + } + }; +} + +function define($$self, $$props, $$make_dirty) { + let things = []; + + function click_handler() { things.push(1); $$make_dirty('things') } + + $$self.$$.get = () => ({ things, click_handler }); +} + +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } +} + +export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/instrumentation-template-x-equals-x/input.html b/test/js/samples/instrumentation-template-x-equals-x/input.html new file mode 100644 index 000000000..bfd4a480d --- /dev/null +++ b/test/js/samples/instrumentation-template-x-equals-x/input.html @@ -0,0 +1,7 @@ + + + + +

    number of things: {things.length}

    \ No newline at end of file diff --git a/test/js/samples/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js index d44b78983..5dde73166 100644 --- a/test/js/samples/legacy-input-type/expected.js +++ b/test/js/samples/legacy-input-type/expected.js @@ -1,8 +1,8 @@ /* generated by Svelte vX.Y.Z */ -import { assign, createElement, detachNode, init, insert, noop, proto, setInputType } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, createElement, detachNode, init, insert, noop, run, safe_not_equal, setInputType } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var input; +function create_fragment(component, ctx) { + var input, current; return { c() { @@ -12,10 +12,18 @@ function create_main_fragment(component, ctx) { m(target, anchor) { insert(target, input, anchor); + current = true; }, p: noop, + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + d(detach) { if (detach) { detachNode(input); @@ -24,18 +32,11 @@ function create_main_fragment(component, ctx) { }; } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; - - this._fragment = create_main_fragment(this, this._state); - - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, noop, create_fragment, safe_not_equal); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 657104930..d934df9f4 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -1,99 +1,193 @@ /* generated by Svelte vX.Y.Z */ -import { addListener, assign, createElement, detachNode, flush, init, insert, proto, removeListener, timeRangesToArray } from "svelte/shared.js"; +import { SvelteComponent as SvelteComponent_1, addListener, add_render_callback, createElement, detachNode, flush, init, insert, run, run_all, safe_not_equal, timeRangesToArray } from "svelte/internal.js"; -function create_main_fragment(component, ctx) { - var audio, audio_is_paused = true, audio_updating = false, audio_animationframe; +function create_fragment(component, ctx) { + var audio, audio_is_paused = true, audio_updating = false, audio_animationframe, current, dispose; + + return { + c() { + audio = createElement("audio"); + if (ctx.played === void 0 || ctx.currentTime === void 0) add_render_callback(() => ctx.audio_timeupdate_handler.call(audio)); + if (ctx.duration === void 0) add_render_callback(() => ctx.audio_durationchange_handler.call(audio)); + if (ctx.buffered === void 0) add_render_callback(() => ctx.audio_progress_handler.call(audio)); + if (ctx.buffered === void 0 || ctx.seekable === void 0) add_render_callback(() => ctx.audio_loadedmetadata_handler.call(audio)); + + dispose = [ + addListener(audio, "timeupdate", ctx.audio_timeupdate_handler), + addListener(audio, "durationchange", ctx.audio_durationchange_handler), + addListener(audio, "play", ctx.audio_play_pause_handler), + addListener(audio, "pause", ctx.audio_play_pause_handler), + addListener(audio, "progress", ctx.audio_progress_handler), + addListener(audio, "loadedmetadata", ctx.audio_loadedmetadata_handler), + addListener(audio, "volumechange", ctx.audio_volumechange_handler) + ]; + }, + + m(target, anchor) { + insert(target, audio, anchor); + + audio.volume = ctx.volume; + + current = true; + }, + + p(changed, ctx) { + if (!audio_updating && !isNaN(ctx.currentTime) && changed.currentTime) audio.currentTime = ctx.currentTime; + if (!audio_updating && audio_is_paused !== (audio_is_paused = ctx.paused) && changed.paused) audio[audio_is_paused ? "pause" : "play"](); + if (!audio_updating && !isNaN(ctx.volume) && changed.volume) audio.volume = ctx.volume; + }, + + i(target, anchor) { + if (current) return; + this.m(target, anchor); + }, + + o: run, + + d(detach) { + if (detach) { + detachNode(audio); + } + + run_all(dispose); + } + }; +} + +function define($$self, $$props, $$make_dirty) { + let { buffered, seekable, played, currentTime, duration, paused, volume } = $$props; function audio_timeupdate_handler() { cancelAnimationFrame(audio_animationframe); if (!audio.paused) audio_animationframe = requestAnimationFrame(audio_timeupdate_handler); - audio_updating = true; - component.set({ played: timeRangesToArray(audio.played), currentTime: audio.currentTime }); - audio_updating = false; + played = timeRangesToArray(this.played); + currentTime = this.currentTime; + $$make_dirty('played'); + $$make_dirty('currentTime'); } function audio_durationchange_handler() { - component.set({ duration: audio.duration }); + duration = this.duration; + $$make_dirty('duration'); } function audio_play_pause_handler() { - audio_updating = true; - component.set({ paused: audio.paused }); - audio_updating = false; + paused = this.paused; + $$make_dirty('paused'); } function audio_progress_handler() { - component.set({ buffered: timeRangesToArray(audio.buffered) }); + buffered = timeRangesToArray(this.buffered); + $$make_dirty('buffered'); } function audio_loadedmetadata_handler() { - component.set({ buffered: timeRangesToArray(audio.buffered), seekable: timeRangesToArray(audio.seekable) }); + buffered = timeRangesToArray(this.buffered); + seekable = timeRangesToArray(this.seekable); + $$make_dirty('buffered'); + $$make_dirty('seekable'); } function audio_volumechange_handler() { - audio_updating = true; - component.set({ volume: audio.volume }); - audio_updating = false; + volume = this.volume; + $$make_dirty('volume'); } - return { - c() { - audio = createElement("audio"); - addListener(audio, "timeupdate", audio_timeupdate_handler); - if (!('played' in ctx && 'currentTime' in ctx)) component.root._beforecreate.push(audio_timeupdate_handler); - addListener(audio, "durationchange", audio_durationchange_handler); - if (!('duration' in ctx)) component.root._beforecreate.push(audio_durationchange_handler); - addListener(audio, "play", audio_play_pause_handler); - addListener(audio, "pause", audio_play_pause_handler); - addListener(audio, "progress", audio_progress_handler); - if (!('buffered' in ctx)) component.root._beforecreate.push(audio_progress_handler); - addListener(audio, "loadedmetadata", audio_loadedmetadata_handler); - if (!('buffered' in ctx && 'seekable' in ctx)) component.root._beforecreate.push(audio_loadedmetadata_handler); - addListener(audio, "volumechange", audio_volumechange_handler); - }, + $$self.$$.get = () => ({ + buffered, + seekable, + played, + currentTime, + duration, + paused, + volume, + audio_timeupdate_handler, + audio_durationchange_handler, + audio_play_pause_handler, + audio_progress_handler, + audio_loadedmetadata_handler, + audio_volumechange_handler + }); + + $$self.$$.set = $$props => { + if ('buffered' in $$props) buffered = $$props.buffered; + if ('seekable' in $$props) seekable = $$props.seekable; + if ('played' in $$props) played = $$props.played; + if ('currentTime' in $$props) currentTime = $$props.currentTime; + if ('duration' in $$props) duration = $$props.duration; + if ('paused' in $$props) paused = $$props.paused; + if ('volume' in $$props) volume = $$props.volume; + }; +} - m(target, anchor) { - insert(target, audio, anchor); +class SvelteComponent extends SvelteComponent_1 { + constructor(options) { + super(); + init(this, options, define, create_fragment, safe_not_equal); + } - audio.volume = ctx.volume; - }, + get buffered() { + return this.$$.get().buffered; + } - p(changed, ctx) { - if (!audio_updating && !isNaN(ctx.currentTime ) && changed.currentTime) audio.currentTime = ctx.currentTime ; - if (!audio_updating && audio_is_paused !== (audio_is_paused = ctx.paused ) && changed.paused) audio[audio_is_paused ? "pause" : "play"](); - if (!audio_updating && !isNaN(ctx.volume) && changed.volume) audio.volume = ctx.volume; - }, + set buffered(value) { + this.$set({ buffered: value }); + flush(); + } - d(detach) { - if (detach) { - detachNode(audio); - } + get seekable() { + return this.$$.get().seekable; + } - removeListener(audio, "timeupdate", audio_timeupdate_handler); - removeListener(audio, "durationchange", audio_durationchange_handler); - removeListener(audio, "play", audio_play_pause_handler); - removeListener(audio, "pause", audio_play_pause_handler); - removeListener(audio, "progress", audio_progress_handler); - removeListener(audio, "loadedmetadata", audio_loadedmetadata_handler); - removeListener(audio, "volumechange", audio_volumechange_handler); - } - }; -} + set seekable(value) { + this.$set({ seekable: value }); + flush(); + } -function SvelteComponent(options) { - init(this, options); - this._state = assign({}, options.data); - this._intro = true; + get played() { + return this.$$.get().played; + } - this._fragment = create_main_fragment(this, this._state); + set played(value) { + this.$set({ played: value }); + flush(); + } - if (options.target) { - this._fragment.c(); - this._mount(options.target, options.anchor); + get currentTime() { + return this.$$.get().currentTime; + } + + set currentTime(value) { + this.$set({ currentTime: value }); + flush(); + } + + get duration() { + return this.$$.get().duration; + } + + set duration(value) { + this.$set({ duration: value }); + flush(); + } + + get paused() { + return this.$$.get().paused; + } + + set paused(value) { + this.$set({ paused: value }); + flush(); + } + + get volume() { + return this.$$.get().volume; + } - flush(this); + set volume(value) { + this.$set({ volume: value }); + flush(); } } -assign(SvelteComponent.prototype, proto); export default SvelteComponent; \ No newline at end of file diff --git a/test/js/samples/media-bindings/input.html b/test/js/samples/media-bindings/input.html index e7fe35934..3f7a0b66d 100644 --- a/test/js/samples/media-bindings/input.html +++ b/test/js/samples/media-bindings/input.html @@ -1 +1 @@ -
    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const inputs = [...target.querySelectorAll('input')]; - const items = component.get().items; + const items = component.items; const event = new window.Event('input'); assert.equal(inputs[0].value, 'one'); inputs[1].value = 'four'; - inputs[1].dispatchEvent(event); + await inputs[1].dispatchEvent(event); assert.equal(items[1], 'four'); assert.htmlEqual(target.innerHTML, ` @@ -52,7 +52,7 @@ export default { items[2] = 'five'; - component.set({ items }); + component.items = items; assert.equal(inputs[2].value, 'five'); assert.htmlEqual(target.innerHTML, `
    diff --git a/test/runtime/samples/binding-input-text-contextual/main.html b/test/runtime/samples/binding-input-text-contextual/main.html index 7b3f35244..6b6b57a35 100644 --- a/test/runtime/samples/binding-input-text-contextual/main.html +++ b/test/runtime/samples/binding-input-text-contextual/main.html @@ -1,3 +1,3 @@ {#each items as item} -

    {item}

    -{/each} +

    {item}

    +{/each} \ No newline at end of file diff --git a/test/runtime/samples/binding-input-text-deconflicted/_config.js b/test/runtime/samples/binding-input-text-deconflicted/_config.js index 58c2034c4..46fe3e2a3 100644 --- a/test/runtime/samples/binding-input-text-deconflicted/_config.js +++ b/test/runtime/samples/binding-input-text-deconflicted/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { component: { name: 'world', }, @@ -15,14 +15,14 @@ export default { `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const input = target.querySelector('input'); assert.equal(input.value, 'world'); const event = new window.Event('input'); input.value = 'everybody'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.equal(input.value, 'everybody'); assert.htmlEqual(target.innerHTML, ` @@ -30,7 +30,7 @@ export default { `); - component.set({ component: { name: 'goodbye' } }); + component.component = { name: 'goodbye' }; assert.equal(input.value, 'goodbye'); assert.htmlEqual(target.innerHTML, `

    Hello goodbye!

    diff --git a/test/runtime/samples/binding-input-text-deconflicted/main.html b/test/runtime/samples/binding-input-text-deconflicted/main.html index 9d631bf04..e349b3779 100644 --- a/test/runtime/samples/binding-input-text-deconflicted/main.html +++ b/test/runtime/samples/binding-input-text-deconflicted/main.html @@ -1,2 +1,2 @@

    Hello {component.name}!

    - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/binding-input-text-deep-computed-dynamic/_config.js b/test/runtime/samples/binding-input-text-deep-computed-dynamic/_config.js index 9656d5e1d..eeecdb0ef 100644 --- a/test/runtime/samples/binding-input-text-deep-computed-dynamic/_config.js +++ b/test/runtime/samples/binding-input-text-deep-computed-dynamic/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { prop: 'bar', obj: { foo: 'a', @@ -18,7 +18,7 @@ export default {
    {"foo":"a","bar":"b","baz":"c"}
    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const input = target.querySelector('input'); const event = new window.Event('input'); @@ -26,7 +26,7 @@ export default { // edit bar input.value = 'e'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.htmlEqual(target.innerHTML, ` @@ -34,11 +34,11 @@ export default { `); // edit baz - component.set({ prop: 'baz' }); + component.prop = 'baz'; assert.equal(input.value, 'c'); input.value = 'f'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.htmlEqual(target.innerHTML, ` @@ -46,11 +46,11 @@ export default { `); // edit foo - component.set({ prop: 'foo' }); + component.prop = 'foo'; assert.equal(input.value, 'a'); input.value = 'd'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/binding-input-text-deep-computed-dynamic/main.html b/test/runtime/samples/binding-input-text-deep-computed-dynamic/main.html index d3afde0a7..a6d438c07 100644 --- a/test/runtime/samples/binding-input-text-deep-computed-dynamic/main.html +++ b/test/runtime/samples/binding-input-text-deep-computed-dynamic/main.html @@ -1,2 +1,2 @@ - +
    {JSON.stringify(obj)}
    \ No newline at end of file diff --git a/test/runtime/samples/binding-input-text-deep-computed/_config.js b/test/runtime/samples/binding-input-text-deep-computed/_config.js index 3f314197b..a1ea2c34a 100644 --- a/test/runtime/samples/binding-input-text-deep-computed/_config.js +++ b/test/runtime/samples/binding-input-text-deep-computed/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { prop: 'name', user: { name: 'alice', @@ -16,7 +16,7 @@ export default {

    hello alice

    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const input = target.querySelector('input'); assert.equal(input.value, 'alice'); @@ -24,17 +24,17 @@ export default { const event = new window.Event('input'); input.value = 'bob'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.htmlEqual(target.innerHTML, `

    hello bob

    `); - const user = component.get().user; + const user = component.user; user.name = 'carol'; - component.set({ user }); + component.user = user; assert.equal(input.value, 'carol'); assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/binding-input-text-deep-computed/main.html b/test/runtime/samples/binding-input-text-deep-computed/main.html index 55ad4b53f..3a0df8a13 100644 --- a/test/runtime/samples/binding-input-text-deep-computed/main.html +++ b/test/runtime/samples/binding-input-text-deep-computed/main.html @@ -1,2 +1,2 @@ - -

    hello {user.name}

    + +

    hello {user.name}

    \ No newline at end of file diff --git a/test/runtime/samples/binding-input-text-deep-contextual-computed-dynamic/_config.js b/test/runtime/samples/binding-input-text-deep-contextual-computed-dynamic/_config.js index f6401134c..364195233 100644 --- a/test/runtime/samples/binding-input-text-deep-contextual-computed-dynamic/_config.js +++ b/test/runtime/samples/binding-input-text-deep-contextual-computed-dynamic/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { prop: 'bar', objects: [ { @@ -20,7 +20,7 @@ export default {
    {"foo":"a","bar":"b","baz":"c"}
    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const input = target.querySelector('input'); const event = new window.Event('input'); @@ -28,7 +28,7 @@ export default { // edit bar input.value = 'e'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.htmlEqual(target.innerHTML, ` @@ -36,11 +36,11 @@ export default { `); // edit baz - component.set({ prop: 'baz' }); + component.prop = 'baz'; assert.equal(input.value, 'c'); input.value = 'f'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.htmlEqual(target.innerHTML, ` @@ -48,11 +48,11 @@ export default { `); // edit foo - component.set({ prop: 'foo' }); + component.prop = 'foo'; assert.equal(input.value, 'a'); input.value = 'd'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/binding-input-text-deep-contextual-computed-dynamic/main.html b/test/runtime/samples/binding-input-text-deep-contextual-computed-dynamic/main.html index 1af3bee5b..c4cb5878f 100644 --- a/test/runtime/samples/binding-input-text-deep-contextual-computed-dynamic/main.html +++ b/test/runtime/samples/binding-input-text-deep-contextual-computed-dynamic/main.html @@ -1,4 +1,4 @@ {#each objects as obj} - +
    {JSON.stringify(obj)}
    {/each} \ No newline at end of file diff --git a/test/runtime/samples/binding-input-text-deep-contextual/_config.js b/test/runtime/samples/binding-input-text-deep-contextual/_config.js index 0ca5c10e2..5b6b0d657 100644 --- a/test/runtime/samples/binding-input-text-deep-contextual/_config.js +++ b/test/runtime/samples/binding-input-text-deep-contextual/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { items: [ { description: 'one' }, { description: 'two' }, @@ -19,7 +19,7 @@ export default {

    three

    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const inputs = [...target.querySelectorAll('input')]; assert.equal(inputs[0].value, 'one'); @@ -27,7 +27,7 @@ export default { const event = new window.Event('input'); inputs[1].value = 'four'; - inputs[1].dispatchEvent(event); + await inputs[1].dispatchEvent(event); assert.htmlEqual(target.innerHTML, `

    one

    @@ -35,10 +35,10 @@ export default {

    three

    `); - const items = component.get().items; + const items = component.items; items[2].description = 'five'; - component.set({ items }); + component.items = items; assert.equal(inputs[2].value, 'five'); assert.htmlEqual(target.innerHTML, `

    one

    diff --git a/test/runtime/samples/binding-input-text-deep-contextual/main.html b/test/runtime/samples/binding-input-text-deep-contextual/main.html index 7d21a2ddb..f6a1e7e52 100644 --- a/test/runtime/samples/binding-input-text-deep-contextual/main.html +++ b/test/runtime/samples/binding-input-text-deep-contextual/main.html @@ -1,3 +1,3 @@ {#each items as item} -

    {item.description}

    -{/each} +

    {item.description}

    +{/each} \ No newline at end of file diff --git a/test/runtime/samples/binding-input-text-deep/_config.js b/test/runtime/samples/binding-input-text-deep/_config.js index 886ed528e..e6113510a 100644 --- a/test/runtime/samples/binding-input-text-deep/_config.js +++ b/test/runtime/samples/binding-input-text-deep/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { user: { name: 'alice', }, @@ -15,7 +15,7 @@ export default {

    hello alice

    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const input = target.querySelector('input'); assert.equal(input.value, 'alice'); @@ -23,17 +23,17 @@ export default { const event = new window.Event('input'); input.value = 'bob'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.htmlEqual(target.innerHTML, `

    hello bob

    `); - const user = component.get().user; + const user = component.user; user.name = 'carol'; - component.set({ user }); + component.user = user; assert.equal(input.value, 'carol'); assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/binding-input-text-deep/main.html b/test/runtime/samples/binding-input-text-deep/main.html index f7f7d4dbc..b4cf2b2ef 100644 --- a/test/runtime/samples/binding-input-text-deep/main.html +++ b/test/runtime/samples/binding-input-text-deep/main.html @@ -1,2 +1,2 @@ - -

    hello {user.name}

    + +

    hello {user.name}

    \ No newline at end of file diff --git a/test/runtime/samples/binding-input-text/_config.js b/test/runtime/samples/binding-input-text/_config.js index c7c53e3fe..e7162b615 100644 --- a/test/runtime/samples/binding-input-text/_config.js +++ b/test/runtime/samples/binding-input-text/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { name: 'world', }, @@ -13,21 +13,21 @@ export default {

    hello world

    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const input = target.querySelector('input'); assert.equal(input.value, 'world'); const event = new window.Event('input'); input.value = 'everybody'; - input.dispatchEvent(event); + await input.dispatchEvent(event); assert.htmlEqual(target.innerHTML, `

    hello everybody

    `); - component.set({ name: 'goodbye' }); + component.name = 'goodbye'; assert.equal(input.value, 'goodbye'); assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/binding-input-text/main.html b/test/runtime/samples/binding-input-text/main.html index 143c9054b..733af3474 100644 --- a/test/runtime/samples/binding-input-text/main.html +++ b/test/runtime/samples/binding-input-text/main.html @@ -1,2 +1,2 @@ - -

    hello {name}

    + +

    hello {name}

    \ No newline at end of file diff --git a/test/runtime/samples/binding-input-with-event/_config.js b/test/runtime/samples/binding-input-with-event/_config.js index 1b4736e0a..61cb90ed9 100644 --- a/test/runtime/samples/binding-input-with-event/_config.js +++ b/test/runtime/samples/binding-input-with-event/_config.js @@ -1,20 +1,18 @@ export default { - data: { + props: { a: 42 }, - test ( assert, component, target, window ) { - const input = target.querySelector( 'input' ); - assert.equal( input.value, '42' ); + test({ assert, component, target, window }) { + const input = target.querySelector('input'); + assert.equal(input.value, '42'); - const event = new window.Event( 'input' ); + const event = new window.Event('input'); input.value = 43; - input.dispatchEvent( event ); + input.dispatchEvent(event); - assert.equal( input.value, '43' ); - assert.equal( component.get().a, 43 ); - - component.destroy(); + assert.equal(input.value, '43'); + assert.equal(component.a, 43); } }; diff --git a/test/runtime/samples/binding-input-with-event/main.html b/test/runtime/samples/binding-input-with-event/main.html index 8227cfd6e..8f7ed26f2 100644 --- a/test/runtime/samples/binding-input-with-event/main.html +++ b/test/runtime/samples/binding-input-with-event/main.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/binding-select-implicit-option-value/_config.js b/test/runtime/samples/binding-select-implicit-option-value/_config.js index 3a5098b76..cce1172f6 100644 --- a/test/runtime/samples/binding-select-implicit-option-value/_config.js +++ b/test/runtime/samples/binding-select-implicit-option-value/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { values: [1, 2, 3], foo: 2 }, @@ -24,19 +24,19 @@ export default {

    foo: 2

    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const select = target.querySelector('select'); const options = [...target.querySelectorAll('option')]; assert.ok(options[1].selected); - assert.equal(component.get().foo, 2); + assert.equal(component.foo, 2); const change = new window.Event('change'); options[2].selected = true; - select.dispatchEvent(change); + await select.dispatchEvent(change); - assert.equal(component.get().foo, 3); + assert.equal(component.foo, 3); assert.htmlEqual( target.innerHTML, ` + `, - data: { + props: { items: [{ value: 'hullo' }, { value: 'world' }] }, - test(assert, component, target, window) { + test({ assert, component, target, window }) { const selects = [...target.querySelectorAll('select')]; const change = new window.Event('change'); @@ -25,7 +25,7 @@ export default { selects[1].options[0].selected = true; selects[1].dispatchEvent(change); - assert.deepEqual(component.get().items, [ + assert.deepEqual(component.items, [ { value: 'hullo' }, { value: 'hullo' } ]); } diff --git a/test/runtime/samples/binding-select-in-each-block/main.html b/test/runtime/samples/binding-select-in-each-block/main.html index 68281ebe7..3f6b6c0d3 100644 --- a/test/runtime/samples/binding-select-in-each-block/main.html +++ b/test/runtime/samples/binding-select-in-each-block/main.html @@ -1,5 +1,5 @@ {#each items as item} - diff --git a/test/runtime/samples/binding-select-in-yield/Modal.html b/test/runtime/samples/binding-select-in-yield/Modal.html index ceeece2dd..b106e7b1d 100644 --- a/test/runtime/samples/binding-select-in-yield/Modal.html +++ b/test/runtime/samples/binding-select-in-yield/Modal.html @@ -1,20 +1,11 @@ + + {#if !hidden} -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/binding-select-in-yield/_config.js b/test/runtime/samples/binding-select-in-yield/_config.js index 2503222b8..6c206837e 100644 --- a/test/runtime/samples/binding-select-in-yield/_config.js +++ b/test/runtime/samples/binding-select-in-yield/_config.js @@ -1,12 +1,12 @@ export default { html: ``, - data: { + props: { letter: 'b' }, - test ( assert, component, target, window ) { - component.refs.modal.toggle(); + async test({ assert, component, target, window }) { + await component.modal.toggle(); assert.htmlEqual(target.innerHTML, ` b @@ -22,8 +22,8 @@ export default { const change = new window.MouseEvent('change'); select.options[2].selected = true; - select.dispatchEvent(change); - assert.equal(component.get().letter, 'c'); + await select.dispatchEvent(change); + assert.equal(component.letter, 'c'); assert.deepEqual(Array.from(select.options).map(o => o.selected), [ false, @@ -41,8 +41,8 @@ export default { `); - component.refs.modal.toggle(); - component.refs.modal.toggle(); + await component.modal.toggle(); + await component.modal.toggle(); assert.deepEqual(Array.from(select.options).map(o => o.selected), [ false, diff --git a/test/runtime/samples/binding-select-in-yield/main.html b/test/runtime/samples/binding-select-in-yield/main.html index 3dd21cdc7..38304fba8 100644 --- a/test/runtime/samples/binding-select-in-yield/main.html +++ b/test/runtime/samples/binding-select-in-yield/main.html @@ -1,23 +1,16 @@ + + {letter} - {#each letters as letter} {/each} - - - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/binding-select-initial-value-undefined/_config.js b/test/runtime/samples/binding-select-initial-value-undefined/_config.js index f625000ed..821a8a3c6 100644 --- a/test/runtime/samples/binding-select-initial-value-undefined/_config.js +++ b/test/runtime/samples/binding-select-initial-value-undefined/_config.js @@ -1,5 +1,5 @@ export default { - 'skip-ssr': true, // TODO would be nice to fix this in SSR as well + skip_if_ssr: true, // TODO would be nice to fix this in SSR as well html: `

    selected: a

    @@ -13,13 +13,11 @@ export default {

    selected: a

    `, - test ( assert, component, target ) { - const select = target.querySelector( 'select' ); - const options = [ ...target.querySelectorAll( 'option' ) ]; + test({ assert, component, target }) { + const select = target.querySelector('select'); + const options = [...target.querySelectorAll('option')]; - assert.equal( select.value, 'a' ); - assert.ok( options[0].selected ); - - component.destroy(); + assert.equal(select.value, 'a'); + assert.ok(options[0].selected); } }; diff --git a/test/runtime/samples/binding-select-initial-value-undefined/main.html b/test/runtime/samples/binding-select-initial-value-undefined/main.html index 0f7f90fed..1e4b70df6 100644 --- a/test/runtime/samples/binding-select-initial-value-undefined/main.html +++ b/test/runtime/samples/binding-select-initial-value-undefined/main.html @@ -1,6 +1,6 @@

    selected: {selected}

    - diff --git a/test/runtime/samples/binding-select-initial-value/_config.js b/test/runtime/samples/binding-select-initial-value/_config.js index 4f25aec6e..d98e5d2e1 100644 --- a/test/runtime/samples/binding-select-initial-value/_config.js +++ b/test/runtime/samples/binding-select-initial-value/_config.js @@ -23,17 +23,15 @@ export default {

    selected: b

    `, - data: { + props: { selected: 'b', }, - test(assert, component, target) { + test({ assert, component, target }) { const select = target.querySelector('select'); const options = [...target.querySelectorAll('option')]; assert.equal(select.value, 'b'); assert.ok(options[1].selected); - - component.destroy(); }, }; diff --git a/test/runtime/samples/binding-select-initial-value/main.html b/test/runtime/samples/binding-select-initial-value/main.html index 0f7f90fed..1e4b70df6 100644 --- a/test/runtime/samples/binding-select-initial-value/main.html +++ b/test/runtime/samples/binding-select-initial-value/main.html @@ -1,6 +1,6 @@

    selected: {selected}

    - diff --git a/test/runtime/samples/binding-select-late/_config.js b/test/runtime/samples/binding-select-late/_config.js index 04b94613f..98f53740a 100644 --- a/test/runtime/samples/binding-select-late/_config.js +++ b/test/runtime/samples/binding-select-late/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { items: [], selected: null }, @@ -9,26 +9,22 @@ export default {

    selected: nothing

    `, - test ( assert, component, target ) { - component.set({ - items: [ 'one', 'two', 'three' ], - selected: 'two' - }); + test({ assert, component, target }) { + component.items = [ 'one', 'two', 'three' ]; + component.selected = 'two'; - const options = target.querySelectorAll( 'option' ); - assert.ok( !options[0].selected ); - assert.ok( options[1].selected ); - assert.ok( !options[2].selected ); + const options = target.querySelectorAll('option'); + assert.ok(!options[0].selected); + assert.ok(options[1].selected); + assert.ok(!options[2].selected); - assert.htmlEqual( target.innerHTML, ` + assert.htmlEqual(target.innerHTML, `

    selected: two

    - ` ); - - component.destroy(); + `); } }; diff --git a/test/runtime/samples/binding-select-late/main.html b/test/runtime/samples/binding-select-late/main.html index 2cbbff8b4..6c1d2973a 100644 --- a/test/runtime/samples/binding-select-late/main.html +++ b/test/runtime/samples/binding-select-late/main.html @@ -1,7 +1,7 @@ - {#each items as item} {/each} -

    selected: {selected || 'nothing'}

    +

    selected: {selected || 'nothing'}

    \ No newline at end of file diff --git a/test/runtime/samples/binding-select-multiple/_config.js b/test/runtime/samples/binding-select-multiple/_config.js index e8d6be0dd..e1d21c0ea 100644 --- a/test/runtime/samples/binding-select-multiple/_config.js +++ b/test/runtime/samples/binding-select-multiple/_config.js @@ -1,7 +1,7 @@ export default { skip: true, // JSDOM - data: { + props: { selected: [ 'two', 'three' ] }, @@ -15,7 +15,7 @@ export default {

    selected: two, three

    `, - test ( assert, component, target, window ) { + test({ assert, component, target, window }) { const select = target.querySelector( 'select' ); const options = [ ...target.querySelectorAll( 'option' ) ]; @@ -24,7 +24,7 @@ export default { options[1].selected = false; select.dispatchEvent( change ); - assert.deepEqual( component.get().selected, [ 'three' ] ); + assert.deepEqual( component.selected, [ 'three' ] ); assert.htmlEqual( target.innerHTML, ` @@ -49,7 +49,7 @@ export default {

    selected: one, three

    ` ); - component.set({ selected: [ 'one', 'two' ] }); + component.selected = [ 'one', 'two' ]; assert.ok( options[0].selected ); assert.ok( options[1].selected ); diff --git a/test/runtime/samples/binding-select-multiple/main.html b/test/runtime/samples/binding-select-multiple/main.html index c4d33dc2c..e97c988c4 100644 --- a/test/runtime/samples/binding-select-multiple/main.html +++ b/test/runtime/samples/binding-select-multiple/main.html @@ -1,7 +1,7 @@ - -

    selected: {selected.join( ', ' )}

    +

    selected: {selected.join( ', ' )}

    \ No newline at end of file diff --git a/test/runtime/samples/binding-select-optgroup/_config.js b/test/runtime/samples/binding-select-optgroup/_config.js index b0c64c13a..5927bce90 100644 --- a/test/runtime/samples/binding-select-optgroup/_config.js +++ b/test/runtime/samples/binding-select-optgroup/_config.js @@ -12,19 +12,19 @@ export default { `, - test(assert, component, target, window) { + test({ assert, component, target, window }) { const select = target.querySelector('select'); const options = [...target.querySelectorAll('option')]; assert.deepEqual(options, select.options); - assert.equal(component.get().name, 'Harry'); + assert.equal(component.name, 'Harry'); const change = new window.Event('change'); options[1].selected = true; select.dispatchEvent(change); - assert.equal(component.get().name, 'World'); + assert.equal(component.name, 'World'); assert.htmlEqual(target.innerHTML, `

    Hello World!

    diff --git a/test/runtime/samples/binding-select-optgroup/main.html b/test/runtime/samples/binding-select-optgroup/main.html index c0df0cf8f..0a4ef44eb 100644 --- a/test/runtime/samples/binding-select-optgroup/main.html +++ b/test/runtime/samples/binding-select-optgroup/main.html @@ -1,6 +1,6 @@

    Hello {name}!

    - diff --git a/test/runtime/samples/binding-select/_config.js b/test/runtime/samples/binding-select/_config.js index 7b8142526..6fd7e60b2 100644 --- a/test/runtime/samples/binding-select/_config.js +++ b/test/runtime/samples/binding-select/_config.js @@ -23,23 +23,23 @@ export default {

    selected: one

    `, - data: { + props: { selected: 'one', }, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const select = target.querySelector('select'); const options = [...target.querySelectorAll('option')]; assert.deepEqual(options, select.options); - assert.equal(component.get().selected, 'one'); + assert.equal(component.selected, 'one'); const change = new window.Event('change'); options[1].selected = true; - select.dispatchEvent(change); + await select.dispatchEvent(change); - assert.equal(component.get().selected, 'two'); + assert.equal(component.selected, 'two'); assert.htmlEqual(target.innerHTML, `

    selected: two

    @@ -52,6 +52,6 @@ export default {

    selected: two

    `); - component.set({ selected: 'three' }); + component.selected = 'three'; }, }; diff --git a/test/runtime/samples/binding-select/main.html b/test/runtime/samples/binding-select/main.html index 84795bfa8..caa1a5b3a 100644 --- a/test/runtime/samples/binding-select/main.html +++ b/test/runtime/samples/binding-select/main.html @@ -1,9 +1,9 @@

    selected: {selected}

    - -

    selected: {selected}

    +

    selected: {selected}

    \ No newline at end of file diff --git a/test/runtime/samples/binding-textarea/_config.js b/test/runtime/samples/binding-textarea/_config.js index 742c05e4f..c09256e05 100644 --- a/test/runtime/samples/binding-textarea/_config.js +++ b/test/runtime/samples/binding-textarea/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { value: 'some text', }, @@ -13,21 +13,21 @@ export default {

    some text

    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const textarea = target.querySelector('textarea'); assert.equal(textarea.value, 'some text'); const event = new window.Event('input'); textarea.value = 'hello'; - textarea.dispatchEvent(event); + await textarea.dispatchEvent(event); assert.htmlEqual(target.innerHTML, `

    hello

    `); - component.set({ value: 'goodbye' }); + component.value = 'goodbye'; assert.equal(textarea.value, 'goodbye'); assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/binding-textarea/main.html b/test/runtime/samples/binding-textarea/main.html index 1f3f0caeb..5d4177bf9 100644 --- a/test/runtime/samples/binding-textarea/main.html +++ b/test/runtime/samples/binding-textarea/main.html @@ -1,2 +1,2 @@ -

    {value}

    +

    {value}

    \ No newline at end of file diff --git a/test/runtime/samples/bindings-before-oncreate/One.html b/test/runtime/samples/bindings-before-oncreate/One.html deleted file mode 100644 index 905dd23de..000000000 --- a/test/runtime/samples/bindings-before-oncreate/One.html +++ /dev/null @@ -1,15 +0,0 @@ - - - \ No newline at end of file diff --git a/test/runtime/samples/bindings-before-oncreate/Two.html b/test/runtime/samples/bindings-before-oncreate/Two.html deleted file mode 100644 index a1143a68f..000000000 --- a/test/runtime/samples/bindings-before-oncreate/Two.html +++ /dev/null @@ -1,15 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/bindings-before-oncreate/_config.js b/test/runtime/samples/bindings-before-oncreate/_config.js deleted file mode 100644 index e9e09c678..000000000 --- a/test/runtime/samples/bindings-before-oncreate/_config.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - test(assert, component) { - assert.equal(component.refs.one.snapshot, 2); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/bindings-before-oncreate/main.html b/test/runtime/samples/bindings-before-oncreate/main.html deleted file mode 100644 index 02746ecc5..000000000 --- a/test/runtime/samples/bindings-before-oncreate/main.html +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/test/runtime/samples/bindings-before-onmount/One.html b/test/runtime/samples/bindings-before-onmount/One.html new file mode 100644 index 000000000..b2ba905ec --- /dev/null +++ b/test/runtime/samples/bindings-before-onmount/One.html @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/bindings-before-onmount/Two.html b/test/runtime/samples/bindings-before-onmount/Two.html new file mode 100644 index 000000000..39e379383 --- /dev/null +++ b/test/runtime/samples/bindings-before-onmount/Two.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/test/runtime/samples/bindings-before-onmount/_config.js b/test/runtime/samples/bindings-before-onmount/_config.js new file mode 100644 index 000000000..d21751c52 --- /dev/null +++ b/test/runtime/samples/bindings-before-onmount/_config.js @@ -0,0 +1,5 @@ +export default { + test({ assert, component }) { + assert.equal(component.one.snapshot, 2); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/bindings-before-onmount/main.html b/test/runtime/samples/bindings-before-onmount/main.html new file mode 100644 index 000000000..6bb20cc3f --- /dev/null +++ b/test/runtime/samples/bindings-before-onmount/main.html @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/bindings-coalesced/Foo.html b/test/runtime/samples/bindings-coalesced/Foo.html index 3b6b796cc..7be8cc4f9 100644 --- a/test/runtime/samples/bindings-coalesced/Foo.html +++ b/test/runtime/samples/bindings-coalesced/Foo.html @@ -1,20 +1,12 @@ -

    bar in Foo: {bar}

    -

    baz in Foo: {baz}

    - \ No newline at end of file + export function double() { + bar = bar * 2; + baz = baz * 2; + } + + +

    bar in Foo: {bar}

    +

    baz in Foo: {baz}

    \ No newline at end of file diff --git a/test/runtime/samples/bindings-coalesced/_config.js b/test/runtime/samples/bindings-coalesced/_config.js index 2fe5cbf5c..164d0b42e 100644 --- a/test/runtime/samples/bindings-coalesced/_config.js +++ b/test/runtime/samples/bindings-coalesced/_config.js @@ -1,6 +1,6 @@ export default { - test(assert, component) { - const { foo, p } = component.refs; + async test({ assert, component }) { + const { foo, p } = component; const values = []; @@ -10,8 +10,8 @@ export default { } }); - foo.double(); + await foo.double(); - assert.deepEqual(values, [6]); + assert.deepEqual(values, ['6']); } }; \ No newline at end of file diff --git a/test/runtime/samples/bindings-coalesced/main.html b/test/runtime/samples/bindings-coalesced/main.html index c98ae0f8d..820c1812e 100644 --- a/test/runtime/samples/bindings-coalesced/main.html +++ b/test/runtime/samples/bindings-coalesced/main.html @@ -1,12 +1,12 @@ - -

    {bar + baz}

    - \ No newline at end of file + export let p; + + export let foo; + export let bar; + export let baz; + + + +

    {bar + baz}

    \ No newline at end of file diff --git a/test/runtime/samples/class-boolean/main.html b/test/runtime/samples/class-boolean/main.html index 2595907a6..226476816 100644 --- a/test/runtime/samples/class-boolean/main.html +++ b/test/runtime/samples/class-boolean/main.html @@ -1 +1 @@ -
    +
    \ No newline at end of file diff --git a/test/runtime/samples/class-helper/_config.js b/test/runtime/samples/class-helper/_config.js index 38aed667b..2c4606fbe 100644 --- a/test/runtime/samples/class-helper/_config.js +++ b/test/runtime/samples/class-helper/_config.js @@ -1,14 +1,15 @@ export default { - data: { + props: { user: { active: true } }, + html: `
    `, - test ( assert, component, target, window ) { - component.set({ user: { active: false }}); + test({ assert, component, target, window }) { + component.user = { active: false }; - assert.htmlEqual( target.innerHTML, ` + assert.htmlEqual(target.innerHTML, `
    - ` ); + `); } }; diff --git a/test/runtime/samples/class-helper/main.html b/test/runtime/samples/class-helper/main.html index 8e77da128..c25b58b7f 100644 --- a/test/runtime/samples/class-helper/main.html +++ b/test/runtime/samples/class-helper/main.html @@ -1,11 +1,9 @@ -
    - + +
    \ No newline at end of file diff --git a/test/runtime/samples/class-in-each/_config.js b/test/runtime/samples/class-in-each/_config.js index 124c162e7..9ce2b5db8 100644 --- a/test/runtime/samples/class-in-each/_config.js +++ b/test/runtime/samples/class-in-each/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { things: ['one', 'two', 'three'], selected: 'two' }, @@ -10,8 +10,8 @@ export default {
    `, - test(assert, component, target) { - component.set({ selected: 'three' }); + test({ assert, component, target }) { + component.selected = 'three'; assert.htmlEqual(target.innerHTML, `
    diff --git a/test/runtime/samples/class-in-each/main.html b/test/runtime/samples/class-in-each/main.html index 7b822fa31..4998de3ce 100644 --- a/test/runtime/samples/class-in-each/main.html +++ b/test/runtime/samples/class-in-each/main.html @@ -1,3 +1,3 @@ {#each things as thing} -
    -{/each} +
    +{/each} \ No newline at end of file diff --git a/test/runtime/samples/class-shortcut-with-class/_config.js b/test/runtime/samples/class-shortcut-with-class/_config.js index 2d36b6eab..fc1a00e8a 100644 --- a/test/runtime/samples/class-shortcut-with-class/_config.js +++ b/test/runtime/samples/class-shortcut-with-class/_config.js @@ -1,16 +1,17 @@ export default { - data: { - "is-active": true, - isSelected: true, + props: { + foo: true, + bar: true, myClass: 'one two' }, - html: `
    `, - test ( assert, component, target, window ) { - component.set({ "is-active": false }); + html: `
    `, - assert.htmlEqual( target.innerHTML, ` -
    - ` ); + test({ assert, component, target, window }) { + component.foo = false; + + assert.htmlEqual(target.innerHTML, ` +
    + `); } }; diff --git a/test/runtime/samples/class-shortcut-with-class/main.html b/test/runtime/samples/class-shortcut-with-class/main.html index 8e608c33e..72c1d4f8d 100644 --- a/test/runtime/samples/class-shortcut-with-class/main.html +++ b/test/runtime/samples/class-shortcut-with-class/main.html @@ -1 +1 @@ -
    +
    \ No newline at end of file diff --git a/test/runtime/samples/class-shortcut/_config.js b/test/runtime/samples/class-shortcut/_config.js index 22ccd68b5..e0c8aec3a 100644 --- a/test/runtime/samples/class-shortcut/_config.js +++ b/test/runtime/samples/class-shortcut/_config.js @@ -1,15 +1,16 @@ export default { - data: { - "is-active": true, - isSelected: true + props: { + foo: true, + bar: true }, - html: `
    `, - test ( assert, component, target, window ) { - component.set({ "is-active": false }); + html: `
    `, - assert.htmlEqual( target.innerHTML, ` -
    - ` ); + test({ assert, component, target, window }) { + component.foo = false; + + assert.htmlEqual(target.innerHTML, ` +
    + `); } }; diff --git a/test/runtime/samples/class-shortcut/main.html b/test/runtime/samples/class-shortcut/main.html index 2bd6a32b6..fe14d4de0 100644 --- a/test/runtime/samples/class-shortcut/main.html +++ b/test/runtime/samples/class-shortcut/main.html @@ -1 +1 @@ -
    +
    \ No newline at end of file diff --git a/test/runtime/samples/class-with-attribute/main.html b/test/runtime/samples/class-with-attribute/main.html index c8d9e98f7..abe0b005d 100644 --- a/test/runtime/samples/class-with-attribute/main.html +++ b/test/runtime/samples/class-with-attribute/main.html @@ -1 +1 @@ -
    +
    \ No newline at end of file diff --git a/test/runtime/samples/class-with-dynamic-attribute/_config.js b/test/runtime/samples/class-with-dynamic-attribute/_config.js index 9b65c1955..12c955c24 100644 --- a/test/runtime/samples/class-with-dynamic-attribute/_config.js +++ b/test/runtime/samples/class-with-dynamic-attribute/_config.js @@ -1,14 +1,15 @@ export default { - data: { + props: { myClass: 'one two' }, + html: `
    `, - test ( assert, component, target, window ) { - component.set({ myClass: 'one' }); + test({ assert, component, target, window }) { + component.myClass = 'one'; - assert.htmlEqual( target.innerHTML, ` + assert.htmlEqual(target.innerHTML, `
    - ` ); + `); } }; diff --git a/test/runtime/samples/class-with-dynamic-attribute/main.html b/test/runtime/samples/class-with-dynamic-attribute/main.html index b329f1544..2097c465d 100644 --- a/test/runtime/samples/class-with-dynamic-attribute/main.html +++ b/test/runtime/samples/class-with-dynamic-attribute/main.html @@ -1 +1 @@ -
    +
    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-blowback-b/Nested.html b/test/runtime/samples/component-binding-blowback-b/Nested.html index 7a55118ec..2255fe6e1 100644 --- a/test/runtime/samples/component-binding-blowback-b/Nested.html +++ b/test/runtime/samples/component-binding-blowback-b/Nested.html @@ -1,8 +1,9 @@ -
  • - -
  • - + +
  • + +
  • \ No newline at end of file diff --git a/test/runtime/samples/component-binding-blowback-b/_config.js b/test/runtime/samples/component-binding-blowback-b/_config.js index 7f2bd38d9..69af7917c 100644 --- a/test/runtime/samples/component-binding-blowback-b/_config.js +++ b/test/runtime/samples/component-binding-blowback-b/_config.js @@ -1,7 +1,7 @@ export default { - 'skip-ssr': true, + skip_if_ssr: true, - data: { + props: { count: 3 }, @@ -14,11 +14,11 @@ export default { `, - test (assert, component, target, window) { + async test({ assert, component, target, window }) { const input = target.querySelector('input'); input.value = 4; - input.dispatchEvent(new window.Event('input')); + await input.dispatchEvent(new window.Event('input')); assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/component-binding-blowback-b/main.html b/test/runtime/samples/component-binding-blowback-b/main.html index 301f5b7da..327b64ca0 100644 --- a/test/runtime/samples/component-binding-blowback-b/main.html +++ b/test/runtime/samples/component-binding-blowback-b/main.html @@ -1,33 +1,21 @@ - + + +
      {#each ids as id} - + {id}: value is {idToValue[id]} {/each} -
    - - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-blowback-c/Nested.html b/test/runtime/samples/component-binding-blowback-c/Nested.html index 7a55118ec..2255fe6e1 100644 --- a/test/runtime/samples/component-binding-blowback-c/Nested.html +++ b/test/runtime/samples/component-binding-blowback-c/Nested.html @@ -1,8 +1,9 @@ -
  • - -
  • - + +
  • + +
  • \ No newline at end of file diff --git a/test/runtime/samples/component-binding-blowback-c/_config.js b/test/runtime/samples/component-binding-blowback-c/_config.js index 78c3e915f..b179f1c10 100644 --- a/test/runtime/samples/component-binding-blowback-c/_config.js +++ b/test/runtime/samples/component-binding-blowback-c/_config.js @@ -1,7 +1,7 @@ export default { - 'skip-ssr': true, + skip_if_ssr: true, - data: { + props: { count: 3 }, @@ -14,11 +14,11 @@ export default { `, - test (assert, component, target, window) { + async test({ assert, component, target, window }) { const input = target.querySelector('input'); input.value = 4; - input.dispatchEvent(new window.Event('input')); + await input.dispatchEvent(new window.Event('input')); assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/component-binding-blowback-c/main.html b/test/runtime/samples/component-binding-blowback-c/main.html index 21d69d3c4..136022944 100644 --- a/test/runtime/samples/component-binding-blowback-c/main.html +++ b/test/runtime/samples/component-binding-blowback-c/main.html @@ -1,34 +1,23 @@ - - -
      - {#each ids as object (object.id)} - - {object.id}: value is {idToValue[object.id]} - - {/each} -
    - + + + +
      + {#each ids() as object (object.id)} + + {object.id}: value is {idToValue[object.id]} + + {/each} +
    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-blowback/_config.js b/test/runtime/samples/component-binding-blowback/_config.js index a4290943e..964bb5547 100644 --- a/test/runtime/samples/component-binding-blowback/_config.js +++ b/test/runtime/samples/component-binding-blowback/_config.js @@ -1,12 +1,12 @@ export default { - test(assert, component) { + test({ assert, component }) { let count = 0; - component.on('state', ({ changed }) => { + component.$on('state', ({ changed }) => { if (changed.bar) count += 1; }); - component.set({ x: true }); + component.x = true; assert.equal(count, 0); } }; diff --git a/test/runtime/samples/component-binding-blowback/main.html b/test/runtime/samples/component-binding-blowback/main.html index edb9b0e8b..f51c889fc 100644 --- a/test/runtime/samples/component-binding-blowback/main.html +++ b/test/runtime/samples/component-binding-blowback/main.html @@ -1,22 +1,12 @@ -{#if x} - -{/if} - + +{#if x} + +{/if} \ No newline at end of file diff --git a/test/runtime/samples/component-binding-computed/_config.js b/test/runtime/samples/component-binding-computed/_config.js index c53a5c52b..b28701406 100644 --- a/test/runtime/samples/component-binding-computed/_config.js +++ b/test/runtime/samples/component-binding-computed/_config.js @@ -4,30 +4,28 @@ export default { `, - test ( assert, component, target, window ) { - const input = new window.Event( 'input' ); - const inputs = target.querySelectorAll( 'input' ); + async test({ assert, component, target, window }) { + const input = new window.Event('input'); + const inputs = target.querySelectorAll('input'); inputs[0].value = 'Ada'; - inputs[0].dispatchEvent(input); - assert.deepEqual(component.get().values, { + await inputs[0].dispatchEvent(input); + assert.deepEqual(component.values, { firstname: 'Ada', lastname: '' }); inputs[1].value = 'Lovelace'; - inputs[1].dispatchEvent(input); - assert.deepEqual(component.get().values, { + await inputs[1].dispatchEvent(input); + assert.deepEqual(component.values, { firstname: 'Ada', lastname: 'Lovelace' }); - component.set({ - values: { - firstname: 'Grace', - lastname: 'Hopper' - } - }); + component.values = { + firstname: 'Grace', + lastname: 'Hopper' + }; assert.equal(inputs[0].value, 'Grace'); assert.equal(inputs[1].value, 'Hopper'); } diff --git a/test/runtime/samples/component-binding-computed/main.html b/test/runtime/samples/component-binding-computed/main.html index af6283b5b..f1b9be4e1 100644 --- a/test/runtime/samples/component-binding-computed/main.html +++ b/test/runtime/samples/component-binding-computed/main.html @@ -1,22 +1,13 @@ -{#each fields as field} - -{/each} - \ No newline at end of file + + +{#each fields as field} + +{/each} \ No newline at end of file diff --git a/test/runtime/samples/component-binding-conditional-b/Bar.html b/test/runtime/samples/component-binding-conditional-b/Bar.html index 17bd4cfe7..a2357b74b 100644 --- a/test/runtime/samples/component-binding-conditional-b/Bar.html +++ b/test/runtime/samples/component-binding-conditional-b/Bar.html @@ -1,9 +1,5 @@ -

    y: {y}

    - + +

    y: {y}

    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-conditional-b/Baz.html b/test/runtime/samples/component-binding-conditional-b/Baz.html index 836ecc80c..569f76475 100644 --- a/test/runtime/samples/component-binding-conditional-b/Baz.html +++ b/test/runtime/samples/component-binding-conditional-b/Baz.html @@ -1,7 +1,3 @@ + export let x = true; + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-conditional-b/Foo.html b/test/runtime/samples/component-binding-conditional-b/Foo.html index 6365b7433..12835d604 100644 --- a/test/runtime/samples/component-binding-conditional-b/Foo.html +++ b/test/runtime/samples/component-binding-conditional-b/Foo.html @@ -1,9 +1,5 @@ -

    y: {y}

    - + +

    y: {y}

    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-conditional-b/_config.js b/test/runtime/samples/component-binding-conditional-b/_config.js index 3853390b1..9a48befe1 100644 --- a/test/runtime/samples/component-binding-conditional-b/_config.js +++ b/test/runtime/samples/component-binding-conditional-b/_config.js @@ -1,5 +1,5 @@ export default { - 'skip-ssr': true, // TODO delete this line, once binding works + skip_if_ssr: true, // TODO delete this line, once binding works // This test fails, because the Bar y binding is activated before the // Baz x binding, meaning that by the time Foo is created, we already @@ -13,8 +13,8 @@ export default {

    y: foo

    `, - test ( assert, component, target ) { - component.set({ x: false }); + test({ assert, component, target }) { + component.x = false; assert.htmlEqual( target.innerHTML, `

    y: foo

    diff --git a/test/runtime/samples/component-binding-conditional-b/main.html b/test/runtime/samples/component-binding-conditional-b/main.html index d72129b10..a96c8b671 100644 --- a/test/runtime/samples/component-binding-conditional-b/main.html +++ b/test/runtime/samples/component-binding-conditional-b/main.html @@ -1,3 +1,12 @@ + +

    y: {y}

    @@ -6,18 +15,4 @@ {:else} -{/if} - - +{/if} \ No newline at end of file diff --git a/test/runtime/samples/component-binding-conditional/Bar.html b/test/runtime/samples/component-binding-conditional/Bar.html index 17bd4cfe7..a2357b74b 100644 --- a/test/runtime/samples/component-binding-conditional/Bar.html +++ b/test/runtime/samples/component-binding-conditional/Bar.html @@ -1,9 +1,5 @@ -

    y: {y}

    - + +

    y: {y}

    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-conditional/Baz.html b/test/runtime/samples/component-binding-conditional/Baz.html index 836ecc80c..569f76475 100644 --- a/test/runtime/samples/component-binding-conditional/Baz.html +++ b/test/runtime/samples/component-binding-conditional/Baz.html @@ -1,7 +1,3 @@ + export let x = true; + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-conditional/Foo.html b/test/runtime/samples/component-binding-conditional/Foo.html index 6365b7433..12835d604 100644 --- a/test/runtime/samples/component-binding-conditional/Foo.html +++ b/test/runtime/samples/component-binding-conditional/Foo.html @@ -1,9 +1,5 @@ -

    y: {y}

    - + +

    y: {y}

    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-conditional/_config.js b/test/runtime/samples/component-binding-conditional/_config.js index a4295d8c1..65d8dea2a 100644 --- a/test/runtime/samples/component-binding-conditional/_config.js +++ b/test/runtime/samples/component-binding-conditional/_config.js @@ -1,17 +1,17 @@ export default { - 'skip-ssr': true, // TODO delete this line, once binding works + skip_if_ssr: true, // TODO delete this line, once binding works html: `

    y: bar

    y: bar

    `, - test ( assert, component, target ) { - component.set({ x: false }); + test({ assert, component, target }) { + component.x = false; - assert.htmlEqual( target.innerHTML, ` + assert.htmlEqual(target.innerHTML, `

    y: bar

    y: bar

    - ` ); + `); } }; diff --git a/test/runtime/samples/component-binding-conditional/main.html b/test/runtime/samples/component-binding-conditional/main.html index b5ccdcb15..9316eb586 100644 --- a/test/runtime/samples/component-binding-conditional/main.html +++ b/test/runtime/samples/component-binding-conditional/main.html @@ -1,3 +1,12 @@ + +

    y: {y}

    {#if x} @@ -6,18 +15,4 @@ {/if} - - - + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-deep-b/ComponentSelector.html b/test/runtime/samples/component-binding-deep-b/ComponentSelector.html index 513985e33..0edb702f1 100644 --- a/test/runtime/samples/component-binding-deep-b/ComponentSelector.html +++ b/test/runtime/samples/component-binding-deep-b/ComponentSelector.html @@ -1,4 +1,4 @@ - {#each components as component} {/each} diff --git a/test/runtime/samples/component-binding-deep-b/Editor.html b/test/runtime/samples/component-binding-deep-b/Editor.html index 34ed70114..cd3b080a9 100644 --- a/test/runtime/samples/component-binding-deep-b/Editor.html +++ b/test/runtime/samples/component-binding-deep-b/Editor.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-deep-b/_config.js b/test/runtime/samples/component-binding-deep-b/_config.js index 925011812..f701a36fa 100644 --- a/test/runtime/samples/component-binding-deep-b/_config.js +++ b/test/runtime/samples/component-binding-deep-b/_config.js @@ -14,7 +14,7 @@ const selectedComponent = components[0]; export default { skip: true, // doesn't reflect real-world bug, maybe a JSDOM quirk - data: { + props: { components, selectedComponent }, @@ -30,15 +30,15 @@ export default {
    ONE SOURCE\nTWO SOURCE
    `, - test ( assert, component, target, window ) { - const event = new window.MouseEvent( 'input' ); - const textarea = target.querySelector( 'textarea' ); + async test({ assert, component, target, window }) { + const event = new window.MouseEvent('input'); + const textarea = target.querySelector('textarea'); textarea.value = 'one source changed'; - textarea.dispatchEvent( event ); + await textarea.dispatchEvent(event); - assert.equal( component.get().compiled, 'ONE SOURCE CHANGED\nTWO SOURCE' ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.compiled, 'ONE SOURCE CHANGED\nTWO SOURCE'); + assert.htmlEqual(target.innerHTML, `
    ONE SOURCE CHANGED\nTWO SOURCE
    - ` ); + `); - // const select = target.querySelector( 'select' ); - // console.log( `select.options[0].selected`, select.options[0].selected ) - // console.log( `select.options[1].selected`, select.options[1].selected ) - // console.log( `select.value`, select.value ) - // console.log( `select.__value`, select.__value ) + // const select = target.querySelector('select'); + // console.log(`select.options[0].selected`, select.options[0].selected) + // console.log(`select.options[1].selected`, select.options[1].selected) + // console.log(`select.value`, select.value) + // console.log(`select.__value`, select.__value) // select.options[1].selected = true; - // console.log( `select.options[0].selected`, select.options[0].selected ) - // console.log( `select.options[1].selected`, select.options[1].selected ) - // console.log( `select.value`, select.value ) - // console.log( `select.__value`, select.__value ) - // select.dispatchEvent( new window.Event( 'change' ) ); - component.set({ selectedComponent: components[1] }); + // console.log(`select.options[0].selected`, select.options[0].selected) + // console.log(`select.options[1].selected`, select.options[1].selected) + // console.log(`select.value`, select.value) + // console.log(`select.__value`, select.__value) + // select.dispatchEvent(new window.Event('change')); + component.selectedComponent = components[1]; - assert.equal( textarea.value, 'two source' ); + assert.equal(textarea.value, 'two source'); textarea.value = 'two source changed'; - textarea.dispatchEvent( event ); + await textarea.dispatchEvent(event); - assert.equal( component.get().compiled, 'ONE SOURCE CHANGED\nTWO SOURCE CHANGED' ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.compiled, 'ONE SOURCE CHANGED\nTWO SOURCE CHANGED'); + assert.htmlEqual(target.innerHTML, `
    ONE SOURCE CHANGED\nTWO SOURCE CHANGED
    - ` ); - - component.destroy(); + `); } }; diff --git a/test/runtime/samples/component-binding-deep-b/main.html b/test/runtime/samples/component-binding-deep-b/main.html index a0914788f..a2de98048 100644 --- a/test/runtime/samples/component-binding-deep-b/main.html +++ b/test/runtime/samples/component-binding-deep-b/main.html @@ -1,44 +1,37 @@ - - - -
    -{compiled}
    -
    - \ No newline at end of file + + + + + +
    +{compiled}
    +
    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-deep/_config.js b/test/runtime/samples/component-binding-deep/_config.js index 4538d8a12..be5a2624a 100644 --- a/test/runtime/samples/component-binding-deep/_config.js +++ b/test/runtime/samples/component-binding-deep/_config.js @@ -9,14 +9,14 @@ export default {

    foo

    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const event = new window.MouseEvent('input'); const input = target.querySelector('input'); input.value = 'blah'; - input.dispatchEvent(event); + await input.dispatchEvent(event); - assert.deepEqual(component.get().deep, { name: 'blah' }); + assert.deepEqual(component.deep, { name: 'blah' }); assert.htmlEqual(target.innerHTML, `

    blah

    diff --git a/test/runtime/samples/component-binding-deep/main.html b/test/runtime/samples/component-binding-deep/main.html index 377b488a5..720ac74dd 100644 --- a/test/runtime/samples/component-binding-deep/main.html +++ b/test/runtime/samples/component-binding-deep/main.html @@ -1,21 +1,11 @@ - - -

    {deep.name}

    - + + + +

    {deep.name}

    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-each-nested/_config.js b/test/runtime/samples/component-binding-each-nested/_config.js index d160a03b1..45644eec0 100644 --- a/test/runtime/samples/component-binding-each-nested/_config.js +++ b/test/runtime/samples/component-binding-each-nested/_config.js @@ -11,19 +11,17 @@ export default {

    foo, bar, baz

    `, - test ( assert, component, target, window ) { - const event = new window.MouseEvent( 'input' ); - const inputs = target.querySelectorAll( 'input' ); + async test({ assert, component, target, window }) { + const event = new window.MouseEvent('input'); + const inputs = target.querySelectorAll('input'); inputs[0].value = 'blah'; - inputs[0].dispatchEvent( event ); + await inputs[0].dispatchEvent(event); - assert.deepEqual( component.get().a, [{ name: 'blah' }, { name: 'bar' }, { name: 'baz' }] ); - assert.htmlEqual( target.innerHTML, ` + assert.deepEqual(component.a, [{ name: 'blah' }, { name: 'bar' }, { name: 'baz' }]); + assert.htmlEqual(target.innerHTML, `

    blah, bar, baz

    - ` ); - - component.destroy(); + `); } }; diff --git a/test/runtime/samples/component-binding-each-nested/main.html b/test/runtime/samples/component-binding-each-nested/main.html index 18a910a6c..db8b23233 100644 --- a/test/runtime/samples/component-binding-each-nested/main.html +++ b/test/runtime/samples/component-binding-each-nested/main.html @@ -1,22 +1,12 @@ -{#each a as x} - -{/each} - -

    {a.map(getName).join(', ')}

    - + +{#each a as x} + +{/each} + +

    {a.map(getName).join(', ')}

    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-each-object/_config.js b/test/runtime/samples/component-binding-each-object/_config.js index 0802361f3..12b4094f2 100644 --- a/test/runtime/samples/component-binding-each-object/_config.js +++ b/test/runtime/samples/component-binding-each-object/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { a: [{ id: 'foo' }, { id: 'bar' }, { id: 'baz' }] }, @@ -7,18 +7,14 @@ export default { foobarbaz `, - test ( assert, component, target ) { - component.set({ - a: [ - { id: 'yep' }, - { id: 'nope' } - ] - }); + test({ assert, component, target }) { + component.a = [ + { id: 'yep' }, + { id: 'nope' } + ]; - assert.htmlEqual( target.innerHTML, ` + assert.htmlEqual(target.innerHTML, ` yepnope - ` ); - - component.destroy(); + `); } }; diff --git a/test/runtime/samples/component-binding-each-object/main.html b/test/runtime/samples/component-binding-each-object/main.html index f0952436b..1efb28466 100644 --- a/test/runtime/samples/component-binding-each-object/main.html +++ b/test/runtime/samples/component-binding-each-object/main.html @@ -1,13 +1,9 @@ -{#each a as x} - -{/each} - + +{#each a as x} + +{/each} \ No newline at end of file diff --git a/test/runtime/samples/component-binding-each/_config.js b/test/runtime/samples/component-binding-each/_config.js index cdcd03e75..ed49e194f 100644 --- a/test/runtime/samples/component-binding-each/_config.js +++ b/test/runtime/samples/component-binding-each/_config.js @@ -11,19 +11,17 @@ export default {

    foo, bar, baz

    `, - test ( assert, component, target, window ) { - const event = new window.MouseEvent( 'input' ); - const inputs = target.querySelectorAll( 'input' ); + async test({ assert, component, target, window }) { + const event = new window.MouseEvent('input'); + const inputs = target.querySelectorAll('input'); inputs[0].value = 'blah'; - inputs[0].dispatchEvent( event ); + await inputs[0].dispatchEvent(event); - assert.deepEqual( component.get().a, [ 'blah', 'bar', 'baz' ] ); - assert.htmlEqual( target.innerHTML, ` + assert.deepEqual(component.a, ['blah', 'bar', 'baz']); + assert.htmlEqual(target.innerHTML, `

    blah, bar, baz

    - ` ); - - component.destroy(); + `); } }; diff --git a/test/runtime/samples/component-binding-each/main.html b/test/runtime/samples/component-binding-each/main.html index c26dfef74..49ab04e68 100644 --- a/test/runtime/samples/component-binding-each/main.html +++ b/test/runtime/samples/component-binding-each/main.html @@ -1,21 +1,11 @@ -{#each a as x} - -{/each} - -

    {a.join(', ')}

    - + +{#each a as x} + +{/each} + +

    {a.join(', ')}

    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-infinite-loop/A.html b/test/runtime/samples/component-binding-infinite-loop/A.html index d625b3d6a..d4a9bf8ea 100644 --- a/test/runtime/samples/component-binding-infinite-loop/A.html +++ b/test/runtime/samples/component-binding-infinite-loop/A.html @@ -1,12 +1,8 @@ - - - + + + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-infinite-loop/B.html b/test/runtime/samples/component-binding-infinite-loop/B.html index a4563bbdb..72bbbe411 100644 --- a/test/runtime/samples/component-binding-infinite-loop/B.html +++ b/test/runtime/samples/component-binding-infinite-loop/B.html @@ -1,20 +1,14 @@ + + {#each list as item}

    {item}

    -{/each} - - +{/each} \ No newline at end of file diff --git a/test/runtime/samples/component-binding-infinite-loop/C.html b/test/runtime/samples/component-binding-infinite-loop/C.html index 06c646537..0bfc2f1d4 100644 --- a/test/runtime/samples/component-binding-infinite-loop/C.html +++ b/test/runtime/samples/component-binding-infinite-loop/C.html @@ -1,23 +1,19 @@ - - - - + + + + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-infinite-loop/_config.js b/test/runtime/samples/component-binding-infinite-loop/_config.js index b9f7650e4..92c5d5cd3 100644 --- a/test/runtime/samples/component-binding-infinite-loop/_config.js +++ b/test/runtime/samples/component-binding-infinite-loop/_config.js @@ -25,14 +25,14 @@ export default {

    1

    `, - test ( assert, component, target, window ) { - const click = new window.MouseEvent( 'click' ); - const spans = target.querySelectorAll( 'span' ); + async test({ assert, component, target, window }) { + const click = new window.MouseEvent('click'); + const spans = target.querySelectorAll('span'); - spans[0].dispatchEvent( click ); + await spans[0].dispatchEvent(click); - assert.equal( component.get().currentIdentifier, 1 ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.currentIdentifier, 1); + assert.htmlEqual(target.innerHTML, `

    1

    2

    3

    @@ -56,12 +56,12 @@ export default {

    3

    2

    1

    - ` ); + `); - spans[0].dispatchEvent( click ); + await spans[0].dispatchEvent(click); - assert.equal( component.get().currentIdentifier, null ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.currentIdentifier, null); + assert.htmlEqual(target.innerHTML, `

    1

    2

    3

    @@ -85,6 +85,6 @@ export default {

    3

    2

    1

    - ` ); + `); } }; diff --git a/test/runtime/samples/component-binding-infinite-loop/main.html b/test/runtime/samples/component-binding-infinite-loop/main.html index 19d43b475..b89631696 100644 --- a/test/runtime/samples/component-binding-infinite-loop/main.html +++ b/test/runtime/samples/component-binding-infinite-loop/main.html @@ -1,17 +1,8 @@ - - - \ No newline at end of file + export let currentIdentifier = 2; + + + + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-invalid-identifier/Counter.html b/test/runtime/samples/component-binding-invalid-identifier/Counter.html deleted file mode 100644 index afb4ac7d5..000000000 --- a/test/runtime/samples/component-binding-invalid-identifier/Counter.html +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/test/runtime/samples/component-binding-invalid-identifier/_config.js b/test/runtime/samples/component-binding-invalid-identifier/_config.js deleted file mode 100644 index aa64ab81b..000000000 --- a/test/runtime/samples/component-binding-invalid-identifier/_config.js +++ /dev/null @@ -1,29 +0,0 @@ -export default { - 'skip-ssr': true, // TODO delete this line, once binding works - - html: ` - -

    count: 0

    - `, - - test ( assert, component, target, window ) { - const click = new window.MouseEvent( 'click' ); - const button = target.querySelector( 'button' ); - - button.dispatchEvent( click ); - - assert.equal( component.get().x, 1 ); - assert.htmlEqual( target.innerHTML, ` - -

    count: 1

    - ` ); - - button.dispatchEvent( click ); - - assert.equal( component.get().x, 2 ); - assert.htmlEqual( target.innerHTML, ` - -

    count: 2

    - ` ); - } -}; diff --git a/test/runtime/samples/component-binding-invalid-identifier/main.html b/test/runtime/samples/component-binding-invalid-identifier/main.html deleted file mode 100644 index 90dcbfe34..000000000 --- a/test/runtime/samples/component-binding-invalid-identifier/main.html +++ /dev/null @@ -1,12 +0,0 @@ - -

    count: {x}

    - - diff --git a/test/runtime/samples/component-binding-nested/Bar.html b/test/runtime/samples/component-binding-nested/Bar.html index 7dd76eb93..9ed5c6f42 100644 --- a/test/runtime/samples/component-binding-nested/Bar.html +++ b/test/runtime/samples/component-binding-nested/Bar.html @@ -1,12 +1,10 @@ - -

    bar x: {x}

    - - - + + +

    bar x: {x}

    + + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-nested/Baz.html b/test/runtime/samples/component-binding-nested/Baz.html index 59cb40ec8..cd2cb5d0d 100644 --- a/test/runtime/samples/component-binding-nested/Baz.html +++ b/test/runtime/samples/component-binding-nested/Baz.html @@ -1,2 +1,2 @@ - -

    baz x: {x}

    + +

    baz x: {x}

    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-nested/Foo.html b/test/runtime/samples/component-binding-nested/Foo.html index f29b4e441..500480eae 100644 --- a/test/runtime/samples/component-binding-nested/Foo.html +++ b/test/runtime/samples/component-binding-nested/Foo.html @@ -1,12 +1,10 @@ - -

    foo x: {x}

    - - - + + +

    foo x: {x}

    + + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-nested/_config.js b/test/runtime/samples/component-binding-nested/_config.js index d0fb9dc19..77a4d5c1a 100644 --- a/test/runtime/samples/component-binding-nested/_config.js +++ b/test/runtime/samples/component-binding-nested/_config.js @@ -1,7 +1,7 @@ export default { - 'skip-ssr': true, // TODO delete this line, once binding works + skip_if_ssr: true, // TODO delete this line, once binding works - data: { + props: { x: 'initial' }, @@ -15,14 +15,14 @@ export default {

    baz x: initial

    `, - test ( assert, component, target, window ) { - const click = new window.MouseEvent( 'click' ); - const buttons = [ ...target.querySelectorAll( 'button' ) ]; + async test({ assert, component, target, window }) { + const click = new window.MouseEvent('click'); + const buttons = [...target.querySelectorAll('button')]; - buttons[0].dispatchEvent( click ); + await buttons[0].dispatchEvent(click); - assert.equal( component.get().x, 'p' ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.x, 'p'); + assert.htmlEqual(target.innerHTML, `

    x: p

    foo x: p

    @@ -30,12 +30,12 @@ export default {

    bar x: p

    baz x: p

    - ` ); + `); - buttons[1].dispatchEvent( click ); + await buttons[1].dispatchEvent(click); - assert.equal( component.get().x, 'q' ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.x, 'q'); + assert.htmlEqual(target.innerHTML, `

    x: q

    foo x: q

    @@ -43,12 +43,12 @@ export default {

    bar x: q

    baz x: q

    - ` ); + `); - buttons[2].dispatchEvent( click ); + await buttons[2].dispatchEvent(click); - assert.equal( component.get().x, 'r' ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.x, 'r'); + assert.htmlEqual(target.innerHTML, `

    x: r

    foo x: r

    @@ -56,6 +56,6 @@ export default {

    bar x: r

    baz x: r

    - ` ); + `); } }; diff --git a/test/runtime/samples/component-binding-nested/main.html b/test/runtime/samples/component-binding-nested/main.html index 948adb1a7..cae8f4dc5 100644 --- a/test/runtime/samples/component-binding-nested/main.html +++ b/test/runtime/samples/component-binding-nested/main.html @@ -1,11 +1,9 @@ -

    x: {x}

    - - - + +

    x: {x}

    + + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-parent-supercedes-child/Counter.html b/test/runtime/samples/component-binding-parent-supercedes-child/Counter.html index d22f95d16..4ac9541b6 100644 --- a/test/runtime/samples/component-binding-parent-supercedes-child/Counter.html +++ b/test/runtime/samples/component-binding-parent-supercedes-child/Counter.html @@ -1,9 +1,5 @@ - - + + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-parent-supercedes-child/_config.js b/test/runtime/samples/component-binding-parent-supercedes-child/_config.js index 65999b85f..4ba02c591 100644 --- a/test/runtime/samples/component-binding-parent-supercedes-child/_config.js +++ b/test/runtime/samples/component-binding-parent-supercedes-child/_config.js @@ -4,24 +4,24 @@ export default {

    count: 10

    `, - test ( assert, component, target, window ) { - const click = new window.MouseEvent( 'click' ); - const button = target.querySelector( 'button' ); + async test({ assert, component, target, window }) { + const click = new window.MouseEvent('click'); + const button = target.querySelector('button'); - button.dispatchEvent( click ); + await button.dispatchEvent(click); - assert.equal( component.get().x, 11 ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.x, 11); + assert.htmlEqual(target.innerHTML, `

    count: 11

    - ` ); + `); - button.dispatchEvent( click ); + await button.dispatchEvent(click); - assert.equal( component.get().x, 12 ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.x, 12); + assert.htmlEqual(target.innerHTML, `

    count: 12

    - ` ); + `); } }; diff --git a/test/runtime/samples/component-binding-parent-supercedes-child/main.html b/test/runtime/samples/component-binding-parent-supercedes-child/main.html index b75a15c7f..c874b270d 100644 --- a/test/runtime/samples/component-binding-parent-supercedes-child/main.html +++ b/test/runtime/samples/component-binding-parent-supercedes-child/main.html @@ -1,16 +1,8 @@ - -

    count: {x}

    - + + +

    count: {x}

    \ No newline at end of file diff --git a/test/runtime/samples/component-binding-self-destroying/Nested.html b/test/runtime/samples/component-binding-self-destroying/Nested.html index 3fb5ca4da..a3dc510af 100644 --- a/test/runtime/samples/component-binding-self-destroying/Nested.html +++ b/test/runtime/samples/component-binding-self-destroying/Nested.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-self-destroying/_config.js b/test/runtime/samples/component-binding-self-destroying/_config.js index a78b1c55e..17cf23881 100644 --- a/test/runtime/samples/component-binding-self-destroying/_config.js +++ b/test/runtime/samples/component-binding-self-destroying/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { show: true }, @@ -7,19 +7,19 @@ export default { `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const click = new window.MouseEvent('click'); - target.querySelector('button').dispatchEvent(click); + await target.querySelector('button').dispatchEvent(click); - assert.equal(component.get().show, false); + assert.equal(component.show, false); assert.htmlEqual(target.innerHTML, ` `); - target.querySelector('button').dispatchEvent(click); + await target.querySelector('button').dispatchEvent(click); - assert.equal(component.get().show, true); + assert.equal(component.show, true); assert.htmlEqual(target.innerHTML, ` `); diff --git a/test/runtime/samples/component-binding-self-destroying/main.html b/test/runtime/samples/component-binding-self-destroying/main.html index 1863a6b39..66b578f9b 100644 --- a/test/runtime/samples/component-binding-self-destroying/main.html +++ b/test/runtime/samples/component-binding-self-destroying/main.html @@ -1,14 +1,10 @@ + + {#if show} {:else} - -{/if} - - \ No newline at end of file + +{/if} \ No newline at end of file diff --git a/test/runtime/samples/component-binding/Counter.html b/test/runtime/samples/component-binding/Counter.html index d22f95d16..4ac9541b6 100644 --- a/test/runtime/samples/component-binding/Counter.html +++ b/test/runtime/samples/component-binding/Counter.html @@ -1,9 +1,5 @@ - - + + \ No newline at end of file diff --git a/test/runtime/samples/component-binding/_config.js b/test/runtime/samples/component-binding/_config.js index aa64ab81b..42b0d578c 100644 --- a/test/runtime/samples/component-binding/_config.js +++ b/test/runtime/samples/component-binding/_config.js @@ -1,29 +1,29 @@ export default { - 'skip-ssr': true, // TODO delete this line, once binding works + skip_if_ssr: true, // TODO delete this line, once binding works html: `

    count: 0

    `, - test ( assert, component, target, window ) { - const click = new window.MouseEvent( 'click' ); - const button = target.querySelector( 'button' ); + async test({ assert, component, target, window }) { + const click = new window.MouseEvent('click'); + const button = target.querySelector('button'); - button.dispatchEvent( click ); + await button.dispatchEvent(click); - assert.equal( component.get().x, 1 ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.x, 1); + assert.htmlEqual(target.innerHTML, `

    count: 1

    - ` ); + `); - button.dispatchEvent( click ); + await button.dispatchEvent(click); - assert.equal( component.get().x, 2 ); - assert.htmlEqual( target.innerHTML, ` + assert.equal(component.x, 2); + assert.htmlEqual(target.innerHTML, `

    count: 2

    - ` ); + `); } }; diff --git a/test/runtime/samples/component-binding/main.html b/test/runtime/samples/component-binding/main.html index 8f534d85c..5639d47eb 100644 --- a/test/runtime/samples/component-binding/main.html +++ b/test/runtime/samples/component-binding/main.html @@ -1,12 +1,8 @@ - -

    count: {x}

    - + + +

    count: {x}

    \ No newline at end of file diff --git a/test/runtime/samples/component-data-dynamic-late/Widget.html b/test/runtime/samples/component-data-dynamic-late/Widget.html index 3b966c83e..242d51b65 100644 --- a/test/runtime/samples/component-data-dynamic-late/Widget.html +++ b/test/runtime/samples/component-data-dynamic-late/Widget.html @@ -1 +1 @@ -

    {p}

    +

    {p}

    \ No newline at end of file diff --git a/test/runtime/samples/component-data-dynamic-late/_config.js b/test/runtime/samples/component-data-dynamic-late/_config.js index 0f5b361b8..21a06791e 100644 --- a/test/runtime/samples/component-data-dynamic-late/_config.js +++ b/test/runtime/samples/component-data-dynamic-late/_config.js @@ -1,7 +1,7 @@ export default { - test ( assert, component, target ) { - component.set({ q: 42 }); - component.set({ foo: true }); + test({ assert, component, target }) { + component.q = 42; + component.foo = true; assert.htmlEqual( target.innerHTML, `

    42

    diff --git a/test/runtime/samples/component-data-dynamic-late/main.html b/test/runtime/samples/component-data-dynamic-late/main.html index 465fcea9e..4c0783759 100644 --- a/test/runtime/samples/component-data-dynamic-late/main.html +++ b/test/runtime/samples/component-data-dynamic-late/main.html @@ -1,17 +1,10 @@ -{#if foo} - -{/if} - + +{#if foo} + +{/if} \ No newline at end of file diff --git a/test/runtime/samples/component-data-dynamic-shorthand/_config.js b/test/runtime/samples/component-data-dynamic-shorthand/_config.js index 0e96bc9a8..80e8731dc 100644 --- a/test/runtime/samples/component-data-dynamic-shorthand/_config.js +++ b/test/runtime/samples/component-data-dynamic-shorthand/_config.js @@ -1,14 +1,12 @@ export default { - data: { + props: { foo: 42 }, html: `

    foo: 42

    `, - test ( assert, component, target ) { - component.set({ - foo: 99 - }); + test({ assert, component, target }) { + component.foo = 99; assert.equal( target.innerHTML, `

    foo: 99

    ` ); } diff --git a/test/runtime/samples/component-data-dynamic-shorthand/main.html b/test/runtime/samples/component-data-dynamic-shorthand/main.html index deae244ac..c6359fbc2 100644 --- a/test/runtime/samples/component-data-dynamic-shorthand/main.html +++ b/test/runtime/samples/component-data-dynamic-shorthand/main.html @@ -1,11 +1,9 @@ -
    - -
    - + +
    + +
    \ No newline at end of file diff --git a/test/runtime/samples/component-data-dynamic/Widget.html b/test/runtime/samples/component-data-dynamic/Widget.html index a60afb741..b34c2ef08 100644 --- a/test/runtime/samples/component-data-dynamic/Widget.html +++ b/test/runtime/samples/component-data-dynamic/Widget.html @@ -1,4 +1,4 @@

    foo: {foo}

    baz: {baz} ({typeof baz})

    qux: {qux}

    -

    quux: {quux}

    +

    quux: {quux}

    \ No newline at end of file diff --git a/test/runtime/samples/component-data-dynamic/_config.js b/test/runtime/samples/component-data-dynamic/_config.js index 48c8fff2b..3a765c5b0 100644 --- a/test/runtime/samples/component-data-dynamic/_config.js +++ b/test/runtime/samples/component-data-dynamic/_config.js @@ -1,18 +1,16 @@ export default { - data: { + props: { bar: 'lol', x: 2, compound: 'piece of', go: { deeper: 'core' } }, html: `

    foo: lol

    \n

    baz: 42 (number)

    \n

    qux: this is a piece of string

    \n

    quux: core

    `, - test ( assert, component, target ) { - component.set({ - bar: 'wut', - x: 3, - compound: 'rather boring', - go: { deeper: 'heart' } - }); + test({ assert, component, target }) { + component.bar = 'wut'; + component.x = 3; + component.compound = 'rather boring'; + component.go = { deeper: 'heart' }; assert.equal( target.innerHTML, `

    foo: wut

    \n

    baz: 43 (number)

    \n

    qux: this is a rather boring string

    \n

    quux: heart

    ` ); } diff --git a/test/runtime/samples/component-data-dynamic/main.html b/test/runtime/samples/component-data-dynamic/main.html index 554d4980a..7c796ca9b 100644 --- a/test/runtime/samples/component-data-dynamic/main.html +++ b/test/runtime/samples/component-data-dynamic/main.html @@ -1,11 +1,12 @@ -
    - -
    - + +
    + +
    \ No newline at end of file diff --git a/test/runtime/samples/component-data-empty/Widget.html b/test/runtime/samples/component-data-empty/Widget.html index 0fbf16cc4..d504b8437 100644 --- a/test/runtime/samples/component-data-empty/Widget.html +++ b/test/runtime/samples/component-data-empty/Widget.html @@ -1 +1 @@ -

    foo: '{foo}'

    +

    foo: '{foo}'

    \ No newline at end of file diff --git a/test/runtime/samples/component-data-empty/main.html b/test/runtime/samples/component-data-empty/main.html index 8b797c8a6..3989cd231 100644 --- a/test/runtime/samples/component-data-empty/main.html +++ b/test/runtime/samples/component-data-empty/main.html @@ -1,11 +1,7 @@ -
    - -
    - + +
    + +
    \ No newline at end of file diff --git a/test/runtime/samples/component-data-static-boolean-regression/main.html b/test/runtime/samples/component-data-static-boolean-regression/main.html index 5f51d903b..8207fef20 100644 --- a/test/runtime/samples/component-data-static-boolean-regression/main.html +++ b/test/runtime/samples/component-data-static-boolean-regression/main.html @@ -1,10 +1,5 @@ - - \ No newline at end of file + + + \ No newline at end of file diff --git a/test/runtime/samples/component-data-static-boolean/Foo.html b/test/runtime/samples/component-data-static-boolean/Foo.html index 0cc021325..780198e0e 100644 --- a/test/runtime/samples/component-data-static-boolean/Foo.html +++ b/test/runtime/samples/component-data-static-boolean/Foo.html @@ -1 +1 @@ -

    x: {x} ({typeof x})

    +

    x: {x} ({typeof x})

    \ No newline at end of file diff --git a/test/runtime/samples/component-data-static-boolean/main.html b/test/runtime/samples/component-data-static-boolean/main.html index 7c5cf9d2e..cfaef9dea 100644 --- a/test/runtime/samples/component-data-static-boolean/main.html +++ b/test/runtime/samples/component-data-static-boolean/main.html @@ -1,9 +1,5 @@ - - + + \ No newline at end of file diff --git a/test/runtime/samples/component-data-static/Widget.html b/test/runtime/samples/component-data-static/Widget.html index 69fc156ea..bf52f4acf 100644 --- a/test/runtime/samples/component-data-static/Widget.html +++ b/test/runtime/samples/component-data-static/Widget.html @@ -1,2 +1,2 @@

    foo: {foo}

    -

    baz: {baz} ({typeof baz})

    +

    baz: {baz} ({typeof baz})

    \ No newline at end of file diff --git a/test/runtime/samples/component-data-static/main.html b/test/runtime/samples/component-data-static/main.html index c21df0c66..ec8e37c45 100644 --- a/test/runtime/samples/component-data-static/main.html +++ b/test/runtime/samples/component-data-static/main.html @@ -1,11 +1,7 @@ -
    - -
    - + +
    + +
    \ No newline at end of file diff --git a/test/runtime/samples/component-event-not-stale/_config.js b/test/runtime/samples/component-event-not-stale/_config.js index 3d6dd936e..912ea1f7d 100644 --- a/test/runtime/samples/component-event-not-stale/_config.js +++ b/test/runtime/samples/component-event-not-stale/_config.js @@ -1,21 +1,21 @@ export default { - data: { + props: { value: 1, }, - test(assert, component, target, window) { + test({ assert, component, target, window }) { const buttons = target.querySelectorAll('button'); const click = new window.MouseEvent('click'); const events = []; - component.on('value', event => { - events.push(event); + component.$on('value', event => { + events.push(event.detail); }); buttons[0].dispatchEvent(click); buttons[1].dispatchEvent(click); - component.set({ value: 2 }); + component.value = 2; buttons[0].dispatchEvent(click); buttons[1].dispatchEvent(click); diff --git a/test/runtime/samples/component-event-not-stale/main.html b/test/runtime/samples/component-event-not-stale/main.html index e244f596a..1beacd0e2 100644 --- a/test/runtime/samples/component-event-not-stale/main.html +++ b/test/runtime/samples/component-event-not-stale/main.html @@ -1,20 +1,15 @@ - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/test/runtime/samples/component-events-console/_config.js b/test/runtime/samples/component-events-console/_config.js index 407c3e7ed..b80074978 100644 --- a/test/runtime/samples/component-events-console/_config.js +++ b/test/runtime/samples/component-events-console/_config.js @@ -1,7 +1,7 @@ export default { html: '', - test(assert, component, target) { + test({ assert, component, target }) { const button = target.querySelector('button'); const messages = []; diff --git a/test/runtime/samples/component-events-console/main.html b/test/runtime/samples/component-events-console/main.html index 13238f6c5..7b0c3fccd 100644 --- a/test/runtime/samples/component-events-console/main.html +++ b/test/runtime/samples/component-events-console/main.html @@ -1,9 +1,5 @@ - - + + \ No newline at end of file diff --git a/test/runtime/samples/component-events-data/Widget.html b/test/runtime/samples/component-events-data/Widget.html index 5087ccc68..30a3159b4 100644 --- a/test/runtime/samples/component-events-data/Widget.html +++ b/test/runtime/samples/component-events-data/Widget.html @@ -1,3 +1,9 @@ - - - + + + + + \ No newline at end of file diff --git a/test/runtime/samples/component-events-data/_config.js b/test/runtime/samples/component-events-data/_config.js index f3763be9b..e4ef16c6f 100644 --- a/test/runtime/samples/component-events-data/_config.js +++ b/test/runtime/samples/component-events-data/_config.js @@ -1,20 +1,20 @@ export default { - test ( assert, component, target, window ) { - const buttons = target.querySelectorAll( 'button' ); - const click = new window.MouseEvent( 'click' ); + test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const click = new window.MouseEvent('click'); const selected = []; - component.on( 'select', selection => { - selected.push( selection ); + component.$on('select', event => { + selected.push(event.detail); }); - buttons[1].dispatchEvent( click ); - buttons[2].dispatchEvent( click ); - buttons[1].dispatchEvent( click ); - buttons[0].dispatchEvent( click ); + buttons[1].dispatchEvent(click); + buttons[2].dispatchEvent(click); + buttons[1].dispatchEvent(click); + buttons[0].dispatchEvent(click); - assert.deepEqual( selected, [ + assert.deepEqual(selected, [ 'bar', 'baz', 'bar', diff --git a/test/runtime/samples/component-events-data/main.html b/test/runtime/samples/component-events-data/main.html index 75d457ee2..5661404a4 100644 --- a/test/runtime/samples/component-events-data/main.html +++ b/test/runtime/samples/component-events-data/main.html @@ -1,11 +1,10 @@ -
    - -
    - + +
    + +
    \ No newline at end of file diff --git a/test/runtime/samples/component-events-each/Widget.html b/test/runtime/samples/component-events-each/Widget.html index ad81b51f1..205c67999 100644 --- a/test/runtime/samples/component-events-each/Widget.html +++ b/test/runtime/samples/component-events-each/Widget.html @@ -1 +1,7 @@ - + + + \ No newline at end of file diff --git a/test/runtime/samples/component-events-each/_config.js b/test/runtime/samples/component-events-each/_config.js index e7efe6fbf..3165dda67 100644 --- a/test/runtime/samples/component-events-each/_config.js +++ b/test/runtime/samples/component-events-each/_config.js @@ -1,27 +1,30 @@ export default { - data: { - items: [ 'a', 'b', 'c' ] + props: { + items: ['a', 'b', 'c'] }, html: ` -
    +
    + + + +
    `, - test ( assert, component, target, window ) { - const buttons = target.querySelectorAll( 'button' ); + test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); const clicks = []; - component.on( 'foo', item => { - clicks.push( item ); + component.$on('foo', event => { + clicks.push(event.detail); }); - const event = new window.MouseEvent( 'click' ); + const event = new window.MouseEvent('click'); - buttons[0].dispatchEvent( event ); - buttons[2].dispatchEvent( event ); + buttons[0].dispatchEvent(event); + buttons[2].dispatchEvent(event); - assert.deepEqual( clicks, [ 'a', 'c' ]); - component.destroy(); + assert.deepEqual(clicks, ['a', 'c']); } }; diff --git a/test/runtime/samples/component-events-each/main.html b/test/runtime/samples/component-events-each/main.html index 3d655c5df..4a5a69417 100644 --- a/test/runtime/samples/component-events-each/main.html +++ b/test/runtime/samples/component-events-each/main.html @@ -1,19 +1,18 @@ -
    - {#each items as item} - - {/each} -
    - + +
    + {#each items as item} + + {/each} +
    \ No newline at end of file diff --git a/test/runtime/samples/component-events-fire-finally/_config.js b/test/runtime/samples/component-events-fire-finally/_config.js deleted file mode 100644 index f768f5608..000000000 --- a/test/runtime/samples/component-events-fire-finally/_config.js +++ /dev/null @@ -1,23 +0,0 @@ -export default { - test(assert, component) { - const events = []; - component.on('foo', (shouldThrow) => { - events.push(shouldThrow); - if (shouldThrow) { - throw new Error(); - } - }); - component.fire('foo', false); - assert.equal(events.toString(), 'false'); - let threw = false; - try { - component.fire('foo', true); - } catch (err) { - threw = true; - } - assert.equal(threw, true); - assert.equal(events.toString(), 'false,true'); - component.fire('foo', false); - assert.equal(events.toString(), 'false,true,false'); - }, -}; diff --git a/test/runtime/samples/component-events-fire-finally/main.html b/test/runtime/samples/component-events-fire-finally/main.html deleted file mode 100644 index bc56c4d89..000000000 --- a/test/runtime/samples/component-events-fire-finally/main.html +++ /dev/null @@ -1 +0,0 @@ -Foo diff --git a/test/runtime/samples/component-events/Widget.html b/test/runtime/samples/component-events/Widget.html index 460a2a1c0..9a7215815 100644 --- a/test/runtime/samples/component-events/Widget.html +++ b/test/runtime/samples/component-events/Widget.html @@ -1 +1,11 @@ -

    i am a widget

    + + +

    i am a widget

    \ No newline at end of file diff --git a/test/runtime/samples/component-events/_config.js b/test/runtime/samples/component-events/_config.js index 05691c6b1..26034edc9 100644 --- a/test/runtime/samples/component-events/_config.js +++ b/test/runtime/samples/component-events/_config.js @@ -1,23 +1,23 @@ export default { - data: { + props: { visible: true }, html: '

    i am a widget

    ', - test ( assert, component ) { + test({ assert, component }) { let count = 0; - component.on( 'widgetTornDown', function () { - assert.equal( this, component ); + component.$on('widgetTornDown', function() { + assert.equal(this, component); count += 1; }); - component.set({ visible: false }); - assert.equal( count, 1 ); + component.visible = false; + assert.equal(count, 1); - component.set({ visible: true }); - component.set({ visible: false }); - assert.equal( count, 2 ); + component.visible = true; + component.visible = false; + assert.equal(count, 2); } }; diff --git a/test/runtime/samples/component-events/main.html b/test/runtime/samples/component-events/main.html index eff15ef97..fc4839e02 100644 --- a/test/runtime/samples/component-events/main.html +++ b/test/runtime/samples/component-events/main.html @@ -1,13 +1,14 @@ -
    - {#if visible} - - {/if} -
    - + +
    + {#if visible} + + {/if} +
    \ No newline at end of file diff --git a/test/runtime/samples/component-if-placement/Component.html b/test/runtime/samples/component-if-placement/Component.html index 04c4841d3..48d0e60ae 100644 --- a/test/runtime/samples/component-if-placement/Component.html +++ b/test/runtime/samples/component-if-placement/Component.html @@ -1,3 +1,3 @@ {#if true} Component -{/if} +{/if} \ No newline at end of file diff --git a/test/runtime/samples/component-if-placement/_config.js b/test/runtime/samples/component-if-placement/_config.js index 9b0a74df1..abeda9e9b 100644 --- a/test/runtime/samples/component-if-placement/_config.js +++ b/test/runtime/samples/component-if-placement/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { flag: true }, @@ -9,8 +9,8 @@ export default { After `, - test ( assert, component, target ) { - component.set( { flag: false } ); + test({ assert, component, target }) { + component.flag = false; assert.htmlEqual( target.innerHTML, ` Before Component diff --git a/test/runtime/samples/component-if-placement/main.html b/test/runtime/samples/component-if-placement/main.html index 3f8c819fd..175feeb6b 100644 --- a/test/runtime/samples/component-if-placement/main.html +++ b/test/runtime/samples/component-if-placement/main.html @@ -1,14 +1,12 @@ + + Before {#if flag} {:else} {/if} -After - - +After \ No newline at end of file diff --git a/test/runtime/samples/component-invalid-identifier/Widget.html b/test/runtime/samples/component-invalid-identifier/Widget.html deleted file mode 100644 index 779a912f2..000000000 --- a/test/runtime/samples/component-invalid-identifier/Widget.html +++ /dev/null @@ -1,10 +0,0 @@ -

    {state["b-c"]}

    - diff --git a/test/runtime/samples/component-invalid-identifier/_config.js b/test/runtime/samples/component-invalid-identifier/_config.js deleted file mode 100644 index d768ccd1c..000000000 --- a/test/runtime/samples/component-invalid-identifier/_config.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - html: '

    i am a widget

    ' -}; diff --git a/test/runtime/samples/component-invalid-identifier/main.html b/test/runtime/samples/component-invalid-identifier/main.html deleted file mode 100644 index 9a3431198..000000000 --- a/test/runtime/samples/component-invalid-identifier/main.html +++ /dev/null @@ -1,11 +0,0 @@ -
    - -
    - - diff --git a/test/runtime/samples/component-name-deconflicted/_config.js b/test/runtime/samples/component-name-deconflicted/_config.js index 853bbdd87..97ea2290b 100644 --- a/test/runtime/samples/component-name-deconflicted/_config.js +++ b/test/runtime/samples/component-name-deconflicted/_config.js @@ -4,10 +4,8 @@ export default { 2 `, - test(assert, component, target) { - component.set({ - list: [3, 4] - }); + test({ assert, component, target }) { + component.list = [3, 4]; assert.htmlEqual(target.innerHTML, ` 3 diff --git a/test/runtime/samples/component-name-deconflicted/main.html b/test/runtime/samples/component-name-deconflicted/main.html index c5595b73e..03d43c357 100644 --- a/test/runtime/samples/component-name-deconflicted/main.html +++ b/test/runtime/samples/component-name-deconflicted/main.html @@ -1,18 +1,11 @@ + + {#each list as nested} {#if true} {/if} -{/each} - - \ No newline at end of file +{/each} \ No newline at end of file diff --git a/test/runtime/samples/component-nested-deep/Level1.html b/test/runtime/samples/component-nested-deep/Level1.html index d483c9a0c..246bc4dfb 100644 --- a/test/runtime/samples/component-nested-deep/Level1.html +++ b/test/runtime/samples/component-nested-deep/Level1.html @@ -1,15 +1,8 @@ - - - - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/test/runtime/samples/component-nested-deep/Level2.html b/test/runtime/samples/component-nested-deep/Level2.html index 5b2ece36c..4b992b5cb 100644 --- a/test/runtime/samples/component-nested-deep/Level2.html +++ b/test/runtime/samples/component-nested-deep/Level2.html @@ -1,12 +1,6 @@ -level 2 - - \ No newline at end of file + + +level 2 + \ No newline at end of file diff --git a/test/runtime/samples/component-nested-deep/_config.js b/test/runtime/samples/component-nested-deep/_config.js index 63b70fe41..0114e7922 100644 --- a/test/runtime/samples/component-nested-deep/_config.js +++ b/test/runtime/samples/component-nested-deep/_config.js @@ -1,5 +1,5 @@ export default { - test(assert, component) { - component.refs.l1.destroy(); + test({ assert, component }) { + component.l1.$destroy(); } }; diff --git a/test/runtime/samples/component-nested-deep/main.html b/test/runtime/samples/component-nested-deep/main.html index d4882d5a6..146974365 100644 --- a/test/runtime/samples/component-nested-deep/main.html +++ b/test/runtime/samples/component-nested-deep/main.html @@ -1,11 +1,7 @@ - - \ No newline at end of file + + export let l1; + + + \ No newline at end of file diff --git a/test/runtime/samples/component-nested-deeper/Level1.html b/test/runtime/samples/component-nested-deeper/Level1.html index 2ad03fc0c..273e1b61c 100644 --- a/test/runtime/samples/component-nested-deeper/Level1.html +++ b/test/runtime/samples/component-nested-deeper/Level1.html @@ -1,3 +1,10 @@ + +
    {#each values as value}

    level 1 #{value}

    @@ -7,16 +14,4 @@ {/each} -
    - - \ No newline at end of file +
    \ No newline at end of file diff --git a/test/runtime/samples/component-nested-deeper/Level2.html b/test/runtime/samples/component-nested-deeper/Level2.html index 1a255c356..940698ce7 100644 --- a/test/runtime/samples/component-nested-deeper/Level2.html +++ b/test/runtime/samples/component-nested-deeper/Level2.html @@ -1,4 +1,6 @@ -
    + + +

    level 2

    {#if condition} TRUE! diff --git a/test/runtime/samples/component-nested-deeper/Level3.html b/test/runtime/samples/component-nested-deeper/Level3.html index 22e093fb8..0ce8c7310 100644 --- a/test/runtime/samples/component-nested-deeper/Level3.html +++ b/test/runtime/samples/component-nested-deeper/Level3.html @@ -1,4 +1,4 @@ -
    +

    level 3

    \ No newline at end of file diff --git a/test/runtime/samples/component-nested-deeper/_config.js b/test/runtime/samples/component-nested-deeper/_config.js index 8c525fedd..86993b3e9 100644 --- a/test/runtime/samples/component-nested-deeper/_config.js +++ b/test/runtime/samples/component-nested-deeper/_config.js @@ -1,9 +1,9 @@ export default { - data: { + props: { values: [1, 2, 3, 4] }, - test(assert, component) { - component.set({ values: [2, 3] }); + test({ assert, component }) { + component.values = [2, 3]; } }; diff --git a/test/runtime/samples/component-nested-deeper/main.html b/test/runtime/samples/component-nested-deeper/main.html index e0749d49c..4c72ae674 100644 --- a/test/runtime/samples/component-nested-deeper/main.html +++ b/test/runtime/samples/component-nested-deeper/main.html @@ -1,11 +1,7 @@ - - \ No newline at end of file + export let values; + + + \ No newline at end of file diff --git a/test/runtime/samples/component-not-void/Link.html b/test/runtime/samples/component-not-void/Link.html index ca134c613..18a696151 100644 --- a/test/runtime/samples/component-not-void/Link.html +++ b/test/runtime/samples/component-not-void/Link.html @@ -1 +1 @@ -

    +

    \ No newline at end of file diff --git a/test/runtime/samples/component-not-void/main.html b/test/runtime/samples/component-not-void/main.html index 99f9a931b..0769c8109 100644 --- a/test/runtime/samples/component-not-void/main.html +++ b/test/runtime/samples/component-not-void/main.html @@ -1,11 +1,5 @@ -Hello - + +Hello \ No newline at end of file diff --git a/test/runtime/samples/component-ref/Widget.html b/test/runtime/samples/component-ref/Widget.html index c8cf786cc..3a1e7b2d4 100644 --- a/test/runtime/samples/component-ref/Widget.html +++ b/test/runtime/samples/component-ref/Widget.html @@ -1,9 +1,11 @@ -

    i am a widget

    - + +

    i am a widget

    \ No newline at end of file diff --git a/test/runtime/samples/component-ref/_config.js b/test/runtime/samples/component-ref/_config.js index 25749f58d..1c0cca6dc 100644 --- a/test/runtime/samples/component-ref/_config.js +++ b/test/runtime/samples/component-ref/_config.js @@ -1,7 +1,8 @@ export default { html: '

    i am a widget

    ', - test ( assert, component ) { - const widget = component.refs.widget; - assert.ok( widget.isWidget ); + + test({ assert, component }) { + const { widget } = component; + assert.ok(widget.isWidget); } }; diff --git a/test/runtime/samples/component-ref/main.html b/test/runtime/samples/component-ref/main.html index 162f6f5d2..9101d5856 100644 --- a/test/runtime/samples/component-ref/main.html +++ b/test/runtime/samples/component-ref/main.html @@ -1,11 +1,8 @@ -
    - -
    - + +
    + +
    \ No newline at end of file diff --git a/test/runtime/samples/component-shorthand-import/Widget.html b/test/runtime/samples/component-shorthand-import/Widget.html index 7ffdd798f..10c1f07af 100644 --- a/test/runtime/samples/component-shorthand-import/Widget.html +++ b/test/runtime/samples/component-shorthand-import/Widget.html @@ -1 +1 @@ -

    This is the widget.

    +

    This is the widget.

    \ No newline at end of file diff --git a/test/runtime/samples/component-shorthand-import/main.html b/test/runtime/samples/component-shorthand-import/main.html index 01320a9b3..cbcde3f1e 100644 --- a/test/runtime/samples/component-shorthand-import/main.html +++ b/test/runtime/samples/component-shorthand-import/main.html @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-default/main.html b/test/runtime/samples/component-slot-default/main.html index 3f5fad936..06a1f64ca 100644 --- a/test/runtime/samples/component-slot-default/main.html +++ b/test/runtime/samples/component-slot-default/main.html @@ -1,13 +1,7 @@ - - Hello - - + + + Hello + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-dynamic/Nested.html b/test/runtime/samples/component-slot-dynamic/Nested.html index ff6669108..da60b832e 100644 --- a/test/runtime/samples/component-slot-dynamic/Nested.html +++ b/test/runtime/samples/component-slot-dynamic/Nested.html @@ -1,13 +1,7 @@ - - {foo} - - + + + {foo} + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-dynamic/_config.js b/test/runtime/samples/component-slot-dynamic/_config.js index 17f22b283..9e43ff15f 100644 --- a/test/runtime/samples/component-slot-dynamic/_config.js +++ b/test/runtime/samples/component-slot-dynamic/_config.js @@ -3,7 +3,7 @@ export default {

    override default slot

    `, - test(assert, component) { - component.refs.nested.set({ foo: 'b' }); + test({ assert, component }) { + component.nested.foo = 'b'; } }; diff --git a/test/runtime/samples/component-slot-dynamic/main.html b/test/runtime/samples/component-slot-dynamic/main.html index 348754d88..b969fe6be 100644 --- a/test/runtime/samples/component-slot-dynamic/main.html +++ b/test/runtime/samples/component-slot-dynamic/main.html @@ -1,13 +1,9 @@ - -

    override default slot

    -
    - + + +

    override default slot

    +
    \ No newline at end of file diff --git a/test/runtime/samples/component-slot-each-block/_config.js b/test/runtime/samples/component-slot-each-block/_config.js index 34b230233..d66f613bb 100644 --- a/test/runtime/samples/component-slot-each-block/_config.js +++ b/test/runtime/samples/component-slot-each-block/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { things: [1, 2, 3] }, @@ -10,8 +10,8 @@ export default { 3
    `, - test(assert, component, target) { - component.set({ things: [1, 2, 3, 4] }); + test({ assert, component, target }) { + component.things = [1, 2, 3, 4]; assert.htmlEqual(target.innerHTML, `
    1 diff --git a/test/runtime/samples/component-slot-each-block/main.html b/test/runtime/samples/component-slot-each-block/main.html index 05dd7421c..911eb5c1a 100644 --- a/test/runtime/samples/component-slot-each-block/main.html +++ b/test/runtime/samples/component-slot-each-block/main.html @@ -1,13 +1,11 @@ + + {#each things as thing} {thing} {/each} - - - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-empty/main.html b/test/runtime/samples/component-slot-empty/main.html index 30b5cc73e..3d76b0a69 100644 --- a/test/runtime/samples/component-slot-empty/main.html +++ b/test/runtime/samples/component-slot-empty/main.html @@ -1,12 +1,6 @@ - - - + + + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-fallback/main.html b/test/runtime/samples/component-slot-fallback/main.html index 8894e8694..f4d609216 100644 --- a/test/runtime/samples/component-slot-fallback/main.html +++ b/test/runtime/samples/component-slot-fallback/main.html @@ -1,13 +1,7 @@ - -

    not fallback

    -
    - + + +

    not fallback

    +
    \ No newline at end of file diff --git a/test/runtime/samples/component-slot-if-block-before-node/_config.js b/test/runtime/samples/component-slot-if-block-before-node/_config.js index 5d6177e0d..dd0fa6998 100644 --- a/test/runtime/samples/component-slot-if-block-before-node/_config.js +++ b/test/runtime/samples/component-slot-if-block-before-node/_config.js @@ -4,8 +4,8 @@ export default {

    unconditional

    `, - test(assert, component, target) { - component.set({ foo: true }); + test({ assert, component, target }) { + component.foo = true; assert.htmlEqual(target.innerHTML, `

    conditional

    diff --git a/test/runtime/samples/component-slot-if-block-before-node/main.html b/test/runtime/samples/component-slot-if-block-before-node/main.html index 30e04fb56..01ea1e845 100644 --- a/test/runtime/samples/component-slot-if-block-before-node/main.html +++ b/test/runtime/samples/component-slot-if-block-before-node/main.html @@ -1,17 +1,13 @@ + + {#if foo}

    conditional

    {/if}

    unconditional

    -
    - - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-if-block/_config.js b/test/runtime/samples/component-slot-if-block/_config.js index 126ca78b2..08bfef899 100644 --- a/test/runtime/samples/component-slot-if-block/_config.js +++ b/test/runtime/samples/component-slot-if-block/_config.js @@ -4,8 +4,8 @@ export default {

    unconditional

    `, - test(assert, component, target) { - component.set({ foo: true }); + test({ assert, component, target }) { + component.foo = true; assert.htmlEqual(target.innerHTML, `

    unconditional

    diff --git a/test/runtime/samples/component-slot-if-block/main.html b/test/runtime/samples/component-slot-if-block/main.html index e7ce5ce2a..2b0405a47 100644 --- a/test/runtime/samples/component-slot-if-block/main.html +++ b/test/runtime/samples/component-slot-if-block/main.html @@ -1,17 +1,13 @@ + +

    unconditional

    {#if foo}

    conditional

    {/if} -
    - - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-if-else-block-before-node/_config.js b/test/runtime/samples/component-slot-if-else-block-before-node/_config.js index 42f10d471..8aaaa9319 100644 --- a/test/runtime/samples/component-slot-if-else-block-before-node/_config.js +++ b/test/runtime/samples/component-slot-if-else-block-before-node/_config.js @@ -3,8 +3,8 @@ export default {

    disabled

    unconditional

    `, - test(assert, component, target) { - component.set({ enabled: true }); + test({ assert, component, target }) { + component.enabled = true; assert.htmlEqual(target.innerHTML, `

    enabled

    unconditional

    diff --git a/test/runtime/samples/component-slot-if-else-block-before-node/main.html b/test/runtime/samples/component-slot-if-else-block-before-node/main.html index 52e923780..684497b98 100644 --- a/test/runtime/samples/component-slot-if-else-block-before-node/main.html +++ b/test/runtime/samples/component-slot-if-else-block-before-node/main.html @@ -1,3 +1,9 @@ + + {#if !enabled}

    disabled

    @@ -6,14 +12,4 @@ {/if}

    unconditional

    -
    - - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-name-with-hyphen/main.html b/test/runtime/samples/component-slot-name-with-hyphen/main.html index b3b6f8e9f..a77e524f8 100644 --- a/test/runtime/samples/component-slot-name-with-hyphen/main.html +++ b/test/runtime/samples/component-slot-name-with-hyphen/main.html @@ -1,13 +1,7 @@ - -

    Hello

    -
    - + + +

    Hello

    +
    \ No newline at end of file diff --git a/test/runtime/samples/component-slot-named/main.html b/test/runtime/samples/component-slot-named/main.html index 76ba5b072..627c3ab7e 100644 --- a/test/runtime/samples/component-slot-named/main.html +++ b/test/runtime/samples/component-slot-named/main.html @@ -1,16 +1,10 @@ - + + + Hello

    foo

    bar

    -
    - - +
    \ No newline at end of file diff --git a/test/runtime/samples/component-slot-nested-component/main.html b/test/runtime/samples/component-slot-nested-component/main.html index 2d094056c..d86e58bb7 100644 --- a/test/runtime/samples/component-slot-nested-component/main.html +++ b/test/runtime/samples/component-slot-nested-component/main.html @@ -1,12 +1,8 @@ - - foo - - - export default { - components: { Outer, Inner } - }; - \ No newline at end of file + + foo + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-nested/main.html b/test/runtime/samples/component-slot-nested/main.html index 226f9024e..a109ec9c0 100644 --- a/test/runtime/samples/component-slot-nested/main.html +++ b/test/runtime/samples/component-slot-nested/main.html @@ -1,13 +1,7 @@ - -

    bar

    -
    - + + +

    bar

    +
    \ No newline at end of file diff --git a/test/runtime/samples/component-static-at-symbol/Email.html b/test/runtime/samples/component-static-at-symbol/Email.html index f6b3b9f05..8af8c3d3b 100644 --- a/test/runtime/samples/component-static-at-symbol/Email.html +++ b/test/runtime/samples/component-static-at-symbol/Email.html @@ -1 +1 @@ -
    email +email \ No newline at end of file diff --git a/test/runtime/samples/component-static-at-symbol/main.html b/test/runtime/samples/component-static-at-symbol/main.html index f8a0e1c6c..275b922f6 100644 --- a/test/runtime/samples/component-static-at-symbol/main.html +++ b/test/runtime/samples/component-static-at-symbol/main.html @@ -1,9 +1,5 @@ - - + + \ No newline at end of file diff --git a/test/runtime/samples/component-yield-follows-element/main.html b/test/runtime/samples/component-yield-follows-element/main.html index 15747d9d5..b362e9a41 100644 --- a/test/runtime/samples/component-yield-follows-element/main.html +++ b/test/runtime/samples/component-yield-follows-element/main.html @@ -1,11 +1,5 @@ -test - + +test \ No newline at end of file diff --git a/test/runtime/samples/component-yield-if/Widget.html b/test/runtime/samples/component-yield-if/Widget.html index 2649b132e..209f43ae8 100644 --- a/test/runtime/samples/component-yield-if/Widget.html +++ b/test/runtime/samples/component-yield-if/Widget.html @@ -1,15 +1,9 @@ + +

    {#if show} {/if} -

    - - +

    \ No newline at end of file diff --git a/test/runtime/samples/component-yield-if/_config.js b/test/runtime/samples/component-yield-if/_config.js index 8c09fedba..40fe2d542 100644 --- a/test/runtime/samples/component-yield-if/_config.js +++ b/test/runtime/samples/component-yield-if/_config.js @@ -1,24 +1,24 @@ export default { html: '

    ', - test ( assert, component, target ) { - const widget = component.refs.widget; + test({ assert, component, target }) { + const { widget } = component; - assert.equal( widget.get().show, false ); + assert.equal(widget.show, false); - widget.set({show: true}); - assert.htmlEqual( target.innerHTML, '

    Hello

    ' ); + widget.show = true; + assert.htmlEqual(target.innerHTML, '

    Hello

    '); - component.set({data: 'World'}); - assert.htmlEqual( target.innerHTML, '

    World

    ' ); + component.data = 'World'; + assert.htmlEqual(target.innerHTML, '

    World

    '); - widget.set({show: false}); - assert.htmlEqual( target.innerHTML, '

    ' ); + widget.show = false; + assert.htmlEqual(target.innerHTML, '

    '); - component.set({data: 'Goodbye'}); - assert.htmlEqual( target.innerHTML, '

    ' ); + component.data = 'Goodbye'; + assert.htmlEqual(target.innerHTML, '

    '); - widget.set({show: true}); - assert.htmlEqual( target.innerHTML, '

    Goodbye

    ' ); + widget.show = true; + assert.htmlEqual(target.innerHTML, '

    Goodbye

    '); } }; diff --git a/test/runtime/samples/component-yield-if/main.html b/test/runtime/samples/component-yield-if/main.html index 974865f61..2dab85e36 100644 --- a/test/runtime/samples/component-yield-if/main.html +++ b/test/runtime/samples/component-yield-if/main.html @@ -1,17 +1,10 @@ -
    - {data} -
    - + +
    + {data} +
    \ No newline at end of file diff --git a/test/runtime/samples/component-yield-multiple-in-each/Widget.html b/test/runtime/samples/component-yield-multiple-in-each/Widget.html index ca134c613..18a696151 100644 --- a/test/runtime/samples/component-yield-multiple-in-each/Widget.html +++ b/test/runtime/samples/component-yield-multiple-in-each/Widget.html @@ -1 +1 @@ -

    +

    \ No newline at end of file diff --git a/test/runtime/samples/component-yield-multiple-in-each/_config.js b/test/runtime/samples/component-yield-multiple-in-each/_config.js index 3669b3f90..153a3a560 100644 --- a/test/runtime/samples/component-yield-multiple-in-each/_config.js +++ b/test/runtime/samples/component-yield-multiple-in-each/_config.js @@ -5,10 +5,8 @@ export default {

    Hello Charles

    `, - test ( assert, component, target ) { - component.set({ - people: [ 'Alice', 'Charles', 'Bob' ] - }); + test({ assert, component, target }) { + component.people = [ 'Alice', 'Charles', 'Bob' ]; assert.htmlEqual( target.innerHTML, `

    Hello Alice

    diff --git a/test/runtime/samples/component-yield-multiple-in-each/main.html b/test/runtime/samples/component-yield-multiple-in-each/main.html index efc4f382e..5f2027ee9 100644 --- a/test/runtime/samples/component-yield-multiple-in-each/main.html +++ b/test/runtime/samples/component-yield-multiple-in-each/main.html @@ -1,19 +1,9 @@ -{#each people as person} - Hello {person} -{/each} - + +{#each people as person} + Hello {person} +{/each} \ No newline at end of file diff --git a/test/runtime/samples/component-yield-multiple-in-if/Widget.html b/test/runtime/samples/component-yield-multiple-in-if/Widget.html index 0be522489..0f4848b8a 100644 --- a/test/runtime/samples/component-yield-multiple-in-if/Widget.html +++ b/test/runtime/samples/component-yield-multiple-in-if/Widget.html @@ -1 +1 @@ -

    +

    \ No newline at end of file diff --git a/test/runtime/samples/component-yield-multiple-in-if/_config.js b/test/runtime/samples/component-yield-multiple-in-if/_config.js index 1460962e7..d5d630a84 100644 --- a/test/runtime/samples/component-yield-multiple-in-if/_config.js +++ b/test/runtime/samples/component-yield-multiple-in-if/_config.js @@ -3,10 +3,8 @@ export default {

    Hello

    `, - test ( assert, component, target ) { - component.set({ arriving: false }); - assert.htmlEqual( target.innerHTML, `

    Goodbye

    ` ); - - component.destroy(); + test({ assert, component, target }) { + component.arriving = false; + assert.htmlEqual(target.innerHTML, `

    Goodbye

    `); } }; diff --git a/test/runtime/samples/component-yield-multiple-in-if/main.html b/test/runtime/samples/component-yield-multiple-in-if/main.html index d59276292..53eba749d 100644 --- a/test/runtime/samples/component-yield-multiple-in-if/main.html +++ b/test/runtime/samples/component-yield-multiple-in-if/main.html @@ -1,23 +1,13 @@ + +
    {#if arriving} Hello {:else} Goodbye {/if} -
    - - +
    \ No newline at end of file diff --git a/test/runtime/samples/component-yield-nested-if/Inner.html b/test/runtime/samples/component-yield-nested-if/Inner.html index d87e45af5..62120162a 100644 --- a/test/runtime/samples/component-yield-nested-if/Inner.html +++ b/test/runtime/samples/component-yield-nested-if/Inner.html @@ -1 +1 @@ -Inner +Inner \ No newline at end of file diff --git a/test/runtime/samples/component-yield-nested-if/Outer.html b/test/runtime/samples/component-yield-nested-if/Outer.html index 7a5960212..1d5fd34e1 100644 --- a/test/runtime/samples/component-yield-nested-if/Outer.html +++ b/test/runtime/samples/component-yield-nested-if/Outer.html @@ -1,3 +1,3 @@ {#if foo} -{/if} +{/if} \ No newline at end of file diff --git a/test/runtime/samples/component-yield-nested-if/_config.js b/test/runtime/samples/component-yield-nested-if/_config.js index 44548b2f1..f16a7bb6b 100644 --- a/test/runtime/samples/component-yield-nested-if/_config.js +++ b/test/runtime/samples/component-yield-nested-if/_config.js @@ -4,11 +4,11 @@ export default { Inner `, - test ( assert, component, target ) { - component.set({ foo: false }); + test({ assert, component, target }) { + component.foo = false; assert.htmlEqual( target.innerHTML, `` ); - component.set({ foo: true }); + component.foo = true; assert.htmlEqual( target.innerHTML, `One\nInner` ); } }; diff --git a/test/runtime/samples/component-yield-nested-if/main.html b/test/runtime/samples/component-yield-nested-if/main.html index 36dff0028..98c27812e 100644 --- a/test/runtime/samples/component-yield-nested-if/main.html +++ b/test/runtime/samples/component-yield-nested-if/main.html @@ -1,14 +1,11 @@ - - One - - - + + + One + + \ No newline at end of file diff --git a/test/runtime/samples/component-yield-parent/Widget.html b/test/runtime/samples/component-yield-parent/Widget.html index ca134c613..18a696151 100644 --- a/test/runtime/samples/component-yield-parent/Widget.html +++ b/test/runtime/samples/component-yield-parent/Widget.html @@ -1 +1 @@ -

    +

    \ No newline at end of file diff --git a/test/runtime/samples/component-yield-parent/_config.js b/test/runtime/samples/component-yield-parent/_config.js index 39bc7cf79..134089388 100644 --- a/test/runtime/samples/component-yield-parent/_config.js +++ b/test/runtime/samples/component-yield-parent/_config.js @@ -3,11 +3,11 @@ export default {

    Hello

    `, - test ( assert, component, target ) { - assert.equal( component.get().data, 'Hello' ); + test({ assert, component, target }) { + assert.equal( component.data, 'Hello' ); - component.set({ data: 'World' }); - assert.equal( component.get().data, 'World' ); + component.data = 'World'; + assert.equal( component.data, 'World' ); assert.htmlEqual( target.innerHTML, `

    World

    ` ); diff --git a/test/runtime/samples/component-yield-parent/main.html b/test/runtime/samples/component-yield-parent/main.html index 5b0a4b4f9..b36dbc1b1 100644 --- a/test/runtime/samples/component-yield-parent/main.html +++ b/test/runtime/samples/component-yield-parent/main.html @@ -1,14 +1,8 @@ -
    - {data} -
    + +
    + {data} +
    \ No newline at end of file diff --git a/test/runtime/samples/component-yield-placement/Modal.html b/test/runtime/samples/component-yield-placement/Modal.html index 0da768c45..695283754 100644 --- a/test/runtime/samples/component-yield-placement/Modal.html +++ b/test/runtime/samples/component-yield-placement/Modal.html @@ -1,6 +1,12 @@ - + + + \ No newline at end of file diff --git a/test/runtime/samples/component-yield-placement/_config.js b/test/runtime/samples/component-yield-placement/_config.js index 6e5a7d4b7..eaa600b07 100644 --- a/test/runtime/samples/component-yield-placement/_config.js +++ b/test/runtime/samples/component-yield-placement/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { showModal: true }, @@ -12,13 +12,13 @@ export default {
    `, - test ( assert, component, target, window ) { - const button = target.querySelector( 'button' ); - const click = new window.MouseEvent( 'click' ); + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const click = new window.MouseEvent('click'); - button.dispatchEvent( click ); + await button.dispatchEvent(click); - assert.htmlEqual( target.innerHTML, ` + assert.htmlEqual(target.innerHTML, ` `); } diff --git a/test/runtime/samples/component-yield-placement/main.html b/test/runtime/samples/component-yield-placement/main.html index cbcf697a4..cc5bfd73e 100644 --- a/test/runtime/samples/component-yield-placement/main.html +++ b/test/runtime/samples/component-yield-placement/main.html @@ -1,15 +1,13 @@ + + {#if showModal} - +

    Hello!

    {:else} - -{/if} - - \ No newline at end of file + +{/if} \ No newline at end of file diff --git a/test/runtime/samples/component-yield-static/Widget.html b/test/runtime/samples/component-yield-static/Widget.html index 26a00b919..aa6c6abd7 100644 --- a/test/runtime/samples/component-yield-static/Widget.html +++ b/test/runtime/samples/component-yield-static/Widget.html @@ -1 +1 @@ - + \ No newline at end of file diff --git a/test/runtime/samples/component-yield-static/_config.js b/test/runtime/samples/component-yield-static/_config.js index 06bcd8288..351c604bd 100644 --- a/test/runtime/samples/component-yield-static/_config.js +++ b/test/runtime/samples/component-yield-static/_config.js @@ -3,8 +3,8 @@ export default { Hello `, - test ( assert, component, target ) { - component.set( { name: 'World' } ); + test({ assert, component, target }) { + component.name = 'World'; assert.htmlEqual( target.innerHTML, ` Hello World ` ); diff --git a/test/runtime/samples/component-yield-static/main.html b/test/runtime/samples/component-yield-static/main.html index a9ca474d5..9d5807872 100644 --- a/test/runtime/samples/component-yield-static/main.html +++ b/test/runtime/samples/component-yield-static/main.html @@ -1,12 +1,7 @@ -Hello {name} - + +Hello {name} \ No newline at end of file diff --git a/test/runtime/samples/component-yield/main.html b/test/runtime/samples/component-yield/main.html index b8a5b648c..ff1ec93b0 100644 --- a/test/runtime/samples/component-yield/main.html +++ b/test/runtime/samples/component-yield/main.html @@ -1,16 +1,10 @@ + +

    Hello {#if test} {/if} -

    - - +

    \ No newline at end of file diff --git a/test/runtime/samples/component/Widget.html b/test/runtime/samples/component/Widget.html index 460a2a1c0..9b44ef57a 100644 --- a/test/runtime/samples/component/Widget.html +++ b/test/runtime/samples/component/Widget.html @@ -1 +1 @@ -

    i am a widget

    +

    i am a widget

    \ No newline at end of file diff --git a/test/runtime/samples/component/main.html b/test/runtime/samples/component/main.html index 5b119b552..1bd0073a0 100644 --- a/test/runtime/samples/component/main.html +++ b/test/runtime/samples/component/main.html @@ -1,11 +1,7 @@ -
    - -
    - + +
    + +
    \ No newline at end of file diff --git a/test/runtime/samples/computed-empty/_config.js b/test/runtime/samples/computed-empty/_config.js deleted file mode 100644 index 610cc1794..000000000 --- a/test/runtime/samples/computed-empty/_config.js +++ /dev/null @@ -1,8 +0,0 @@ -export default { - html: '
    empty
    ', - test ( assert, component, target ) { - assert.equal( component.get().created, true ); - assert.equal( target.innerHTML, '
    empty
    ' ); - component.destroy(); - } -}; diff --git a/test/runtime/samples/computed-empty/main.html b/test/runtime/samples/computed-empty/main.html deleted file mode 100644 index 9dd0e1092..000000000 --- a/test/runtime/samples/computed-empty/main.html +++ /dev/null @@ -1,14 +0,0 @@ -
    empty
    - diff --git a/test/runtime/samples/computed-function/_config.js b/test/runtime/samples/computed-function/_config.js deleted file mode 100644 index 018eb9f3f..000000000 --- a/test/runtime/samples/computed-function/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -export default { - html: '

    50

    ', - - test ( assert, component, target ) { - component.set({ range: [ 50, 100 ] }); - assert.htmlEqual( target.innerHTML, '

    75

    ' ); - - component.set({ range: [ 50, 60 ] }); - assert.htmlEqual( target.innerHTML, '

    55

    ' ); - - component.set({ x: 8 }); - assert.htmlEqual( target.innerHTML, '

    58

    ' ); - } -}; diff --git a/test/runtime/samples/computed-function/main.html b/test/runtime/samples/computed-function/main.html deleted file mode 100644 index a43225216..000000000 --- a/test/runtime/samples/computed-function/main.html +++ /dev/null @@ -1,20 +0,0 @@ -

    {scale(x)}

    - - diff --git a/test/runtime/samples/computed-state-object/_config.js b/test/runtime/samples/computed-state-object/_config.js deleted file mode 100644 index d9fc4d82b..000000000 --- a/test/runtime/samples/computed-state-object/_config.js +++ /dev/null @@ -1,21 +0,0 @@ -export default { - data: { a: 1 }, - - html: ` -

    a: 1

    -

    x: 2

    -

    y: 4

    -

    z: 8

    - `, - - test(assert, component, target) { - component.set({ a: 2 }); - - assert.htmlEqual(target.innerHTML, ` -

    a: 2

    -

    x: 4

    -

    y: 8

    -

    z: 16

    - `) - }, -}; diff --git a/test/runtime/samples/computed-state-object/main.html b/test/runtime/samples/computed-state-object/main.html deleted file mode 100644 index c8c313c8f..000000000 --- a/test/runtime/samples/computed-state-object/main.html +++ /dev/null @@ -1,14 +0,0 @@ -

    a: {a}

    -

    x: {x}

    -

    y: {y}

    -

    z: {z}

    - - diff --git a/test/runtime/samples/computed-values-deconflicted/main.html b/test/runtime/samples/computed-values-deconflicted/main.html deleted file mode 100644 index e5a016084..000000000 --- a/test/runtime/samples/computed-values-deconflicted/main.html +++ /dev/null @@ -1,14 +0,0 @@ -{state} - - \ No newline at end of file diff --git a/test/runtime/samples/computed-values-default/_config.js b/test/runtime/samples/computed-values-default/_config.js deleted file mode 100644 index 55d9bc8f9..000000000 --- a/test/runtime/samples/computed-values-default/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -export default { - html: '

    2

    ', - - 'skip-ssr': /^v4/.test( process.version ), // we're not transpiling server-side tests in Node 4, because it's tricky - - test ( assert, component, target ) { - component.set({ a: 2 }); - assert.equal( target.innerHTML, '

    4

    ' ); - component.destroy(); - } -}; diff --git a/test/runtime/samples/computed-values-default/main.html b/test/runtime/samples/computed-values-default/main.html deleted file mode 100644 index b26762f3d..000000000 --- a/test/runtime/samples/computed-values-default/main.html +++ /dev/null @@ -1,9 +0,0 @@ -

    {foo}

    - - diff --git a/test/runtime/samples/computed-values-function-dependency/_config.js b/test/runtime/samples/computed-values-function-dependency/_config.js deleted file mode 100644 index 9320a0aad..000000000 --- a/test/runtime/samples/computed-values-function-dependency/_config.js +++ /dev/null @@ -1,10 +0,0 @@ -export default { - html: '

    2

    ', - - test ( assert, component, target ) { - component.set({ y: 2 }); - assert.equal( component.get().x, 4 ); - assert.equal( target.innerHTML, '

    4

    ' ); - component.destroy(); - } -}; diff --git a/test/runtime/samples/computed-values-function-dependency/main.html b/test/runtime/samples/computed-values-function-dependency/main.html deleted file mode 100644 index adf66137f..000000000 --- a/test/runtime/samples/computed-values-function-dependency/main.html +++ /dev/null @@ -1,28 +0,0 @@ -

    {x}

    - - \ No newline at end of file diff --git a/test/runtime/samples/computed-values/_config.js b/test/runtime/samples/computed-values/_config.js deleted file mode 100644 index 8d52627c4..000000000 --- a/test/runtime/samples/computed-values/_config.js +++ /dev/null @@ -1,10 +0,0 @@ -export default { - html: '

    1 + 2 = 3

    \n

    3 * 3 = 9

    ', - test ( assert, component, target ) { - component.set({ a: 3 }); - assert.equal( component.get().c, 5 ); - assert.equal( component.get().cSquared, 25 ); - assert.equal( target.innerHTML, '

    3 + 2 = 5

    \n

    5 * 5 = 25

    ' ); - component.destroy(); - } -}; diff --git a/test/runtime/samples/computed-values/main.html b/test/runtime/samples/computed-values/main.html deleted file mode 100644 index 7e4f8d772..000000000 --- a/test/runtime/samples/computed-values/main.html +++ /dev/null @@ -1,16 +0,0 @@ -

    {a} + {b} = {c}

    -

    {c} * {c} = {cSquared}

    - - diff --git a/test/runtime/samples/computed-whole-state/_config.js b/test/runtime/samples/computed-whole-state/_config.js deleted file mode 100644 index 0281827b4..000000000 --- a/test/runtime/samples/computed-whole-state/_config.js +++ /dev/null @@ -1,25 +0,0 @@ -export default { - html: ` -
    {"wanted":2}
    - `, - - test(assert, component, target) { - component.set({ - unwanted: 3, - wanted: 4, - }); - - assert.htmlEqual(target.innerHTML, ` -
    {"wanted":4}
    - `); - - component.set({ - unwanted: 5, - wanted: 6, - }); - - assert.htmlEqual(target.innerHTML, ` -
    {"wanted":6}
    - `); - }, -}; diff --git a/test/runtime/samples/computed-whole-state/main.html b/test/runtime/samples/computed-whole-state/main.html deleted file mode 100644 index 476d11cc8..000000000 --- a/test/runtime/samples/computed-whole-state/main.html +++ /dev/null @@ -1,22 +0,0 @@ -
    {JSON.stringify(props)}
    - diff --git a/test/runtime/samples/css-comments/_config.js b/test/runtime/samples/css-comments/_config.js index f6235d06a..7f11f792c 100644 --- a/test/runtime/samples/css-comments/_config.js +++ b/test/runtime/samples/css-comments/_config.js @@ -1,6 +1,6 @@ // JSDOM makes this test pass when it should fail. weird export default { - test ( assert, component, target, window ) { + test({ assert, component, target, window }) { const p = target.querySelector( 'p' ); assert.equal( window.getComputedStyle( p ).color, 'red' ); } diff --git a/test/runtime/samples/css-comments/main.html b/test/runtime/samples/css-comments/main.html index 68eebfdf3..008cbae63 100644 --- a/test/runtime/samples/css-comments/main.html +++ b/test/runtime/samples/css-comments/main.html @@ -8,4 +8,4 @@ p { color: red; } - + \ No newline at end of file diff --git a/test/runtime/samples/css-false/Widget.html b/test/runtime/samples/css-false/Widget.html index 1d893b8bc..da7fd4e8b 100644 --- a/test/runtime/samples/css-false/Widget.html +++ b/test/runtime/samples/css-false/Widget.html @@ -4,4 +4,4 @@ p { color: red; } - + \ No newline at end of file diff --git a/test/runtime/samples/css-false/_config.js b/test/runtime/samples/css-false/_config.js index df9ef69c5..2ade2acf8 100644 --- a/test/runtime/samples/css-false/_config.js +++ b/test/runtime/samples/css-false/_config.js @@ -3,7 +3,7 @@ export default { css: false }, - test ( assert, component, target, window ) { + test({ assert, component, target, window }) { const [ control, test ] = target.querySelectorAll( 'p' ); assert.equal( window.getComputedStyle( control ).color, '' ); diff --git a/test/runtime/samples/css-false/main.html b/test/runtime/samples/css-false/main.html index 70e77bd59..dbbc5c325 100644 --- a/test/runtime/samples/css-false/main.html +++ b/test/runtime/samples/css-false/main.html @@ -1,10 +1,6 @@ -

    control

    - - + +

    control

    + \ No newline at end of file diff --git a/test/runtime/samples/css-space-in-attribute/Widget.html b/test/runtime/samples/css-space-in-attribute/Widget.html index 929e1d40b..b812ed881 100644 --- a/test/runtime/samples/css-space-in-attribute/Widget.html +++ b/test/runtime/samples/css-space-in-attribute/Widget.html @@ -8,4 +8,4 @@ [class*=" bar"] { background: black; } - + \ No newline at end of file diff --git a/test/runtime/samples/css-space-in-attribute/_config.js b/test/runtime/samples/css-space-in-attribute/_config.js index 3b52fb71d..dc931217f 100644 --- a/test/runtime/samples/css-space-in-attribute/_config.js +++ b/test/runtime/samples/css-space-in-attribute/_config.js @@ -1,5 +1,5 @@ export default { - test ( assert, component, target, window ) { + test({ assert, component, target, window }) { const [ control, test ] = target.querySelectorAll( 'p' ); assert.equal( window.getComputedStyle( control ).color, '' ); diff --git a/test/runtime/samples/css-space-in-attribute/main.html b/test/runtime/samples/css-space-in-attribute/main.html index 211e42721..93bec897f 100644 --- a/test/runtime/samples/css-space-in-attribute/main.html +++ b/test/runtime/samples/css-space-in-attribute/main.html @@ -1,10 +1,6 @@ -

    control

    - - + +

    control

    + \ No newline at end of file diff --git a/test/runtime/samples/css/Widget.html b/test/runtime/samples/css/Widget.html index ad2b7e681..43328db0f 100644 --- a/test/runtime/samples/css/Widget.html +++ b/test/runtime/samples/css/Widget.html @@ -4,4 +4,4 @@ p { color: #f00; } - + \ No newline at end of file diff --git a/test/runtime/samples/css/_config.js b/test/runtime/samples/css/_config.js index 86b237b41..c4500e744 100644 --- a/test/runtime/samples/css/_config.js +++ b/test/runtime/samples/css/_config.js @@ -1,8 +1,8 @@ export default { - test ( assert, component, target, window ) { - const [ control, test ] = target.querySelectorAll( 'p' ); + test({ assert, component, target, window }) { + const [control, test] = target.querySelectorAll('p'); - assert.equal( window.getComputedStyle( control ).color, '' ); - assert.equal( window.getComputedStyle( test ).color, 'rgb(255, 0, 0)' ); + assert.equal(window.getComputedStyle(control).color, ''); + assert.equal(window.getComputedStyle(test).color, 'rgb(255, 0, 0)'); } }; diff --git a/test/runtime/samples/css/main.html b/test/runtime/samples/css/main.html index 70e77bd59..dbbc5c325 100644 --- a/test/runtime/samples/css/main.html +++ b/test/runtime/samples/css/main.html @@ -1,10 +1,6 @@ -

    control

    - - + +

    control

    + \ No newline at end of file diff --git a/test/runtime/samples/custom-method/_config.js b/test/runtime/samples/custom-method/_config.js index fb1aa7f46..b19873189 100644 --- a/test/runtime/samples/custom-method/_config.js +++ b/test/runtime/samples/custom-method/_config.js @@ -1,17 +1,18 @@ export default { html: '\n\n

    0

    ', - test ( assert, component, target, window ) { - const button = target.querySelector( 'button' ); - const event = new window.MouseEvent( 'click' ); - button.dispatchEvent( event ); - assert.equal( component.get().counter, 1 ); - assert.equal( target.innerHTML, '\n\n

    1

    ' ); + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const event = new window.MouseEvent('click'); - button.dispatchEvent( event ); - assert.equal( component.get().counter, 2 ); - assert.equal( target.innerHTML, '\n\n

    2

    ' ); + await button.dispatchEvent(event); + assert.equal(component.counter, 1); + assert.equal(target.innerHTML, '\n\n

    1

    '); - assert.equal( component.foo(), 42 ); + await button.dispatchEvent(event); + assert.equal(component.counter, 2); + assert.equal(target.innerHTML, '\n\n

    2

    '); + + assert.equal(component.foo(), 42); } }; diff --git a/test/runtime/samples/custom-method/main.html b/test/runtime/samples/custom-method/main.html index 0f1ad3387..cd1f4ec45 100644 --- a/test/runtime/samples/custom-method/main.html +++ b/test/runtime/samples/custom-method/main.html @@ -1,21 +1,15 @@ - - -

    {counter}

    - + + + +

    {counter}

    \ No newline at end of file diff --git a/test/runtime/samples/deconflict-builtins/_config.js b/test/runtime/samples/deconflict-builtins/_config.js index debcfeaa1..c7053194e 100644 --- a/test/runtime/samples/deconflict-builtins/_config.js +++ b/test/runtime/samples/deconflict-builtins/_config.js @@ -1,8 +1,7 @@ export default { html: `got`, - test ( assert, component ) { - assert.equal( component.get().foo, 'got' ); - component.destroy(); + test({ assert, component }) { + assert.equal(component.foo, 'got'); } }; \ No newline at end of file diff --git a/test/runtime/samples/deconflict-builtins/main.html b/test/runtime/samples/deconflict-builtins/main.html index 4da19ce0c..7196d3eb5 100644 --- a/test/runtime/samples/deconflict-builtins/main.html +++ b/test/runtime/samples/deconflict-builtins/main.html @@ -1,13 +1,7 @@ -{foo} - \ No newline at end of file + export let foo = get(); + + +{foo} \ No newline at end of file diff --git a/test/runtime/samples/deconflict-component-refs/_config.js b/test/runtime/samples/deconflict-component-refs/_config.js index 45f01e43e..8092aed7c 100644 --- a/test/runtime/samples/deconflict-component-refs/_config.js +++ b/test/runtime/samples/deconflict-component-refs/_config.js @@ -15,7 +15,7 @@ export default { `, - data: { + props: { components: [ { name: 'foo', edit: true }, { name: 'bar', edit: false }, diff --git a/test/runtime/samples/deconflict-component-refs/main.html b/test/runtime/samples/deconflict-component-refs/main.html index 73a1af75c..090613541 100644 --- a/test/runtime/samples/deconflict-component-refs/main.html +++ b/test/runtime/samples/deconflict-component-refs/main.html @@ -1,8 +1,13 @@ + +
      {#each components as component}
    • {#if component.edit} - + {:else} {component.name} {/if} diff --git a/test/runtime/samples/deconflict-contexts/_config.js b/test/runtime/samples/deconflict-contexts/_config.js index 1a0813321..a32300e58 100644 --- a/test/runtime/samples/deconflict-contexts/_config.js +++ b/test/runtime/samples/deconflict-contexts/_config.js @@ -3,7 +3,7 @@ export default {
      • foo
      • bar
      • baz
      `, - data: { + props: { components: [ 'foo', 'bar', 'baz' ] } }; \ No newline at end of file diff --git a/test/runtime/samples/deconflict-elements-indexes/_config.js b/test/runtime/samples/deconflict-elements-indexes/_config.js index 7e3a91a30..b531603ac 100644 --- a/test/runtime/samples/deconflict-elements-indexes/_config.js +++ b/test/runtime/samples/deconflict-elements-indexes/_config.js @@ -7,10 +7,10 @@ export default { preserveIdentifiers: true, - test(assert, component, target) { - const { tagList } = component.get(); + test({ assert, component, target }) { + const { tagList } = component; tagList.push('two'); - component.set({ tagList }); + component.tagList = tagList; assert.htmlEqual(target.innerHTML, `
      diff --git a/test/runtime/samples/deconflict-elements-indexes/main.html b/test/runtime/samples/deconflict-elements-indexes/main.html index ce6de6b08..c506848bd 100644 --- a/test/runtime/samples/deconflict-elements-indexes/main.html +++ b/test/runtime/samples/deconflict-elements-indexes/main.html @@ -1,24 +1,15 @@ + +
      {#each tagList as tag, i} - + {tag} {/each} -
      - - \ No newline at end of file +
      \ No newline at end of file diff --git a/test/runtime/samples/deconflict-non-helpers/_config.js b/test/runtime/samples/deconflict-non-helpers/_config.js index 51670f56f..167ddc279 100644 --- a/test/runtime/samples/deconflict-non-helpers/_config.js +++ b/test/runtime/samples/deconflict-non-helpers/_config.js @@ -1,8 +1,7 @@ export default { html: `ABCD`, - test ( assert, component ) { - assert.equal( component.get().compute, 'ABCD' ); - component.destroy(); + test({ assert, component }) { + assert.equal(component.compute(), 'ABCD'); } }; diff --git a/test/runtime/samples/deconflict-non-helpers/main.html b/test/runtime/samples/deconflict-non-helpers/main.html index d6ee1eaea..02cab9d7e 100644 --- a/test/runtime/samples/deconflict-non-helpers/main.html +++ b/test/runtime/samples/deconflict-non-helpers/main.html @@ -1,17 +1,14 @@ -{compute} + +{compute()} + diff --git a/test/runtime/samples/deconflict-self/main.html b/test/runtime/samples/deconflict-self/main.html index a9ddc8ac6..30f524eb6 100644 --- a/test/runtime/samples/deconflict-self/main.html +++ b/test/runtime/samples/deconflict-self/main.html @@ -1,9 +1,5 @@ -
      - - export default { - components: { Main } - }; - \ No newline at end of file +
      \ No newline at end of file diff --git a/test/runtime/samples/deconflict-template-1/main.html b/test/runtime/samples/deconflict-template-1/main.html index 395d7b22b..70fc1997b 100644 --- a/test/runtime/samples/deconflict-template-1/main.html +++ b/test/runtime/samples/deconflict-template-1/main.html @@ -1,13 +1,7 @@ -{value} - + +{value} diff --git a/test/runtime/samples/deconflict-template-2/main.html b/test/runtime/samples/deconflict-template-2/main.html index 79f76724e..0c2fae81d 100644 --- a/test/runtime/samples/deconflict-template-2/main.html +++ b/test/runtime/samples/deconflict-template-2/main.html @@ -1,15 +1,9 @@ -{value} - + +{value} diff --git a/test/runtime/samples/deconflict-vars/main.html b/test/runtime/samples/deconflict-vars/main.html index ed2cd6c4a..72ab82f2c 100644 --- a/test/runtime/samples/deconflict-vars/main.html +++ b/test/runtime/samples/deconflict-vars/main.html @@ -1,5 +1,3 @@ -

      {value}

      - + +

      {value}

      diff --git a/test/runtime/samples/default-data-function/_config.js b/test/runtime/samples/default-data-function/_config.js index 94658e545..3f091e438 100644 --- a/test/runtime/samples/default-data-function/_config.js +++ b/test/runtime/samples/default-data-function/_config.js @@ -1,8 +1,8 @@ export default { html: '

      Hello world!

      ', - test ( assert, component, target ) { - component.set({ name: () => 'everybody' }); + test({ assert, component, target }) { + component.name = () => 'everybody'; assert.htmlEqual( target.innerHTML, '

      Hello everybody!

      ' ); } }; diff --git a/test/runtime/samples/default-data-function/main.html b/test/runtime/samples/default-data-function/main.html index 5225b6c3c..57d2df771 100644 --- a/test/runtime/samples/default-data-function/main.html +++ b/test/runtime/samples/default-data-function/main.html @@ -1,9 +1,5 @@ -

      Hello {name()}!

      - + +

      Hello {name()}!

      diff --git a/test/runtime/samples/default-data-override/_config.js b/test/runtime/samples/default-data-override/_config.js index dbeb7db0b..5b21ee749 100644 --- a/test/runtime/samples/default-data-override/_config.js +++ b/test/runtime/samples/default-data-override/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { name: 'everybody' }, diff --git a/test/runtime/samples/default-data-override/main.html b/test/runtime/samples/default-data-override/main.html index afd9e23a7..a8d2fcfb7 100644 --- a/test/runtime/samples/default-data-override/main.html +++ b/test/runtime/samples/default-data-override/main.html @@ -1,9 +1,5 @@ -

      Hello {name}!

      - + +

      Hello {name}!

      diff --git a/test/runtime/samples/default-data/main.html b/test/runtime/samples/default-data/main.html index afd9e23a7..a8d2fcfb7 100644 --- a/test/runtime/samples/default-data/main.html +++ b/test/runtime/samples/default-data/main.html @@ -1,9 +1,5 @@ -

      Hello {name}!

      - + +

      Hello {name}!

      diff --git a/test/runtime/samples/destroy-twice/_config.js b/test/runtime/samples/destroy-twice/_config.js index 1adc3e3d0..041518d28 100644 --- a/test/runtime/samples/destroy-twice/_config.js +++ b/test/runtime/samples/destroy-twice/_config.js @@ -1,6 +1,6 @@ export default { - test(assert, component) { - component.destroy(); - component.destroy(); + test({ assert, component }) { + component.$destroy(); + component.$destroy(); } }; \ No newline at end of file diff --git a/test/runtime/samples/destructuring/_config.js b/test/runtime/samples/destructuring/_config.js index 77308e36b..b8b138dfd 100644 --- a/test/runtime/samples/destructuring/_config.js +++ b/test/runtime/samples/destructuring/_config.js @@ -1,27 +1,25 @@ export default { html: ``, - data: { + props: { foo: 42 }, - test ( assert, component, target, window ) { - const event = new window.MouseEvent( 'click' ); - const button = target.querySelector( 'button' ); + test({ assert, component, target, window }) { + const event = new window.MouseEvent('click'); + const button = target.querySelector('button'); let count = 0; let number = null; - component.on( 'foo', obj => { + component.$on('foo', event => { count++; - number = obj.foo; + number = event.detail.foo; }); - button.dispatchEvent( event ); + button.dispatchEvent(event); - assert.equal( count, 1 ); - assert.equal( number, 42 ); - - component.destroy(); + assert.equal(count, 1); + assert.equal(number, 42); } }; \ No newline at end of file diff --git a/test/runtime/samples/destructuring/main.html b/test/runtime/samples/destructuring/main.html index 5d98aaae1..f6f739481 100644 --- a/test/runtime/samples/destructuring/main.html +++ b/test/runtime/samples/destructuring/main.html @@ -1 +1,9 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/test/runtime/samples/dev-accept-declarative-store/_config.js b/test/runtime/samples/dev-accept-declarative-store/_config.js deleted file mode 100644 index 5b9d5ecf1..000000000 --- a/test/runtime/samples/dev-accept-declarative-store/_config.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - compileOptions: { - dev: true - } -}; diff --git a/test/runtime/samples/dev-accept-declarative-store/main.html b/test/runtime/samples/dev-accept-declarative-store/main.html deleted file mode 100644 index a20bbf0d6..000000000 --- a/test/runtime/samples/dev-accept-declarative-store/main.html +++ /dev/null @@ -1,11 +0,0 @@ -

      {$foo}

      - - diff --git a/test/runtime/samples/dev-error-missing-store-option/_config.js b/test/runtime/samples/dev-error-missing-store-option/_config.js deleted file mode 100644 index c280c8285..000000000 --- a/test/runtime/samples/dev-error-missing-store-option/_config.js +++ /dev/null @@ -1,7 +0,0 @@ -export default { - compileOptions: { - dev: true - }, - - error: ` references store properties, but no store was provided` -}; diff --git a/test/runtime/samples/dev-error-missing-store-option/main.html b/test/runtime/samples/dev-error-missing-store-option/main.html deleted file mode 100644 index a0f20409a..000000000 --- a/test/runtime/samples/dev-error-missing-store-option/main.html +++ /dev/null @@ -1 +0,0 @@ -

      {$foo}

      \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-bad-set-argument/_config.js b/test/runtime/samples/dev-warning-bad-set-argument/_config.js deleted file mode 100644 index 4625bc09e..000000000 --- a/test/runtime/samples/dev-warning-bad-set-argument/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -export default { - compileOptions: { - dev: true - }, - - error(assert, error) { - assert.equal(error.message, `.set was called without an object of data key-values to update.`); - } -}; diff --git a/test/runtime/samples/dev-warning-bad-set-argument/main.html b/test/runtime/samples/dev-warning-bad-set-argument/main.html deleted file mode 100644 index cbaf739b1..000000000 --- a/test/runtime/samples/dev-warning-bad-set-argument/main.html +++ /dev/null @@ -1,11 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-destroy-twice/_config.js b/test/runtime/samples/dev-warning-destroy-twice/_config.js index 0308833c4..3acbd6447 100644 --- a/test/runtime/samples/dev-warning-destroy-twice/_config.js +++ b/test/runtime/samples/dev-warning-destroy-twice/_config.js @@ -3,7 +3,7 @@ export default { dev: true }, - test(assert, component) { + test({ assert, component }) { const warn = console.warn; // eslint-disable-line no-console const warnings = []; @@ -11,8 +11,8 @@ export default { warnings.push(warning); }; - component.destroy(); - component.destroy(); + component.$destroy(); + component.$destroy(); assert.deepEqual(warnings, [ `Component was already destroyed` diff --git a/test/runtime/samples/dev-warning-dynamic-components-misplaced/Bar.html b/test/runtime/samples/dev-warning-dynamic-components-misplaced/Bar.html deleted file mode 100644 index d9d3a9a89..000000000 --- a/test/runtime/samples/dev-warning-dynamic-components-misplaced/Bar.html +++ /dev/null @@ -1 +0,0 @@ -Bar \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-dynamic-components-misplaced/Foo.html b/test/runtime/samples/dev-warning-dynamic-components-misplaced/Foo.html deleted file mode 100644 index 9f26b637f..000000000 --- a/test/runtime/samples/dev-warning-dynamic-components-misplaced/Foo.html +++ /dev/null @@ -1 +0,0 @@ -Foo \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-dynamic-components-misplaced/_config.js b/test/runtime/samples/dev-warning-dynamic-components-misplaced/_config.js deleted file mode 100644 index 1102edb1b..000000000 --- a/test/runtime/samples/dev-warning-dynamic-components-misplaced/_config.js +++ /dev/null @@ -1,16 +0,0 @@ -export default { - compileOptions: { - dev: true - }, - - data: { - x: true - }, - - html: '', - - warnings: [ - ` expected to find 'Foo' in \`data\`, but found it in \`components\` instead`, - ` expected to find 'Bar' in \`data\`, but found it in \`components\` instead` - ] -}; \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-dynamic-components-misplaced/main.html b/test/runtime/samples/dev-warning-dynamic-components-misplaced/main.html deleted file mode 100644 index eb6e7d8e8..000000000 --- a/test/runtime/samples/dev-warning-dynamic-components-misplaced/main.html +++ /dev/null @@ -1,13 +0,0 @@ - - - \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-helper/_config.js b/test/runtime/samples/dev-warning-helper/_config.js index 75f0836e8..695d42237 100644 --- a/test/runtime/samples/dev-warning-helper/_config.js +++ b/test/runtime/samples/dev-warning-helper/_config.js @@ -3,7 +3,7 @@ export default { dev: true }, - data: { + props: { bar: 1 }, diff --git a/test/runtime/samples/dev-warning-helper/main.html b/test/runtime/samples/dev-warning-helper/main.html index 07d261a81..56ddbf1c5 100644 --- a/test/runtime/samples/dev-warning-helper/main.html +++ b/test/runtime/samples/dev-warning-helper/main.html @@ -1,11 +1,9 @@ -{foo(bar)} - \ No newline at end of file + export let bar; + + function foo(bar) { + return bar * 2; + } + + +{foo(bar)} \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-missing-data-each/_config.js b/test/runtime/samples/dev-warning-missing-data-each/_config.js index 3edd37621..92cda48fc 100644 --- a/test/runtime/samples/dev-warning-missing-data-each/_config.js +++ b/test/runtime/samples/dev-warning-missing-data-each/_config.js @@ -3,7 +3,7 @@ export default { dev: true }, - data: { + props: { letters: [ { id: 1, diff --git a/test/runtime/samples/dev-warning-missing-data-excludes-event/main.html b/test/runtime/samples/dev-warning-missing-data-excludes-event/main.html index ae30c7f05..1c420cfcf 100644 --- a/test/runtime/samples/dev-warning-missing-data-excludes-event/main.html +++ b/test/runtime/samples/dev-warning-missing-data-excludes-event/main.html @@ -1 +1 @@ - + diff --git a/test/runtime/samples/dev-warning-readonly-computed/_config.js b/test/runtime/samples/dev-warning-readonly-computed/_config.js index bf841403a..e8ffbaba3 100644 --- a/test/runtime/samples/dev-warning-readonly-computed/_config.js +++ b/test/runtime/samples/dev-warning-readonly-computed/_config.js @@ -3,13 +3,13 @@ export default { dev: true }, - data: { + props: { a: 42 }, - test ( assert, component ) { + test({ assert, component }) { try { - component.set({ foo: 1 }); + component.foo = 1; throw new Error( 'Expected an error' ); } catch ( err ) { assert.equal( err.message, `: Cannot set read-only property 'foo'` ); diff --git a/test/runtime/samples/dev-warning-readonly-computed/main.html b/test/runtime/samples/dev-warning-readonly-computed/main.html index 199aac1a9..3c395561e 100644 --- a/test/runtime/samples/dev-warning-readonly-computed/main.html +++ b/test/runtime/samples/dev-warning-readonly-computed/main.html @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-readonly-window-binding/_config.js b/test/runtime/samples/dev-warning-readonly-window-binding/_config.js index 9b9ee81c4..751cffde7 100644 --- a/test/runtime/samples/dev-warning-readonly-window-binding/_config.js +++ b/test/runtime/samples/dev-warning-readonly-window-binding/_config.js @@ -3,12 +3,12 @@ export default { dev: true }, - test ( assert, component ) { + test({ assert, component }) { try { - component.set({ width: 99 }); - throw new Error( 'Expected an error' ); - } catch ( err ) { - assert.equal( err.message, `: Cannot set read-only property 'width'` ); + component.width = 99; + throw new Error('Expected an error'); + } catch (err) { + assert.equal(err.message, `: Cannot set read-only property 'width'`); } } }; \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-readonly-window-binding/main.html b/test/runtime/samples/dev-warning-readonly-window-binding/main.html index 87b0403ee..bd2d50d38 100644 --- a/test/runtime/samples/dev-warning-readonly-window-binding/main.html +++ b/test/runtime/samples/dev-warning-readonly-window-binding/main.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/document-event/_config.js b/test/runtime/samples/document-event/_config.js index 946ba63ee..98e619af0 100644 --- a/test/runtime/samples/document-event/_config.js +++ b/test/runtime/samples/document-event/_config.js @@ -1,11 +1,13 @@ export default { - test(assert, component, target, window) { - assert.equal(component.get().events.toString(), ''); + test({ assert, component, target, window }) { + assert.deepEqual(component.events, []); + const event1 = new window.Event('mouseenter'); window.document.dispatchEvent(event1); - assert.equal(component.get().events.toString(), 'enter'); + assert.deepEqual(component.events, ['enter']); + const event2 = new window.Event('mouseleave'); window.document.dispatchEvent(event2); - assert.equal(component.get().events.toString(), 'enter,leave'); + assert.deepEqual(component.events, ['enter', 'leave']); }, }; \ No newline at end of file diff --git a/test/runtime/samples/document-event/main.html b/test/runtime/samples/document-event/main.html index 4e6aa9351..6e7ab3a47 100644 --- a/test/runtime/samples/document-event/main.html +++ b/test/runtime/samples/document-event/main.html @@ -1,12 +1,9 @@ - - \ No newline at end of file + export let events = []; + + function log(event) { + events.push(event); + } + + + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated-b/Green.html b/test/runtime/samples/dynamic-component-bindings-recreated-b/Green.html index cb1506bfd..613d3ff52 100644 --- a/test/runtime/samples/dynamic-component-bindings-recreated-b/Green.html +++ b/test/runtime/samples/dynamic-component-bindings-recreated-b/Green.html @@ -1,11 +1,5 @@ -

      green {foo}

      - \ No newline at end of file + export let foo = 'green'; + + +

      green {foo}

      \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated-b/Red.html b/test/runtime/samples/dynamic-component-bindings-recreated-b/Red.html index e86ea1618..b83dfe150 100644 --- a/test/runtime/samples/dynamic-component-bindings-recreated-b/Red.html +++ b/test/runtime/samples/dynamic-component-bindings-recreated-b/Red.html @@ -1,11 +1,5 @@ -

      red {foo}

      - \ No newline at end of file + export let foo = 'red'; + + +

      red {foo}

      \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated-b/_config.js b/test/runtime/samples/dynamic-component-bindings-recreated-b/_config.js index 050dff684..0df87f06c 100644 --- a/test/runtime/samples/dynamic-component-bindings-recreated-b/_config.js +++ b/test/runtime/samples/dynamic-component-bindings-recreated-b/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: true }, @@ -8,25 +8,17 @@ export default {

      green green

      `, - test(assert, component, target) { - // TODO replace this with component.set({ foo: undefined }) post-#1488 - // component.set({ foo: undefined }); - // delete component._state.foo; - - component.set({ - x: false, - foo: undefined - }); + test({ assert, component, target }) { + component.foo = undefined; + component.x = false; assert.htmlEqual(target.innerHTML, `

      parent red

      red red

      `); - component.set({ - x: true, - foo: undefined - }); + component.foo = undefined; + component.x = true; assert.htmlEqual(target.innerHTML, `

      parent green

      diff --git a/test/runtime/samples/dynamic-component-bindings-recreated-b/main.html b/test/runtime/samples/dynamic-component-bindings-recreated-b/main.html index 41a54e8ee..cdae60e83 100644 --- a/test/runtime/samples/dynamic-component-bindings-recreated-b/main.html +++ b/test/runtime/samples/dynamic-component-bindings-recreated-b/main.html @@ -1,16 +1,10 @@ -

      parent {foo}

      - - \ No newline at end of file + export let foo; + export let x; + + +

      parent {foo}

      + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings-recreated/_config.js b/test/runtime/samples/dynamic-component-bindings-recreated/_config.js index de3f0d0eb..b57c49ed5 100644 --- a/test/runtime/samples/dynamic-component-bindings-recreated/_config.js +++ b/test/runtime/samples/dynamic-component-bindings-recreated/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: true, foo: 'one' }, @@ -8,19 +8,15 @@ export default {

      green one

      `, - test(assert, component, target) { - component.set({ - x: false - }); + test({ assert, component, target }) { + component.x = false; assert.htmlEqual(target.innerHTML, `

      red one

      `); - component.set({ - x: true, - foo: 'two' - }); + component.foo = 'two'; + component.x = true; assert.htmlEqual(target.innerHTML, `

      green two

      diff --git a/test/runtime/samples/dynamic-component-bindings-recreated/main.html b/test/runtime/samples/dynamic-component-bindings-recreated/main.html index a26c1cd08..c91906e5d 100644 --- a/test/runtime/samples/dynamic-component-bindings-recreated/main.html +++ b/test/runtime/samples/dynamic-component-bindings-recreated/main.html @@ -1,15 +1,9 @@ - - \ No newline at end of file + export let x; + export let foo; + + + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings/Bar.html b/test/runtime/samples/dynamic-component-bindings/Bar.html index f609d76eb..71e6fd8ac 100644 --- a/test/runtime/samples/dynamic-component-bindings/Bar.html +++ b/test/runtime/samples/dynamic-component-bindings/Bar.html @@ -1,2 +1,2 @@

      bar

      - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings/Foo.html b/test/runtime/samples/dynamic-component-bindings/Foo.html index cae76b057..01faecfa4 100644 --- a/test/runtime/samples/dynamic-component-bindings/Foo.html +++ b/test/runtime/samples/dynamic-component-bindings/Foo.html @@ -1,2 +1,2 @@

      foo

      - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings/_config.js b/test/runtime/samples/dynamic-component-bindings/_config.js index 28ffc1664..9ef9a87b9 100644 --- a/test/runtime/samples/dynamic-component-bindings/_config.js +++ b/test/runtime/samples/dynamic-component-bindings/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: true }, @@ -8,16 +8,14 @@ export default { `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { let input = target.querySelector('input'); input.value = 'abc'; - input.dispatchEvent(new window.Event('input')); + await input.dispatchEvent(new window.Event('input')); - assert.equal(component.get().y, 'abc'); + assert.equal(component.y, 'abc'); - component.set({ - x: false - }); + component.x = false; assert.htmlEqual(target.innerHTML, `

      bar

      @@ -26,8 +24,8 @@ export default { input = target.querySelector('input'); input.checked = true; - input.dispatchEvent(new window.Event('change')); + await input.dispatchEvent(new window.Event('change')); - assert.equal(component.get().z, true); + assert.equal(component.z, true); } }; \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-bindings/main.html b/test/runtime/samples/dynamic-component-bindings/main.html index 020855cb2..0df350a9f 100644 --- a/test/runtime/samples/dynamic-component-bindings/main.html +++ b/test/runtime/samples/dynamic-component-bindings/main.html @@ -1,12 +1,10 @@ - - \ No newline at end of file + export let x; + export let y; + export let z; + + + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-destroy-null/_config.js b/test/runtime/samples/dynamic-component-destroy-null/_config.js index b85e35e25..3c47aa5ba 100644 --- a/test/runtime/samples/dynamic-component-destroy-null/_config.js +++ b/test/runtime/samples/dynamic-component-destroy-null/_config.js @@ -1,13 +1,9 @@ export default { - data: { + props: { x: true }, - nestedTransitions: true, - - test(assert, component) { - component.set({ - x: false - }); + test({ assert, component }) { + component.x = false; } }; \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-events/Bar.html b/test/runtime/samples/dynamic-component-events/Bar.html index e6f79984c..4168bebd9 100644 --- a/test/runtime/samples/dynamic-component-events/Bar.html +++ b/test/runtime/samples/dynamic-component-events/Bar.html @@ -1 +1,7 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-events/Foo.html b/test/runtime/samples/dynamic-component-events/Foo.html index 3601714a5..e5c8fa014 100644 --- a/test/runtime/samples/dynamic-component-events/Foo.html +++ b/test/runtime/samples/dynamic-component-events/Foo.html @@ -1 +1,7 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-events/_config.js b/test/runtime/samples/dynamic-component-events/_config.js index b125e4078..3c6bf370b 100644 --- a/test/runtime/samples/dynamic-component-events/_config.js +++ b/test/runtime/samples/dynamic-component-events/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: true }, @@ -7,21 +7,19 @@ export default { `, - test(assert, component, target, window) { + test({ assert, component, target, window }) { const click = new window.MouseEvent('click'); target.querySelector('button').dispatchEvent(click); - assert.equal(component.get().selected, 'foo'); + assert.equal(component.selected, 'foo'); - component.set({ - x: false - }); + component.x = false; assert.htmlEqual(target.innerHTML, ` `); target.querySelector('button').dispatchEvent(click); - assert.equal(component.get().selected, 'bar'); + assert.equal(component.selected, 'bar'); } }; \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-events/main.html b/test/runtime/samples/dynamic-component-events/main.html index 5fa66b2c6..77856e8e6 100644 --- a/test/runtime/samples/dynamic-component-events/main.html +++ b/test/runtime/samples/dynamic-component-events/main.html @@ -1,12 +1,9 @@ - - \ No newline at end of file + export let x; + export let selected; + + + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-in-if/_config.js b/test/runtime/samples/dynamic-component-in-if/_config.js index b8600a684..b481c229c 100644 --- a/test/runtime/samples/dynamic-component-in-if/_config.js +++ b/test/runtime/samples/dynamic-component-in-if/_config.js @@ -3,12 +3,8 @@ export default {

      Foo

      `, - test(assert, component, target) { - const { Bar } = component.get(); - - component.set({ - x: Bar - }); + test({ assert, component, target }) { + component.x = component.Bar; assert.htmlEqual(target.innerHTML, `

      Bar

      diff --git a/test/runtime/samples/dynamic-component-in-if/main.html b/test/runtime/samples/dynamic-component-in-if/main.html index 7b5b430ff..dfd6f6a08 100644 --- a/test/runtime/samples/dynamic-component-in-if/main.html +++ b/test/runtime/samples/dynamic-component-in-if/main.html @@ -1,18 +1,11 @@ -{#if x} - -{/if} - \ No newline at end of file + export { Bar }; + export let x = Foo; + + +{#if x} + +{/if} \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-inside-element/_config.js b/test/runtime/samples/dynamic-component-inside-element/_config.js index de1dbfdac..2e363f10d 100644 --- a/test/runtime/samples/dynamic-component-inside-element/_config.js +++ b/test/runtime/samples/dynamic-component-inside-element/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: true }, @@ -7,10 +7,8 @@ export default {

      true, therefore Foo

      `, - test(assert, component, target) { - component.set({ - x: false - }); + test({ assert, component, target }) { + component.x = false; assert.htmlEqual(target.innerHTML, `

      false, therefore Bar

      diff --git a/test/runtime/samples/dynamic-component-inside-element/main.html b/test/runtime/samples/dynamic-component-inside-element/main.html index 084434630..2a882c945 100644 --- a/test/runtime/samples/dynamic-component-inside-element/main.html +++ b/test/runtime/samples/dynamic-component-inside-element/main.html @@ -1,14 +1,10 @@ -
      - -
      - \ No newline at end of file + export let x; + + +
      + +
      \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-nulled-out/_config.js b/test/runtime/samples/dynamic-component-nulled-out/_config.js index 17e51546a..e6ff6032b 100644 --- a/test/runtime/samples/dynamic-component-nulled-out/_config.js +++ b/test/runtime/samples/dynamic-component-nulled-out/_config.js @@ -3,16 +3,14 @@ export default {

      Foo

      `, - nestedTransitions: true, + test({ assert, component, target }) { + const Bar = component.Bar; - test(assert, component, target) { - const state = component.get(); - - component.set({ Foo: null }); + component.Bar = null; assert.htmlEqual(target.innerHTML, ``); - component.set({ Foo: state.Foo }); + component.Bar = Bar; assert.htmlEqual(target.innerHTML, `

      Foo

      diff --git a/test/runtime/samples/dynamic-component-nulled-out/main.html b/test/runtime/samples/dynamic-component-nulled-out/main.html index 6a1a34855..b98ecb8f7 100644 --- a/test/runtime/samples/dynamic-component-nulled-out/main.html +++ b/test/runtime/samples/dynamic-component-nulled-out/main.html @@ -1,11 +1,7 @@ - - \ No newline at end of file + export let Bar = Foo; + + + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-ref/_config.js b/test/runtime/samples/dynamic-component-ref/_config.js index 5ab702935..6e3cabc43 100644 --- a/test/runtime/samples/dynamic-component-ref/_config.js +++ b/test/runtime/samples/dynamic-component-ref/_config.js @@ -1,7 +1,7 @@ export default { html: `Foo`, - test(assert, component) { - assert.ok(component.refs.test); + test({ assert, component }) { + assert.ok(component.test); } }; diff --git a/test/runtime/samples/dynamic-component-ref/main.html b/test/runtime/samples/dynamic-component-ref/main.html index 1d54b1729..cd7b34ed5 100644 --- a/test/runtime/samples/dynamic-component-ref/main.html +++ b/test/runtime/samples/dynamic-component-ref/main.html @@ -1,11 +1,7 @@ - - + + diff --git a/test/runtime/samples/dynamic-component-slot/_config.js b/test/runtime/samples/dynamic-component-slot/_config.js index 1b47436cb..58f413e3c 100644 --- a/test/runtime/samples/dynamic-component-slot/_config.js +++ b/test/runtime/samples/dynamic-component-slot/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: true }, @@ -16,10 +16,8 @@ export default {
      baz
      `, - test(assert, component, target) { - component.set({ - x: false - }); + test({ assert, component, target }) { + component.x = false; assert.htmlEqual(target.innerHTML, `

      Bar

      diff --git a/test/runtime/samples/dynamic-component-slot/main.html b/test/runtime/samples/dynamic-component-slot/main.html index e8b5c487a..32f1ecce1 100644 --- a/test/runtime/samples/dynamic-component-slot/main.html +++ b/test/runtime/samples/dynamic-component-slot/main.html @@ -1,3 +1,15 @@ + +

      element

      @@ -20,26 +32,4 @@
      what goes up must come down
      -
      - - \ No newline at end of file +
      \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component-update-existing-instance/_config.js b/test/runtime/samples/dynamic-component-update-existing-instance/_config.js index d614cf82c..5e3d83638 100644 --- a/test/runtime/samples/dynamic-component-update-existing-instance/_config.js +++ b/test/runtime/samples/dynamic-component-update-existing-instance/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 1 }, @@ -7,10 +7,8 @@ export default {

      Foo 1

      `, - test(assert, component, target) { - component.set({ - x: 2 - }); + test({ assert, component, target }) { + component.x = 2; assert.htmlEqual(target.innerHTML, `

      Foo 2

      diff --git a/test/runtime/samples/dynamic-component-update-existing-instance/main.html b/test/runtime/samples/dynamic-component-update-existing-instance/main.html index 1f8bd35f8..efa9394d3 100644 --- a/test/runtime/samples/dynamic-component-update-existing-instance/main.html +++ b/test/runtime/samples/dynamic-component-update-existing-instance/main.html @@ -1,12 +1,8 @@ - - \ No newline at end of file + export let x; + + + \ No newline at end of file diff --git a/test/runtime/samples/dynamic-component/_config.js b/test/runtime/samples/dynamic-component/_config.js index 915ce2571..fe7ce5d65 100644 --- a/test/runtime/samples/dynamic-component/_config.js +++ b/test/runtime/samples/dynamic-component/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: true }, @@ -7,10 +7,8 @@ export default {

      true, therefore Foo

      `, - test(assert, component, target) { - component.set({ - x: false - }); + test({ assert, component, target }) { + component.x = false; assert.htmlEqual(target.innerHTML, `

      false, therefore Bar

      diff --git a/test/runtime/samples/dynamic-component/main.html b/test/runtime/samples/dynamic-component/main.html index 1f8bd35f8..efa9394d3 100644 --- a/test/runtime/samples/dynamic-component/main.html +++ b/test/runtime/samples/dynamic-component/main.html @@ -1,12 +1,8 @@ - - \ No newline at end of file + export let x; + + + \ No newline at end of file diff --git a/test/runtime/samples/each-block-array-literal/_config.js b/test/runtime/samples/each-block-array-literal/_config.js index b7548f0d9..288d1cd09 100644 --- a/test/runtime/samples/each-block-array-literal/_config.js +++ b/test/runtime/samples/each-block-array-literal/_config.js @@ -4,7 +4,7 @@ export default { `, - test(assert, component, target) { + test({ assert, component, target }) { assert.htmlEqual(target.innerHTML,` @@ -14,6 +14,6 @@ export default { const event = new window.MouseEvent('click'); button.dispatchEvent(event); - assert.equal(component.get().clicked, 'racoon'); + assert.equal(component.clicked, 'racoon'); }, }; diff --git a/test/runtime/samples/each-block-array-literal/main.html b/test/runtime/samples/each-block-array-literal/main.html index f58a2fa99..ade8430bc 100644 --- a/test/runtime/samples/each-block-array-literal/main.html +++ b/test/runtime/samples/each-block-array-literal/main.html @@ -1,11 +1,7 @@ -{#each ['racoon', 'eagle'] as animal} - -{/each} - + +{#each ['racoon', 'eagle'] as animal} + +{/each} diff --git a/test/runtime/samples/each-block-containing-component-in-if/_config.js b/test/runtime/samples/each-block-containing-component-in-if/_config.js index bfee6beb2..908374289 100644 --- a/test/runtime/samples/each-block-containing-component-in-if/_config.js +++ b/test/runtime/samples/each-block-containing-component-in-if/_config.js @@ -1,32 +1,28 @@ export default { - data: { + props: { show: false, fields: [1, 2] }, html: `
      `, - test ( assert, component, target ) { - component.set({ - show: true, - fields: [1, 2, 3] - }); + test({ assert, component, target }) { + component.show = true; + component.fields = [1, 2, 3]; assert.htmlEqual( target.innerHTML, `
      - 1 + 1 2 3
      ` ); - component.set({ - fields: [1, 2, 3, 4] - }); + component.fields = [1, 2, 3, 4]; assert.htmlEqual( target.innerHTML, `
      - 1 + 1 2 3 4 diff --git a/test/runtime/samples/each-block-containing-component-in-if/main.html b/test/runtime/samples/each-block-containing-component-in-if/main.html index cf81af277..16f042a27 100644 --- a/test/runtime/samples/each-block-containing-component-in-if/main.html +++ b/test/runtime/samples/each-block-containing-component-in-if/main.html @@ -1,13 +1,10 @@ -
      - -
      - \ No newline at end of file + export let show; + export let fields; + + +
      + +
      \ No newline at end of file diff --git a/test/runtime/samples/each-block-containing-if/_config.js b/test/runtime/samples/each-block-containing-if/_config.js index cdb3d7e62..51284e060 100644 --- a/test/runtime/samples/each-block-containing-if/_config.js +++ b/test/runtime/samples/each-block-containing-if/_config.js @@ -1,12 +1,12 @@ export default { - test ( assert, component, target ) { - const items = component.get().items; - items.forEach( item => item.completed = false ); + test({ assert, component, target }) { + const items = component.items; + items.forEach(item => item.completed = false); - component.set({ currentFilter: 'all' }); + component.currentFilter = 'all'; - assert.htmlEqual( target.innerHTML, ` -
      • one
      • two
      • three
      ` - ); + assert.htmlEqual(target.innerHTML, ` +
      • one
      • two
      • three
      + `); } }; diff --git a/test/runtime/samples/each-block-containing-if/main.html b/test/runtime/samples/each-block-containing-if/main.html index 72fbdc576..83aaf35c4 100644 --- a/test/runtime/samples/each-block-containing-if/main.html +++ b/test/runtime/samples/each-block-containing-if/main.html @@ -1,3 +1,18 @@ + +
        {#each items as item} {#if filter(item, currentFilter)} @@ -5,24 +20,3 @@ {/if} {/each}
      - - diff --git a/test/runtime/samples/each-block-deconflict-name-context/_config.js b/test/runtime/samples/each-block-deconflict-name-context/_config.js index 86abd4ef3..c776a3092 100644 --- a/test/runtime/samples/each-block-deconflict-name-context/_config.js +++ b/test/runtime/samples/each-block-deconflict-name-context/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { foo: { bar: ['x', 'y', 'z'] } @@ -17,16 +17,14 @@ export default { `, - test(assert, component, target, window) { + test({ assert, component, target, window }) { const inputs = target.querySelectorAll('input'); inputs[1].value = 'w'; inputs[1].dispatchEvent(new window.MouseEvent('input')); - assert.deepEqual(component.get(), { - foo: { - bar: ['x', 'w', 'z'] - } + assert.deepEqual(component.foo, { + bar: ['x', 'w', 'z'] }); } }; diff --git a/test/runtime/samples/each-block-deconflict-name-context/main.html b/test/runtime/samples/each-block-deconflict-name-context/main.html index 2e634cfc0..391e42ecd 100644 --- a/test/runtime/samples/each-block-deconflict-name-context/main.html +++ b/test/runtime/samples/each-block-deconflict-name-context/main.html @@ -1,3 +1,3 @@ {#each foo.bar as bar} - + {/each} diff --git a/test/runtime/samples/each-block-destructured-array-sparse/_config.js b/test/runtime/samples/each-block-destructured-array-sparse/_config.js index f504cfe37..980527660 100644 --- a/test/runtime/samples/each-block-destructured-array-sparse/_config.js +++ b/test/runtime/samples/each-block-destructured-array-sparse/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { animalPawsEntries: [ ['raccoon', 'hands'], ['eagle', 'wings'] @@ -11,8 +11,8 @@ export default {

      wings

      `, - test ( assert, component, target ) { - component.set({ animalPawsEntries: [['foo', 'bar']] }); + test({ assert, component, target }) { + component.animalPawsEntries = [['foo', 'bar']]; assert.htmlEqual( target.innerHTML, `

      bar

      `); diff --git a/test/runtime/samples/each-block-destructured-array/_config.js b/test/runtime/samples/each-block-destructured-array/_config.js index 99933effc..432d8a3a7 100644 --- a/test/runtime/samples/each-block-destructured-array/_config.js +++ b/test/runtime/samples/each-block-destructured-array/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { animalPawsEntries: [ ['raccoon', 'hands'], ['eagle', 'wings'] @@ -11,8 +11,8 @@ export default {

      eagle: wings

      `, - test ( assert, component, target ) { - component.set({ animalPawsEntries: [['foo', 'bar']] }); + test({ assert, component, target }) { + component.animalPawsEntries = [['foo', 'bar']]; assert.htmlEqual( target.innerHTML, `

      foo: bar

      `); diff --git a/test/runtime/samples/each-block-destructured-object-binding/_config.js b/test/runtime/samples/each-block-destructured-object-binding/_config.js index 52b23c849..8b59a9703 100644 --- a/test/runtime/samples/each-block-destructured-object-binding/_config.js +++ b/test/runtime/samples/each-block-destructured-object-binding/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { people: [{ name: { first: 'Doctor', last: 'Who' } }], }, @@ -15,13 +15,13 @@ export default {

      Doctor Who

      `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const inputs = target.querySelectorAll('input'); inputs[1].value = 'Oz'; - inputs[1].dispatchEvent(new window.Event('input')); + await inputs[1].dispatchEvent(new window.Event('input')); - const { people } = component.get(); + const { people } = component; assert.deepEqual(people, [ { name: { first: 'Doctor', last: 'Oz' } } @@ -34,7 +34,7 @@ export default { `); people[0].name.first = 'Frank'; - component.set({ people }); + component.people = people; assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/each-block-destructured-object-binding/main.html b/test/runtime/samples/each-block-destructured-object-binding/main.html index 049387bc3..dcdd7c0f6 100644 --- a/test/runtime/samples/each-block-destructured-object-binding/main.html +++ b/test/runtime/samples/each-block-destructured-object-binding/main.html @@ -1,5 +1,5 @@ {#each people as { name: { first: f, last: l } } } - - + +

      {f} {l}

      {/each} diff --git a/test/runtime/samples/each-block-destructured-object/_config.js b/test/runtime/samples/each-block-destructured-object/_config.js index f5cb53444..dc3943fff 100644 --- a/test/runtime/samples/each-block-destructured-object/_config.js +++ b/test/runtime/samples/each-block-destructured-object/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { animalPawsEntries: [ { animal: 'raccoon', pawType: 'hands' }, { animal: 'eagle', pawType: 'wings' } @@ -11,10 +11,8 @@ export default {

      eagle: wings

      `, - test ( assert, component, target ) { - component.set({ - animalPawsEntries: [{ animal: 'cow', pawType: 'hooves' }] - }); + test({ assert, component, target }) { + component.animalPawsEntries = [{ animal: 'cow', pawType: 'hooves' }]; assert.htmlEqual( target.innerHTML, `

      cow: hooves

      `); diff --git a/test/runtime/samples/each-block-dynamic-else-static/_config.js b/test/runtime/samples/each-block-dynamic-else-static/_config.js index a10c4600b..d8f45b3cd 100644 --- a/test/runtime/samples/each-block-dynamic-else-static/_config.js +++ b/test/runtime/samples/each-block-dynamic-else-static/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { animals: [ 'alpaca', 'baboon', 'capybara' ] }, @@ -9,22 +9,22 @@ export default {

      capybara

      `, - test ( assert, component, target ) { - component.set({ animals: [] }); + test({ assert, component, target }) { + component.animals = []; assert.htmlEqual( target.innerHTML, `

      no animals

      ` ); // trigger an 'update' of the else block, to ensure that // non-existent update method is not called - component.set({ animals: [] }); + component.animals = []; - component.set({ animals: ['wombat'] }); + component.animals = ['wombat']; assert.htmlEqual( target.innerHTML, `

      wombat

      ` ); - component.set({ animals: ['dinosaur'] }); + component.animals = ['dinosaur']; assert.htmlEqual( target.innerHTML, `

      dinosaur

      ` ); diff --git a/test/runtime/samples/each-block-else-mount-or-intro/_config.js b/test/runtime/samples/each-block-else-mount-or-intro/_config.js index 0880b896c..8460a4b5e 100644 --- a/test/runtime/samples/each-block-else-mount-or-intro/_config.js +++ b/test/runtime/samples/each-block-else-mount-or-intro/_config.js @@ -1,5 +1,4 @@ export default { - nestedTransitions: true, - data: { items: [] }, + props: { items: [] }, html: `No items.`, }; diff --git a/test/runtime/samples/each-block-else-mount-or-intro/main.html b/test/runtime/samples/each-block-else-mount-or-intro/main.html index 4604ecd78..949eb9b09 100644 --- a/test/runtime/samples/each-block-else-mount-or-intro/main.html +++ b/test/runtime/samples/each-block-else-mount-or-intro/main.html @@ -1,9 +1,11 @@ + + {#each items as item} {:else} No items. {/each} - - diff --git a/test/runtime/samples/each-block-else-starts-empty/_config.js b/test/runtime/samples/each-block-else-starts-empty/_config.js index c12ca2c74..a20cedbbe 100644 --- a/test/runtime/samples/each-block-else-starts-empty/_config.js +++ b/test/runtime/samples/each-block-else-starts-empty/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { animals: [], foo: 'something else' }, @@ -10,12 +10,12 @@ export default { after `, - test ( assert, component, target ) { - component.set({ animals: ['wombat'] }); - assert.htmlEqual( target.innerHTML, ` + test({ assert, component, target }) { + component.animals = ['wombat']; + assert.htmlEqual(target.innerHTML, ` before

      wombat

      after - ` ); + `); } }; diff --git a/test/runtime/samples/each-block-else/_config.js b/test/runtime/samples/each-block-else/_config.js index 35ba9637b..a5bf722a8 100644 --- a/test/runtime/samples/each-block-else/_config.js +++ b/test/runtime/samples/each-block-else/_config.js @@ -1,6 +1,6 @@ export default { - data: { - animals: [ 'alpaca', 'baboon', 'capybara' ], + props: { + animals: ['alpaca', 'baboon', 'capybara'], foo: 'something else' }, @@ -12,26 +12,26 @@ export default { after `, - test ( assert, component, target ) { - component.set({ animals: [] }); - assert.htmlEqual( target.innerHTML, ` + test({ assert, component, target }) { + component.animals = []; + assert.htmlEqual(target.innerHTML, ` before

      no animals, but rather something else

      after - ` ); + `); - component.set({ foo: 'something other' }); - assert.htmlEqual( target.innerHTML, ` + component.foo = 'something other'; + assert.htmlEqual(target.innerHTML, ` before

      no animals, but rather something other

      after - ` ); + `); - component.set({ animals: ['wombat'] }); - assert.htmlEqual( target.innerHTML, ` + component.animals = ['wombat']; + assert.htmlEqual(target.innerHTML, ` before

      wombat

      after - ` ); + `); } }; diff --git a/test/runtime/samples/each-block-empty-outro/_config.js b/test/runtime/samples/each-block-empty-outro/_config.js index 443371892..92eb7c66b 100644 --- a/test/runtime/samples/each-block-empty-outro/_config.js +++ b/test/runtime/samples/each-block-empty-outro/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { visible: true, empty: [] }, @@ -10,10 +10,8 @@ export default {
      `, - nestedTransitions: true, - - test(assert, component, target) { - component.set({ visible: false }); + test({ assert, component, target }) { + component.visible = false; assert.htmlEqual(target.innerHTML, ``); } diff --git a/test/runtime/samples/each-block-empty-outro/main.html b/test/runtime/samples/each-block-empty-outro/main.html index b5d1b9526..325cbbcf4 100644 --- a/test/runtime/samples/each-block-empty-outro/main.html +++ b/test/runtime/samples/each-block-empty-outro/main.html @@ -1,3 +1,10 @@ + + {#if visible}
      {#each empty as thing} @@ -6,12 +13,4 @@

      text

      -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/each-block-in-if-block/_config.js b/test/runtime/samples/each-block-in-if-block/_config.js index 2af8c4bcd..eda3ca14a 100644 --- a/test/runtime/samples/each-block-in-if-block/_config.js +++ b/test/runtime/samples/each-block-in-if-block/_config.js @@ -1,13 +1,13 @@ export default { - data: { + props: { dummy: false, fruits: ['Apple', 'Banana', 'Tomato'], }, html: '
      Apple
      Banana
      Tomato
      ', - test ( assert, component, target ) { - component.set({ dummy: true }); + test({ assert, component, target }) { + component.dummy = true; assert.htmlEqual(target.innerHTML, '
      Apple
      Banana
      Tomato
      ' ); } }; diff --git a/test/runtime/samples/each-block-index-only/_config.js b/test/runtime/samples/each-block-index-only/_config.js index 8250f94cf..80bbd69bd 100644 --- a/test/runtime/samples/each-block-index-only/_config.js +++ b/test/runtime/samples/each-block-index-only/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { things: [0, 0, 0, 0, 0] }, @@ -11,10 +11,8 @@ export default {

      4

      `, - test(assert, component, target) { - component.set({ - things: [0, 0, 0] - }); + test({ assert, component, target }) { + component.things = [0, 0, 0]; assert.htmlEqual(target.innerHTML, `

      0

      diff --git a/test/runtime/samples/each-block-indexed/_config.js b/test/runtime/samples/each-block-indexed/_config.js index 5aaadafb0..f65c83ca9 100644 --- a/test/runtime/samples/each-block-indexed/_config.js +++ b/test/runtime/samples/each-block-indexed/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { animals: [ 'adder', 'blue whale', 'chameleon' ] }, html: `

      0: adder

      1: blue whale

      2: chameleon

      ` diff --git a/test/runtime/samples/each-block-keyed-dynamic/_config.js b/test/runtime/samples/each-block-keyed-dynamic/_config.js index 93832a765..9ebf60975 100644 --- a/test/runtime/samples/each-block-keyed-dynamic/_config.js +++ b/test/runtime/samples/each-block-keyed-dynamic/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { todos: [ { id: 123, description: 'buy milk' }, { id: 234, description: 'drink milk' } @@ -11,25 +11,21 @@ export default {

      drink milk

      `, - test ( assert, component, target ) { - const [ p1, p2 ] = target.querySelectorAll( 'p' ); + test({ assert, component, target }) { + const [ p1, p2 ] = target.querySelectorAll('p'); - component.set({ - todos: [ - { id: 123, description: 'buy beer' }, - { id: 234, description: 'drink beer' } - ] - }); - assert.htmlEqual( target.innerHTML, ` + component.todos = [ + { id: 123, description: 'buy beer' }, + { id: 234, description: 'drink beer' } + ]; + assert.htmlEqual(target.innerHTML, `

      buy beer

      drink beer

      - ` ); + `); - const [ p3, p4 ] = target.querySelectorAll( 'p' ); + const [ p3, p4 ] = target.querySelectorAll('p'); - assert.equal( p1, p3 ); - assert.equal( p2, p4 ); - - component.destroy(); + assert.equal(p1, p3); + assert.equal(p2, p4); } }; diff --git a/test/runtime/samples/each-block-keyed-empty/_config.js b/test/runtime/samples/each-block-keyed-empty/_config.js index 1edbb077f..cf8f4d321 100644 --- a/test/runtime/samples/each-block-keyed-empty/_config.js +++ b/test/runtime/samples/each-block-keyed-empty/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: [{ z: 1 }, { z: 2 }], }, diff --git a/test/runtime/samples/each-block-keyed-non-prop/_config.js b/test/runtime/samples/each-block-keyed-non-prop/_config.js index 514142221..90e9a7f9c 100644 --- a/test/runtime/samples/each-block-keyed-non-prop/_config.js +++ b/test/runtime/samples/each-block-keyed-non-prop/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { words: ['foo', 'bar', 'baz'] }, @@ -9,12 +9,10 @@ export default {

      baz

      `, - test(assert, component, target) { + test({ assert, component, target }) { const [p1, p2, p3] = target.querySelectorAll('p'); - component.set({ - words: ['foo', 'baz'], - }); + component.words = ['foo', 'baz']; assert.htmlEqual(target.innerHTML, `

      foo

      diff --git a/test/runtime/samples/each-block-keyed-random-permute/_config.js b/test/runtime/samples/each-block-keyed-random-permute/_config.js index a2c72bc8e..80bf2d911 100644 --- a/test/runtime/samples/each-block-keyed-random-permute/_config.js +++ b/test/runtime/samples/each-block-keyed-random-permute/_config.js @@ -18,17 +18,17 @@ function permute() { } export default { - data: { + props: { values: toObjects('abc'), }, html: `(a)(b)(c)`, - test(assert, component, target) { + test({ assert, component, target }) { function test(sequence) { const previous = target.textContent; const expected = sequence.split('').map(x => `(${x})`).join(''); - component.set({ values: toObjects(sequence) }); + component.values = toObjects(sequence); assert.htmlEqual( target.innerHTML, expected, diff --git a/test/runtime/samples/each-block-keyed-siblings/_config.js b/test/runtime/samples/each-block-keyed-siblings/_config.js index a2b6b3d25..d87f8943d 100644 --- a/test/runtime/samples/each-block-keyed-siblings/_config.js +++ b/test/runtime/samples/each-block-keyed-siblings/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { ones: [{ text: '1' }], twos: [{ text: '2' }], }, @@ -9,10 +9,8 @@ export default {
      2
      `, - test(assert, component, target) { - component.set({ - ones: [{ text: '11' }] - }); + test({ assert, component, target }) { + component.ones = [{ text: '11' }]; assert.htmlEqual(target.innerHTML, `
      11
      diff --git a/test/runtime/samples/each-block-keyed-static/_config.js b/test/runtime/samples/each-block-keyed-static/_config.js index 7166854cd..629ea47eb 100644 --- a/test/runtime/samples/each-block-keyed-static/_config.js +++ b/test/runtime/samples/each-block-keyed-static/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: [{ z: 1 }, { z: 2 }], }, diff --git a/test/runtime/samples/each-block-keyed-unshift/_config.js b/test/runtime/samples/each-block-keyed-unshift/_config.js index 23e659c62..1056c90c5 100644 --- a/test/runtime/samples/each-block-keyed-unshift/_config.js +++ b/test/runtime/samples/each-block-keyed-unshift/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { titles: [{ name: 'b' }, { name: 'c' }] }, @@ -8,17 +8,13 @@ export default {

      c

      `, - test (assert, component, target) { - component.set({ - titles: [{ name: 'a' }, { name: 'b' }, { name: 'c' }] - }); + test({ assert, component, target }) { + component.titles = [{ name: 'a' }, { name: 'b' }, { name: 'c' }]; assert.htmlEqual(target.innerHTML, `

      a

      b

      c

      `); - - component.destroy(); } }; diff --git a/test/runtime/samples/each-block-keyed-unshift/main.html b/test/runtime/samples/each-block-keyed-unshift/main.html index 885e12aeb..5af62d4e0 100644 --- a/test/runtime/samples/each-block-keyed-unshift/main.html +++ b/test/runtime/samples/each-block-keyed-unshift/main.html @@ -1,13 +1,9 @@ -{#each titles as title (title.name)} - -{/each} - \ No newline at end of file + export let titles; + + +{#each titles as title (title.name)} + +{/each} \ No newline at end of file diff --git a/test/runtime/samples/each-block-keyed/_config.js b/test/runtime/samples/each-block-keyed/_config.js index 29cf422fb..c756aa453 100644 --- a/test/runtime/samples/each-block-keyed/_config.js +++ b/test/runtime/samples/each-block-keyed/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { todos: [ { id: 123, description: 'implement keyed each blocks' }, { id: 234, description: 'implement client-side hydration' } @@ -11,21 +11,17 @@ export default {

      2: implement client-side hydration

      `, - test ( assert, component, target ) { - const [ p1, p2 ] = target.querySelectorAll( 'p' ); + test({ assert, component, target }) { + const [ p1, p2 ] = target.querySelectorAll('p'); - component.set({ - todos: [ - { id: 234, description: 'implement client-side hydration' } - ] - }); - assert.htmlEqual( target.innerHTML, '

      1: implement client-side hydration

      ' ); - - const [ p3 ] = target.querySelectorAll( 'p' ); + component.todos = [ + { id: 234, description: 'implement client-side hydration' } + ]; + assert.htmlEqual(target.innerHTML, '

      1: implement client-side hydration

      '); - assert.ok( !target.contains( p1 ), 'first

      element should be removed' ); - assert.equal( p2, p3, 'second

      element should be retained' ); + const [ p3 ] = target.querySelectorAll('p'); - component.destroy(); + assert.ok(!target.contains(p1), 'first

      element should be removed'); + assert.equal(p2, p3, 'second

      element should be retained'); } }; diff --git a/test/runtime/samples/each-block-random-permute/_config.js b/test/runtime/samples/each-block-random-permute/_config.js index 14c667091..f81dac2ef 100644 --- a/test/runtime/samples/each-block-random-permute/_config.js +++ b/test/runtime/samples/each-block-random-permute/_config.js @@ -17,16 +17,16 @@ function permute () { let step = permute(); export default { - data: { + props: { values: step.data }, html: step.expected, - test ( assert, component, target ) { + test({ assert, component, target }) { for (let i = 0; i < 100; i++) { step = permute(); - component.set({ values: step.data }); + component.values = step.data; assert.htmlEqual( target.innerHTML, step.expected ); } } diff --git a/test/runtime/samples/each-block-static/_config.js b/test/runtime/samples/each-block-static/_config.js index 258eabadf..b62d262d9 100644 --- a/test/runtime/samples/each-block-static/_config.js +++ b/test/runtime/samples/each-block-static/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { items: [] }, html: ``, - test (assert, component, target) { - component.set({ items: ['x'] }); + test({ assert, component, target }) { + component.items = ['x']; assert.htmlEqual(target.innerHTML, `foo`); } }; diff --git a/test/runtime/samples/each-block-text-node/_config.js b/test/runtime/samples/each-block-text-node/_config.js index b8c9543da..4209bb3bf 100644 --- a/test/runtime/samples/each-block-text-node/_config.js +++ b/test/runtime/samples/each-block-text-node/_config.js @@ -1,14 +1,14 @@ export default { - data: { + props: { animals: [ 'alpaca', 'baboon', 'capybara' ] }, html: '(alpaca)(baboon)(capybara)', - test ( assert, component, target ) { - component.set({ animals: [ 'caribou', 'dogfish' ] }); + test({ assert, component, target }) { + component.animals = [ 'caribou', 'dogfish' ]; assert.htmlEqual( target.innerHTML, '(caribou)(dogfish)' ); - component.set({ animals: [] }); + component.animals = []; assert.htmlEqual( target.innerHTML, '' ); } }; diff --git a/test/runtime/samples/each-block/_config.js b/test/runtime/samples/each-block/_config.js index 73e3d0c6f..6018ab67a 100644 --- a/test/runtime/samples/each-block/_config.js +++ b/test/runtime/samples/each-block/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { animals: [ 'alpaca', 'baboon', 'capybara' ] }, @@ -9,8 +9,8 @@ export default {

      capybara

      `, - test ( assert, component, target ) { - component.set({ animals: [ 'alpaca', 'baboon', 'caribou', 'dogfish' ] }); + test({ assert, component, target }) { + component.animals = [ 'alpaca', 'baboon', 'caribou', 'dogfish' ]; assert.htmlEqual( target.innerHTML, `

      alpaca

      baboon

      @@ -18,7 +18,7 @@ export default {

      dogfish

      ` ); - component.set({ animals: [] }); + component.animals = []; assert.htmlEqual( target.innerHTML, '' ); } }; diff --git a/test/runtime/samples/each-blocks-nested-b/_config.js b/test/runtime/samples/each-blocks-nested-b/_config.js index 1ba0f685b..c44899e6f 100644 --- a/test/runtime/samples/each-blocks-nested-b/_config.js +++ b/test/runtime/samples/each-blocks-nested-b/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { categories: [ { name: 'animals', @@ -29,7 +29,7 @@ export default { ] }, html: `

      animals: aardvark

      animals: buffalo

      animals: chinchilla

      countries: albania

      countries: brazil

      countries: china

      people: alice

      people: bob

      people: carol

      people: dave

      `, - test ( assert, component, target ) { + test({ assert, component, target }) { // TODO } }; diff --git a/test/runtime/samples/each-blocks-nested/_config.js b/test/runtime/samples/each-blocks-nested/_config.js index 5486c8274..790ec9ced 100644 --- a/test/runtime/samples/each-blocks-nested/_config.js +++ b/test/runtime/samples/each-blocks-nested/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { columns: [ 'a', 'b', 'c' ], rows: [ 1, 2, 3 ] }, html: `
      a, 1
      a, 2
      a, 3
      b, 1
      b, 2
      b, 3
      c, 1
      c, 2
      c, 3
      `, - test ( assert, component, target ) { + test({ assert, component, target }) { // TODO } }; diff --git a/test/runtime/samples/element-source-location/_config.js b/test/runtime/samples/element-source-location/_config.js index 0b4d16a90..7733688f2 100644 --- a/test/runtime/samples/element-source-location/_config.js +++ b/test/runtime/samples/element-source-location/_config.js @@ -1,19 +1,19 @@ -import path from 'path'; +import * as path from 'path'; export default { compileOptions: { dev: true }, - test(assert, component, target) { + test({ assert, component, target }) { const h1 = target.querySelector('h1'); const p = target.querySelector('p'); assert.deepEqual(h1.__svelte_meta.loc, { file: path.relative(process.cwd(), path.resolve(__dirname, 'main.html')), - line: 0, + line: 4, column: 0, - char: 0 + char: 51 }); assert.deepEqual(p.__svelte_meta.loc, { diff --git a/test/runtime/samples/element-source-location/main.html b/test/runtime/samples/element-source-location/main.html index 2231e1943..ca7089572 100644 --- a/test/runtime/samples/element-source-location/main.html +++ b/test/runtime/samples/element-source-location/main.html @@ -1,10 +1,6 @@ -

      this is a header

      - - \ No newline at end of file + import Foo from './Foo.html'; + + +

      this is a header

      + \ No newline at end of file diff --git a/test/runtime/samples/escape-template-literals/main.html b/test/runtime/samples/escape-template-literals/main.html index 69dca26c6..bfd016de6 100644 --- a/test/runtime/samples/escape-template-literals/main.html +++ b/test/runtime/samples/escape-template-literals/main.html @@ -1,8 +1,7 @@ -`${foo}\n` -
      foo
      - - + +`${foo}\n` +
      foo
      + diff --git a/test/runtime/samples/event-handler-console-log/_config.js b/test/runtime/samples/event-handler-console-log/_config.js index 26d8f9ae2..35e447c45 100644 --- a/test/runtime/samples/event-handler-console-log/_config.js +++ b/test/runtime/samples/event-handler-console-log/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { foo: 42 }, @@ -7,7 +7,7 @@ export default { `, - test (assert, component, target, window) { + test({ assert, component, target, window }) { const button = target.querySelector('button'); const event = new window.MouseEvent('click'); diff --git a/test/runtime/samples/event-handler-console-log/main.html b/test/runtime/samples/event-handler-console-log/main.html index 3500b9637..a7ef51c4c 100644 --- a/test/runtime/samples/event-handler-console-log/main.html +++ b/test/runtime/samples/event-handler-console-log/main.html @@ -1 +1,5 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/test/runtime/samples/event-handler-custom-context/_config.js b/test/runtime/samples/event-handler-custom-context/_config.js deleted file mode 100644 index 5d725bfd7..000000000 --- a/test/runtime/samples/event-handler-custom-context/_config.js +++ /dev/null @@ -1,16 +0,0 @@ -export default { - html: '', - - test ( assert, component, target, window ) { - const event = new window.MouseEvent( 'click', { - clientX: 42, - clientY: 42 - }); - - const button = target.querySelector( 'button' ); - - button.dispatchEvent( event ); - - assert.equal( target.innerHTML, '' ); - } -}; diff --git a/test/runtime/samples/event-handler-custom-context/main.html b/test/runtime/samples/event-handler-custom-context/main.html deleted file mode 100644 index dd16947f2..000000000 --- a/test/runtime/samples/event-handler-custom-context/main.html +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/test/runtime/samples/event-handler-custom-each-destructured/_config.js b/test/runtime/samples/event-handler-custom-each-destructured/_config.js deleted file mode 100644 index 101268637..000000000 --- a/test/runtime/samples/event-handler-custom-each-destructured/_config.js +++ /dev/null @@ -1,32 +0,0 @@ -export default { - html: ` - - - - -

      first:

      -

      second:

      - `, - - test ( assert, component, target, window ) { - const event = new window.MouseEvent( 'click' ); - - const buttons = target.querySelectorAll( 'button' ); - - buttons[1].dispatchEvent( event ); - - assert.htmlEqual( target.innerHTML, ` - - - - -

      first: 1

      -

      second: bar

      - ` ); - - assert.equal( component.get().first, '1' ); - assert.equal( component.get().second, 'bar' ); - - component.destroy(); - } -}; diff --git a/test/runtime/samples/event-handler-custom-each-destructured/main.html b/test/runtime/samples/event-handler-custom-each-destructured/main.html deleted file mode 100644 index 3b75c187f..000000000 --- a/test/runtime/samples/event-handler-custom-each-destructured/main.html +++ /dev/null @@ -1,36 +0,0 @@ -{#each items as [item0, item1]} - -{/each} - -

      first: {first}

      -

      second: {second}

      - - diff --git a/test/runtime/samples/event-handler-custom-each/_config.js b/test/runtime/samples/event-handler-custom-each/_config.js deleted file mode 100644 index e32876605..000000000 --- a/test/runtime/samples/event-handler-custom-each/_config.js +++ /dev/null @@ -1,32 +0,0 @@ -export default { - html: ` - - - - -

      fromDom:

      -

      fromState:

      - `, - - test ( assert, component, target, window ) { - const event = new window.MouseEvent( 'click' ); - - const buttons = target.querySelectorAll( 'button' ); - - buttons[1].dispatchEvent( event ); - - assert.htmlEqual( target.innerHTML, ` - - - - -

      fromDom: bar

      -

      fromState: bar

      - ` ); - - assert.equal( component.get().fromDom, 'bar' ); - assert.equal( component.get().fromState, 'bar' ); - - component.destroy(); - } -}; diff --git a/test/runtime/samples/event-handler-custom-each/main.html b/test/runtime/samples/event-handler-custom-each/main.html deleted file mode 100644 index be92ec4d5..000000000 --- a/test/runtime/samples/event-handler-custom-each/main.html +++ /dev/null @@ -1,34 +0,0 @@ -{#each items as item} - -{/each} - -

      fromDom: {fromDom}

      -

      fromState: {fromState}

      - - diff --git a/test/runtime/samples/event-handler-custom-node-context/_config.js b/test/runtime/samples/event-handler-custom-node-context/_config.js deleted file mode 100644 index e2099f96b..000000000 --- a/test/runtime/samples/event-handler-custom-node-context/_config.js +++ /dev/null @@ -1,15 +0,0 @@ -export default { - 'skip-ssr': true, - - html: '', - - test ( assert, component, target, window ) { - const event = new window.MouseEvent( 'click' ); - - const button = target.querySelector( 'button' ); - - button.dispatchEvent( event ); - - assert.equal( target.innerHTML, '' ); - } -}; diff --git a/test/runtime/samples/event-handler-custom-node-context/main.html b/test/runtime/samples/event-handler-custom-node-context/main.html deleted file mode 100644 index 971cda8a8..000000000 --- a/test/runtime/samples/event-handler-custom-node-context/main.html +++ /dev/null @@ -1,25 +0,0 @@ - - - diff --git a/test/runtime/samples/event-handler-custom-this/main.html b/test/runtime/samples/event-handler-custom-this/main.html deleted file mode 100644 index 68140628e..000000000 --- a/test/runtime/samples/event-handler-custom-this/main.html +++ /dev/null @@ -1,23 +0,0 @@ - - - \ No newline at end of file diff --git a/test/runtime/samples/event-handler-custom/_config.js b/test/runtime/samples/event-handler-custom/_config.js deleted file mode 100644 index ab4a20e84..000000000 --- a/test/runtime/samples/event-handler-custom/_config.js +++ /dev/null @@ -1,15 +0,0 @@ -export default { - html: '', - test ( assert, component, target, window ) { - const event = new window.MouseEvent( 'click', { - clientX: 42, - clientY: 42 - }); - - const button = target.querySelector( 'button' ); - - button.dispatchEvent( event ); - - assert.equal( target.innerHTML, '' ); - } -}; diff --git a/test/runtime/samples/event-handler-custom/main.html b/test/runtime/samples/event-handler-custom/main.html deleted file mode 100644 index 53232e9b7..000000000 --- a/test/runtime/samples/event-handler-custom/main.html +++ /dev/null @@ -1,29 +0,0 @@ - - - diff --git a/test/runtime/samples/event-handler-destroy/_config.js b/test/runtime/samples/event-handler-destroy/_config.js deleted file mode 100644 index 417f0da04..000000000 --- a/test/runtime/samples/event-handler-destroy/_config.js +++ /dev/null @@ -1,20 +0,0 @@ -export default { - html: ` - - `, - - test ( assert, component, target, window ) { - const button = target.querySelector( 'button' ); - const event = new window.MouseEvent( 'click' ); - - let destroyed = false; - component.on( 'destroy', () => { - destroyed = true; - }); - - button.dispatchEvent( event ); - assert.htmlEqual( target.innerHTML, `` ); - - assert.ok( destroyed ); - } -}; diff --git a/test/runtime/samples/event-handler-destroy/main.html b/test/runtime/samples/event-handler-destroy/main.html deleted file mode 100644 index 01b2bb822..000000000 --- a/test/runtime/samples/event-handler-destroy/main.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/event-handler-each-context/_config.js b/test/runtime/samples/event-handler-each-context/_config.js index 73358545d..d816b342b 100644 --- a/test/runtime/samples/event-handler-each-context/_config.js +++ b/test/runtime/samples/event-handler-each-context/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { items: [ 'whatever' ], @@ -7,15 +7,15 @@ export default { bar: 'right' }, - test(assert, component, target, window) { + test({ assert, component, target, window }) { const button = target.querySelector('button'); const event = new window.MouseEvent('click'); button.dispatchEvent(event); - assert.equal(component.get().foo, 'right'); + assert.equal(component.foo, 'right'); - component.set({ bar: 'left' }); + component.bar = 'left'; button.dispatchEvent(event); - assert.equal(component.get().foo, 'left'); + assert.equal(component.foo, 'left'); } }; diff --git a/test/runtime/samples/event-handler-each-context/main.html b/test/runtime/samples/event-handler-each-context/main.html index 830bbce47..3b22ec529 100644 --- a/test/runtime/samples/event-handler-each-context/main.html +++ b/test/runtime/samples/event-handler-each-context/main.html @@ -1,5 +1,5 @@ {#each items as item} - + {/each}

      foo: {foo}

      \ No newline at end of file diff --git a/test/runtime/samples/event-handler-each-deconflicted/_config.js b/test/runtime/samples/event-handler-each-deconflicted/_config.js index 13690a4e6..6237f3945 100644 --- a/test/runtime/samples/event-handler-each-deconflicted/_config.js +++ b/test/runtime/samples/event-handler-each-deconflicted/_config.js @@ -1,7 +1,7 @@ export default { - data: { - foo: [ 1 ], - bar: [ 2 ], + props: { + foo: [1], + bar: [2], clicked: 'neither' }, @@ -11,26 +11,24 @@ export default {

      clicked: neither

      `, - test ( assert, component, target, window ) { - const buttons = target.querySelectorAll( 'button' ); - const event = new window.MouseEvent( 'click' ); + async test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const event = new window.MouseEvent('click'); - buttons[0].dispatchEvent( event ); - assert.equal( component.get().clicked, 'foo' ); - assert.htmlEqual( target.innerHTML, ` + await buttons[0].dispatchEvent(event); + assert.equal(component.clicked, 'foo'); + assert.htmlEqual(target.innerHTML, `

      clicked: foo

      - ` ); + `); - buttons[1].dispatchEvent( event ); - assert.equal( component.get().clicked, 'bar' ); - assert.htmlEqual( target.innerHTML, ` + await buttons[1].dispatchEvent(event); + assert.equal(component.clicked, 'bar'); + assert.htmlEqual(target.innerHTML, `

      clicked: bar

      - ` ); - - component.destroy(); + `); } }; diff --git a/test/runtime/samples/event-handler-each-deconflicted/main.html b/test/runtime/samples/event-handler-each-deconflicted/main.html index e704a7eac..165e535e9 100644 --- a/test/runtime/samples/event-handler-each-deconflicted/main.html +++ b/test/runtime/samples/event-handler-each-deconflicted/main.html @@ -1,9 +1,9 @@ {#each foo as f} - + {/each} {#each bar as b} - + {/each}

      clicked: {clicked}

      \ No newline at end of file diff --git a/test/runtime/samples/event-handler-each-this/_config.js b/test/runtime/samples/event-handler-each-this/_config.js index e6d1056e7..3ab2d5acd 100644 --- a/test/runtime/samples/event-handler-each-this/_config.js +++ b/test/runtime/samples/event-handler-each-this/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { items: ['foo', 'bar', 'baz'], }, @@ -9,14 +9,14 @@ export default { `, - test(assert, component, target, window) { + test({ assert, component, target, window }) { const buttons = target.querySelectorAll('button'); const event = new window.MouseEvent('click'); const clicked = []; - component.on('clicked', event => { - clicked.push(event.node); + component.$on('clicked', event => { + clicked.push(event.detail.node); }); buttons[1].dispatchEvent(event); diff --git a/test/runtime/samples/event-handler-each-this/main.html b/test/runtime/samples/event-handler-each-this/main.html index 9e5ea88a5..52fa53a80 100644 --- a/test/runtime/samples/event-handler-each-this/main.html +++ b/test/runtime/samples/event-handler-each-this/main.html @@ -1,3 +1,11 @@ + + {#each items as item} - + {/each} \ No newline at end of file diff --git a/test/runtime/samples/event-handler-each/_config.js b/test/runtime/samples/event-handler-each/_config.js index 02d8f8146..281f6d0d7 100644 --- a/test/runtime/samples/event-handler-each/_config.js +++ b/test/runtime/samples/event-handler-each/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { items: [ 'foo', 'bar', @@ -15,18 +15,16 @@ export default {

      selected: foo

      `, - test ( assert, component, target, window ) { - const buttons = target.querySelectorAll( 'button' ); - const event = new window.MouseEvent( 'click' ); + async test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const event = new window.MouseEvent('click'); - buttons[1].dispatchEvent( event ); - assert.htmlEqual( target.innerHTML, ` + await buttons[1].dispatchEvent(event); + assert.htmlEqual(target.innerHTML, `

      selected: bar

      - ` ); - - component.destroy(); + `); } }; diff --git a/test/runtime/samples/event-handler-each/main.html b/test/runtime/samples/event-handler-each/main.html index bd43d3bec..3d1c5dcfd 100644 --- a/test/runtime/samples/event-handler-each/main.html +++ b/test/runtime/samples/event-handler-each/main.html @@ -1,5 +1,5 @@ {#each items as item} - + {/each}

      selected: {selected}

      \ No newline at end of file diff --git a/test/runtime/samples/event-handler-event-methods/_config.js b/test/runtime/samples/event-handler-event-methods/_config.js index 50c0c08bd..cc72e4bb0 100644 --- a/test/runtime/samples/event-handler-event-methods/_config.js +++ b/test/runtime/samples/event-handler-event-methods/_config.js @@ -1,12 +1,12 @@ export default { - test ( assert, component, target, window ) { - const allow = target.querySelector( '.allow-propagation' ); - const stop = target.querySelector( '.stop-propagation' ); + test({ assert, component, target, window }) { + const allow = target.querySelector('.allow-propagation'); + const stop = target.querySelector('.stop-propagation'); - allow.dispatchEvent( new window.MouseEvent( 'click', { bubbles: true }) ); - stop.dispatchEvent( new window.MouseEvent( 'click', { bubbles: true }) ); + allow.dispatchEvent(new window.MouseEvent('click', { bubbles: true })); + stop.dispatchEvent(new window.MouseEvent('click', { bubbles: true })); - assert.equal( component.get().foo, true ); - assert.equal( component.get().bar, false ); + assert.equal(component.foo, true); + assert.equal(component.bar, false); } }; diff --git a/test/runtime/samples/event-handler-event-methods/main.html b/test/runtime/samples/event-handler-event-methods/main.html index 0aa130e44..ad57976b8 100644 --- a/test/runtime/samples/event-handler-event-methods/main.html +++ b/test/runtime/samples/event-handler-event-methods/main.html @@ -1,18 +1,12 @@ -
      + + +
      -
      - +
      +
      - - diff --git a/test/runtime/samples/event-handler-hoisted/_config.js b/test/runtime/samples/event-handler-hoisted/_config.js index 3a949e5fa..18d84aec6 100644 --- a/test/runtime/samples/event-handler-hoisted/_config.js +++ b/test/runtime/samples/event-handler-hoisted/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { foo: [1], a: 42 }, @@ -8,7 +8,7 @@ export default { `, - test (assert, component, target, window) { + test({ assert, component, target, window }) { const button = target.querySelector('button'); const event = new window.MouseEvent('click'); diff --git a/test/runtime/samples/event-handler-hoisted/main.html b/test/runtime/samples/event-handler-hoisted/main.html index 5e9f8cd71..fa0012d19 100644 --- a/test/runtime/samples/event-handler-hoisted/main.html +++ b/test/runtime/samples/event-handler-hoisted/main.html @@ -1,13 +1,14 @@ -{#each foo as bar} - -{/each} - \ No newline at end of file + export let snapshot; + + export let foo; + export let a; + + export function baz(a) { + snapshot = a; + } + + +{#each foo as bar} + +{/each} \ No newline at end of file diff --git a/test/runtime/samples/event-handler-modifier-once/_config.js b/test/runtime/samples/event-handler-modifier-once/_config.js new file mode 100644 index 000000000..41daf374c --- /dev/null +++ b/test/runtime/samples/event-handler-modifier-once/_config.js @@ -0,0 +1,16 @@ +export default { + html: ` + + `, + + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const event = new window.MouseEvent('click'); + + await button.dispatchEvent(event); + assert.equal(component.count, 1); + + await button.dispatchEvent(event); + assert.equal(component.count, 1); + } +}; diff --git a/test/runtime/samples/event-handler-modifier-once/main.html b/test/runtime/samples/event-handler-modifier-once/main.html new file mode 100644 index 000000000..f31f8f498 --- /dev/null +++ b/test/runtime/samples/event-handler-modifier-once/main.html @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/event-handler-modifier-prevent-default/_config.js b/test/runtime/samples/event-handler-modifier-prevent-default/_config.js new file mode 100644 index 000000000..4fa032bf3 --- /dev/null +++ b/test/runtime/samples/event-handler-modifier-prevent-default/_config.js @@ -0,0 +1,16 @@ +export default { + html: ` + + `, + + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const event = new window.MouseEvent('click', { + cancelable: true + }); + + await button.dispatchEvent(event); + + assert.ok(component.default_was_prevented); + } +}; diff --git a/test/runtime/samples/event-handler-modifier-prevent-default/main.html b/test/runtime/samples/event-handler-modifier-prevent-default/main.html new file mode 100644 index 000000000..90aea62f0 --- /dev/null +++ b/test/runtime/samples/event-handler-modifier-prevent-default/main.html @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/event-handler-modifier-stop-propagation/_config.js b/test/runtime/samples/event-handler-modifier-stop-propagation/_config.js new file mode 100644 index 000000000..8517429e5 --- /dev/null +++ b/test/runtime/samples/event-handler-modifier-stop-propagation/_config.js @@ -0,0 +1,19 @@ +export default { + html: ` +
      + +
      + `, + + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const event = new window.MouseEvent('click', { + bubbles: true + }); + + await button.dispatchEvent(event); + + assert.ok(component.inner_clicked); + assert.ok(!component.outer_clicked); + } +}; diff --git a/test/runtime/samples/event-handler-modifier-stop-propagation/main.html b/test/runtime/samples/event-handler-modifier-stop-propagation/main.html new file mode 100644 index 000000000..a1e368031 --- /dev/null +++ b/test/runtime/samples/event-handler-modifier-stop-propagation/main.html @@ -0,0 +1,16 @@ + + +
      + +
      \ No newline at end of file diff --git a/test/runtime/samples/event-handler-removal/_config.js b/test/runtime/samples/event-handler-removal/_config.js index 474b6ef63..657ee04b0 100644 --- a/test/runtime/samples/event-handler-removal/_config.js +++ b/test/runtime/samples/event-handler-removal/_config.js @@ -1,19 +1,20 @@ // TODO gah, JSDOM appears to behave differently to real browsers here... probably need to raise an issue export default { - html: '', - test ( assert, component ) { - component.refs.input.focus(); + html: '', + + test({ assert, component }) { + component.input.focus(); // this should NOT trigger blur event - component.set({ visible: false }); - assert.ok( !component.get().blurred ); + component.visible = false; + assert.ok(!component.blurred); - component.set({ visible: true }); - component.refs.input.focus(); + component.visible = true; + component.input.focus(); // this SHOULD trigger blur event - component.refs.input.blur(); - assert.ok( component.get().blurred ); + component.input.blur(); + assert.ok(component.blurred); } }; diff --git a/test/runtime/samples/event-handler-removal/main.html b/test/runtime/samples/event-handler-removal/main.html index 862af691a..4589640ec 100644 --- a/test/runtime/samples/event-handler-removal/main.html +++ b/test/runtime/samples/event-handler-removal/main.html @@ -1,11 +1,9 @@ -{#if visible} - -{/if} - + +{#if visible} + +{/if} diff --git a/test/runtime/samples/event-handler-sanitize/_config.js b/test/runtime/samples/event-handler-sanitize/_config.js index 2037f292f..9f16b1409 100644 --- a/test/runtime/samples/event-handler-sanitize/_config.js +++ b/test/runtime/samples/event-handler-sanitize/_config.js @@ -3,19 +3,19 @@ export default {
      toggle
      `, - test ( assert, component, target, window ) { - const div = target.querySelector( 'div' ); - const event = new window.MouseEvent( 'some-event' ); + async test({ assert, component, target, window }) { + const div = target.querySelector('div'); + const event = new window.MouseEvent('some-event'); - div.dispatchEvent( event ); - assert.htmlEqual( target.innerHTML, ` + await div.dispatchEvent(event); + assert.htmlEqual(target.innerHTML, `
      toggle

      hello!

      - ` ); + `); - div.dispatchEvent( event ); - assert.htmlEqual( target.innerHTML, ` + await div.dispatchEvent(event); + assert.htmlEqual(target.innerHTML, `
      toggle
      - ` ); + `); } }; diff --git a/test/runtime/samples/event-handler-sanitize/main.html b/test/runtime/samples/event-handler-sanitize/main.html index 05c80365f..7a5f39aa5 100644 --- a/test/runtime/samples/event-handler-sanitize/main.html +++ b/test/runtime/samples/event-handler-sanitize/main.html @@ -1,4 +1,4 @@ -
      toggle
      +
      toggle
      {#if visible}

      hello!

      diff --git a/test/runtime/samples/event-handler-shorthand-component/Widget.html b/test/runtime/samples/event-handler-shorthand-component/Widget.html index 47e1f95a2..cde03db92 100644 --- a/test/runtime/samples/event-handler-shorthand-component/Widget.html +++ b/test/runtime/samples/event-handler-shorthand-component/Widget.html @@ -1 +1,7 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/test/runtime/samples/event-handler-shorthand-component/_config.js b/test/runtime/samples/event-handler-shorthand-component/_config.js index e0e21f140..22704cf1c 100644 --- a/test/runtime/samples/event-handler-shorthand-component/_config.js +++ b/test/runtime/samples/event-handler-shorthand-component/_config.js @@ -3,13 +3,13 @@ export default { `, - test (assert, component, target, window) { + test({ assert, component, target, window }) { const button = target.querySelector('button'); const event = new window.MouseEvent('click'); let answer; - component.on('foo', event => { - answer = event.answer; + component.$on('foo', event => { + answer = event.detail.answer; }); button.dispatchEvent(event); diff --git a/test/runtime/samples/event-handler-shorthand-component/main.html b/test/runtime/samples/event-handler-shorthand-component/main.html index 5eb9bbb3e..26586d3fd 100644 --- a/test/runtime/samples/event-handler-shorthand-component/main.html +++ b/test/runtime/samples/event-handler-shorthand-component/main.html @@ -1,11 +1,5 @@ - - - export default { - components: { - Widget - } - }; - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/event-handler-shorthand-dynamic-component/Widget.html b/test/runtime/samples/event-handler-shorthand-dynamic-component/Widget.html index 47e1f95a2..cde03db92 100644 --- a/test/runtime/samples/event-handler-shorthand-dynamic-component/Widget.html +++ b/test/runtime/samples/event-handler-shorthand-dynamic-component/Widget.html @@ -1 +1,7 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/test/runtime/samples/event-handler-shorthand-dynamic-component/_config.js b/test/runtime/samples/event-handler-shorthand-dynamic-component/_config.js index e0e21f140..22704cf1c 100644 --- a/test/runtime/samples/event-handler-shorthand-dynamic-component/_config.js +++ b/test/runtime/samples/event-handler-shorthand-dynamic-component/_config.js @@ -3,13 +3,13 @@ export default { `, - test (assert, component, target, window) { + test({ assert, component, target, window }) { const button = target.querySelector('button'); const event = new window.MouseEvent('click'); let answer; - component.on('foo', event => { - answer = event.answer; + component.$on('foo', event => { + answer = event.detail.answer; }); button.dispatchEvent(event); diff --git a/test/runtime/samples/event-handler-shorthand-dynamic-component/main.html b/test/runtime/samples/event-handler-shorthand-dynamic-component/main.html index 388a08760..f38a4d30b 100644 --- a/test/runtime/samples/event-handler-shorthand-dynamic-component/main.html +++ b/test/runtime/samples/event-handler-shorthand-dynamic-component/main.html @@ -1,9 +1,5 @@ - - + + diff --git a/test/runtime/samples/event-handler-shorthand/_config.js b/test/runtime/samples/event-handler-shorthand/_config.js deleted file mode 100644 index ceded0bf0..000000000 --- a/test/runtime/samples/event-handler-shorthand/_config.js +++ /dev/null @@ -1,13 +0,0 @@ -export default { - html: ` - - `, - - test (assert, component, target, window) { - const button = target.querySelector('button'); - const event = new window.MouseEvent('click'); - - button.dispatchEvent(event); - assert.ok(component.clicked); - } -}; diff --git a/test/runtime/samples/event-handler-shorthand/main.html b/test/runtime/samples/event-handler-shorthand/main.html deleted file mode 100644 index 5b283cbb5..000000000 --- a/test/runtime/samples/event-handler-shorthand/main.html +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/test/runtime/samples/event-handler-this-methods/_config.js b/test/runtime/samples/event-handler-this-methods/_config.js index 170ce46b0..8be56cf1a 100644 --- a/test/runtime/samples/event-handler-this-methods/_config.js +++ b/test/runtime/samples/event-handler-this-methods/_config.js @@ -1,16 +1,16 @@ export default { - test ( assert, component, target, window ) { + test({ assert, component, target, window }) { // Click events don't focus elements in JSDOM – obviously they would // in real browsers. More realistically, you'd use this for e.g. // this.select(), but that's harder to test than this.focus() - const wont = target.querySelector( '.wont-focus' ); - const will = target.querySelector( '.will-focus' ); + const wont = target.querySelector('.wont-focus'); + const will = target.querySelector('.will-focus'); - wont.dispatchEvent( new window.MouseEvent( 'click' ) ); - assert.equal( window.document.activeElement, window.document.body ); + wont.dispatchEvent(new window.MouseEvent('click')); + assert.equal(window.document.activeElement, window.document.body); - will.dispatchEvent( new window.MouseEvent( 'click' ) ); - assert.equal( window.document.activeElement, will ); + will.dispatchEvent(new window.MouseEvent('click')); + assert.equal(window.document.activeElement, will); } }; diff --git a/test/runtime/samples/event-handler-this-methods/main.html b/test/runtime/samples/event-handler-this-methods/main.html index a9f8282c9..29615b46e 100644 --- a/test/runtime/samples/event-handler-this-methods/main.html +++ b/test/runtime/samples/event-handler-this-methods/main.html @@ -1,2 +1,2 @@ - + diff --git a/test/runtime/samples/event-handler/_config.js b/test/runtime/samples/event-handler/_config.js index 868fb362a..3a5ac7a18 100644 --- a/test/runtime/samples/event-handler/_config.js +++ b/test/runtime/samples/event-handler/_config.js @@ -3,19 +3,19 @@ export default { `, - test ( assert, component, target, window ) { - const button = target.querySelector( 'button' ); - const event = new window.MouseEvent( 'click' ); + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const event = new window.MouseEvent('click'); - button.dispatchEvent( event ); - assert.htmlEqual( target.innerHTML, ` + await button.dispatchEvent(event); + assert.htmlEqual(target.innerHTML, `

      hello!

      - ` ); + `); - button.dispatchEvent( event ); - assert.htmlEqual( target.innerHTML, ` + await button.dispatchEvent(event); + assert.htmlEqual(target.innerHTML, ` - ` ); + `); } }; diff --git a/test/runtime/samples/event-handler/main.html b/test/runtime/samples/event-handler/main.html index 731fe32e7..8dcaf1b70 100644 --- a/test/runtime/samples/event-handler/main.html +++ b/test/runtime/samples/event-handler/main.html @@ -1,4 +1,4 @@ - + {#if visible}

      hello!

      diff --git a/test/runtime/samples/events-custom/_config.js b/test/runtime/samples/events-custom/_config.js deleted file mode 100644 index 9fe6bbb6c..000000000 --- a/test/runtime/samples/events-custom/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -export default { - test ( assert, component ) { - let count = 0; - - const expected = { x: 1 }; - - component.on( 'foo', data => { - assert.equal( data, expected ); - count += 1; - }); - - component.fire( 'foo', expected ); - assert.equal( count, 1 ); - - component.destroy(); - } -}; diff --git a/test/runtime/samples/events-custom/main.html b/test/runtime/samples/events-custom/main.html deleted file mode 100644 index 7c89b545c..000000000 --- a/test/runtime/samples/events-custom/main.html +++ /dev/null @@ -1 +0,0 @@ -
      diff --git a/test/runtime/samples/events-lifecycle/_config.js b/test/runtime/samples/events-lifecycle/_config.js deleted file mode 100644 index ddd622384..000000000 --- a/test/runtime/samples/events-lifecycle/_config.js +++ /dev/null @@ -1,13 +0,0 @@ -export default { - test ( assert, component ) { - let count = 0; - - component.on( 'destroy', function () { - assert.equal( this, component ); - count += 1; - }); - - component.destroy(); - assert.equal( count, 1 ); - } -}; diff --git a/test/runtime/samples/events-lifecycle/main.html b/test/runtime/samples/events-lifecycle/main.html deleted file mode 100644 index 7c89b545c..000000000 --- a/test/runtime/samples/events-lifecycle/main.html +++ /dev/null @@ -1 +0,0 @@ -
      diff --git a/test/runtime/samples/flush-before-bindings/Nested.html b/test/runtime/samples/flush-before-bindings/Nested.html index a722863cd..a632b585a 100644 --- a/test/runtime/samples/flush-before-bindings/Nested.html +++ b/test/runtime/samples/flush-before-bindings/Nested.html @@ -1,30 +1,18 @@ -{#each things as thing} - -

      {thing} ({visibilityMap[thing]})

      -
      -{/each} - - components: { - Visibility - } - }; - \ No newline at end of file +{#each things as thing} + +

      {thing} ({visibilityMap[thing]})

      +
      +{/each} \ No newline at end of file diff --git a/test/runtime/samples/flush-before-bindings/Visibility.html b/test/runtime/samples/flush-before-bindings/Visibility.html index 9ecda223f..fa2a88f93 100644 --- a/test/runtime/samples/flush-before-bindings/Visibility.html +++ b/test/runtime/samples/flush-before-bindings/Visibility.html @@ -1,11 +1,13 @@ + +
      - - diff --git a/test/runtime/samples/flush-before-bindings/_config.js b/test/runtime/samples/flush-before-bindings/_config.js index 5f1e3d21f..7bb6ebfc1 100644 --- a/test/runtime/samples/flush-before-bindings/_config.js +++ b/test/runtime/samples/flush-before-bindings/_config.js @@ -3,15 +3,15 @@ export default { skip: true, // TODO - 'skip-ssr': true, + skip_if_ssr: true, html: `

      first thing (true)

      second thing (true)

      `, - test(assert, component) { - const visibleThings = component.get().visibleThings; + test({ assert, component }) { + const visibleThings = component.visibleThings; assert.deepEqual(visibleThings, ['first thing', 'second thing']); const snapshots = component.snapshots; diff --git a/test/runtime/samples/flush-before-bindings/main.html b/test/runtime/samples/flush-before-bindings/main.html index e95670f85..74081c951 100644 --- a/test/runtime/samples/flush-before-bindings/main.html +++ b/test/runtime/samples/flush-before-bindings/main.html @@ -1,28 +1,18 @@ - - - if (changed.visibleThings) { - this.snapshots.push(current.visibleThings); - } - } - }; - \ No newline at end of file + \ No newline at end of file diff --git a/test/runtime/samples/function-in-expression/_config.js b/test/runtime/samples/function-in-expression/_config.js index 9b79770eb..f8ddbe26a 100644 --- a/test/runtime/samples/function-in-expression/_config.js +++ b/test/runtime/samples/function-in-expression/_config.js @@ -1,17 +1,13 @@ export default { - data: { - numbers: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] + props: { + numbers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, html: '1, 3, 5, 7, 9', - test ( assert, component, target ) { - component.set({ - numbers: [ 10, 11, 12, 13, 14, 15, 16 ] - }); + test({ assert, component, target }) { + component.numbers = [10, 11, 12, 13, 14, 15, 16]; - assert.htmlEqual( target.innerHTML, `11, 13, 15` ); - - component.destroy(); + assert.htmlEqual(target.innerHTML, `11, 13, 15`); } }; \ No newline at end of file diff --git a/test/runtime/samples/function-in-expression/main.html b/test/runtime/samples/function-in-expression/main.html index 1f038d771..895a36e69 100644 --- a/test/runtime/samples/function-in-expression/main.html +++ b/test/runtime/samples/function-in-expression/main.html @@ -1 +1 @@ -{ numbers.filter( x => x % 2 ).join( ', ' ) } \ No newline at end of file +{numbers.filter(x => x % 2).join(', ')} \ No newline at end of file diff --git a/test/runtime/samples/get-after-destroy/_config.js b/test/runtime/samples/get-after-destroy/_config.js index c3627bc60..bf4d8e90b 100644 --- a/test/runtime/samples/get-after-destroy/_config.js +++ b/test/runtime/samples/get-after-destroy/_config.js @@ -1,13 +1,13 @@ export default { - data: { + props: { foo: 1 }, html: `
      1
      `, - test(assert, component) { - component.destroy(); - const { foo } = component.get(); + test({ assert, component }) { + component.$destroy(); + const { foo } = component; assert.equal(foo, undefined); } } \ No newline at end of file diff --git a/test/runtime/samples/get-state/_config.js b/test/runtime/samples/get-state/_config.js deleted file mode 100644 index 3c2dae5a8..000000000 --- a/test/runtime/samples/get-state/_config.js +++ /dev/null @@ -1,7 +0,0 @@ -export default { - test ( assert, component ) { - assert.equal( component.get().a, 1 ); - assert.equal( component.get().c, 3 ); - assert.deepEqual( component.get(), { a: 1, b: 2, c: 3 }); - } -}; diff --git a/test/runtime/samples/get-state/main.html b/test/runtime/samples/get-state/main.html deleted file mode 100644 index e67adaf72..000000000 --- a/test/runtime/samples/get-state/main.html +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/test/runtime/samples/globals-accessible-directly/_config.js b/test/runtime/samples/globals-accessible-directly/_config.js index ee7e79fd1..ad010356c 100644 --- a/test/runtime/samples/globals-accessible-directly/_config.js +++ b/test/runtime/samples/globals-accessible-directly/_config.js @@ -1,7 +1,7 @@ export default { html: '', - test ( assert, component, target ) { - assert.htmlEqual( target.innerHTML, 'NaN' ); + test({ assert, component, target }) { + assert.htmlEqual(target.innerHTML, 'NaN'); } }; diff --git a/test/runtime/samples/globals-not-dereferenced/_config.js b/test/runtime/samples/globals-not-dereferenced/_config.js index 9a0d6175b..f10f44253 100644 --- a/test/runtime/samples/globals-not-dereferenced/_config.js +++ b/test/runtime/samples/globals-not-dereferenced/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { x: 10 }, html: '5', - test ( assert, component, target ) { - component.set({ x: 3 }); + test({ assert, component, target }) { + component.x = 3; assert.htmlEqual( target.innerHTML, '3' ); } }; diff --git a/test/runtime/samples/globals-not-overwritten-by-bindings/_config.js b/test/runtime/samples/globals-not-overwritten-by-bindings/_config.js index 4965976df..d5f3def7f 100644 --- a/test/runtime/samples/globals-not-overwritten-by-bindings/_config.js +++ b/test/runtime/samples/globals-not-overwritten-by-bindings/_config.js @@ -33,7 +33,7 @@ export default {
      `, - data: { + props: { todos: { first: { description: 'Buy some milk', @@ -50,14 +50,14 @@ export default { }, }, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const input = document.querySelectorAll('input[type="checkbox"]')[2]; const change = new window.Event('change'); input.checked = true; - input.dispatchEvent(change); + await input.dispatchEvent(change); - assert.ok(component.get().todos.third.done); + assert.ok(component.todos.third.done); assert.htmlEqual(target.innerHTML, `
      diff --git a/test/runtime/samples/globals-not-overwritten-by-bindings/main.html b/test/runtime/samples/globals-not-overwritten-by-bindings/main.html index a8b873211..9c573a631 100644 --- a/test/runtime/samples/globals-not-overwritten-by-bindings/main.html +++ b/test/runtime/samples/globals-not-overwritten-by-bindings/main.html @@ -1,6 +1,6 @@ {#each Object.keys(todos) as key}
      - - + +
      {/each} \ No newline at end of file diff --git a/test/runtime/samples/globals-shadowed-by-data/_config.js b/test/runtime/samples/globals-shadowed-by-data/_config.js index ed1fbcef3..1f268bdd8 100644 --- a/test/runtime/samples/globals-shadowed-by-data/_config.js +++ b/test/runtime/samples/globals-shadowed-by-data/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { x: 10 }, html: 'potato', - test ( assert, component, target ) { - component.set({ x: 3 }); + test({ assert, component, target }) { + component.x = 3; assert.htmlEqual( target.innerHTML, 'potato' ); } }; diff --git a/test/runtime/samples/globals-shadowed-by-data/main.html b/test/runtime/samples/globals-shadowed-by-data/main.html index 7e3b40833..4b439b55a 100644 --- a/test/runtime/samples/globals-shadowed-by-data/main.html +++ b/test/runtime/samples/globals-shadowed-by-data/main.html @@ -1,15 +1,10 @@ -{Math.min(x, 5)} - + +{Math.min(x, 5)} diff --git a/test/runtime/samples/globals-shadowed-by-helpers/_config.js b/test/runtime/samples/globals-shadowed-by-helpers/_config.js index ed1fbcef3..1f268bdd8 100644 --- a/test/runtime/samples/globals-shadowed-by-helpers/_config.js +++ b/test/runtime/samples/globals-shadowed-by-helpers/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { x: 10 }, html: 'potato', - test ( assert, component, target ) { - component.set({ x: 3 }); + test({ assert, component, target }) { + component.x = 3; assert.htmlEqual( target.innerHTML, 'potato' ); } }; diff --git a/test/runtime/samples/globals-shadowed-by-helpers/main.html b/test/runtime/samples/globals-shadowed-by-helpers/main.html index 98b8f1918..8c360f911 100644 --- a/test/runtime/samples/globals-shadowed-by-helpers/main.html +++ b/test/runtime/samples/globals-shadowed-by-helpers/main.html @@ -1,13 +1,11 @@ -{Math.min(x, 5)} - + +{Math.min(x, 5)} diff --git a/test/runtime/samples/head-if-block/_config.js b/test/runtime/samples/head-if-block/_config.js index 4c81e5e39..26e1457be 100644 --- a/test/runtime/samples/head-if-block/_config.js +++ b/test/runtime/samples/head-if-block/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { condition: false }, - test(assert, component, target, window) { + test({ assert, component, target, window }) { assert.equal(window.document.title, ''); - component.set({ condition: true }); + component.condition = true; assert.equal(window.document.title, 'woo!!!'); } }; \ No newline at end of file diff --git a/test/runtime/samples/head-title-dynamic-simple/_config.js b/test/runtime/samples/head-title-dynamic-simple/_config.js new file mode 100644 index 000000000..682a841fc --- /dev/null +++ b/test/runtime/samples/head-title-dynamic-simple/_config.js @@ -0,0 +1,12 @@ +export default { + props: { + foo: 'A Title' + }, + + test({ assert, component, target, window }) { + assert.equal(window.document.title, 'A Title'); + + component.foo = 'Also A Title'; + assert.equal(window.document.title, 'Also A Title'); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/head-title-dynamic-simple/main.html b/test/runtime/samples/head-title-dynamic-simple/main.html new file mode 100644 index 000000000..d2ff2c596 --- /dev/null +++ b/test/runtime/samples/head-title-dynamic-simple/main.html @@ -0,0 +1,3 @@ + + {foo} + \ No newline at end of file diff --git a/test/runtime/samples/head-title-dynamic/_config.js b/test/runtime/samples/head-title-dynamic/_config.js index 5155554a0..ddb04bf0a 100644 --- a/test/runtime/samples/head-title-dynamic/_config.js +++ b/test/runtime/samples/head-title-dynamic/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { adjective: 'custom' }, - test(assert, component, target, window) { + test({ assert, component, target, window }) { assert.equal(window.document.title, 'a custom title'); - component.set({ adjective: 'different' }); + component.adjective = 'different'; assert.equal(window.document.title, 'a different title'); } }; \ No newline at end of file diff --git a/test/runtime/samples/head-title-static/_config.js b/test/runtime/samples/head-title-static/_config.js index 3757effa5..e6d5d9aaf 100644 --- a/test/runtime/samples/head-title-static/_config.js +++ b/test/runtime/samples/head-title-static/_config.js @@ -1,5 +1,5 @@ export default { - test(assert, component, target, window) { + test({ assert, component, target, window }) { assert.equal(window.document.title, 'changed'); } }; \ No newline at end of file diff --git a/test/runtime/samples/hello-world/_config.js b/test/runtime/samples/hello-world/_config.js index 49d6f0377..d65d69001 100644 --- a/test/runtime/samples/hello-world/_config.js +++ b/test/runtime/samples/hello-world/_config.js @@ -1,15 +1,15 @@ export default { - data: { + props: { name: 'world' }, html: '

      Hello world!

      ', - test ( assert, component, target ) { - component.set({ name: 'everybody' }); - assert.htmlEqual( target.innerHTML, '

      Hello everybody!

      ' ); + test({ assert, component, target }) { + component.name = 'everybody'; + assert.htmlEqual(target.innerHTML, '

      Hello everybody!

      '); - component.destroy(); - assert.htmlEqual( target.innerHTML, '' ); + component.$destroy(); + assert.htmlEqual(target.innerHTML, ''); } }; diff --git a/test/runtime/samples/helpers-not-call-expression/main.html b/test/runtime/samples/helpers-not-call-expression/main.html index c63838b13..6f69090a5 100644 --- a/test/runtime/samples/helpers-not-call-expression/main.html +++ b/test/runtime/samples/helpers-not-call-expression/main.html @@ -1,15 +1,7 @@ -

      {numbers.map(square)}

      - + +

      {numbers.map(square)}

      diff --git a/test/runtime/samples/helpers/main.html b/test/runtime/samples/helpers/main.html index 497a1d119..c62e3a8fb 100644 --- a/test/runtime/samples/helpers/main.html +++ b/test/runtime/samples/helpers/main.html @@ -1,14 +1,10 @@ -

      {reverse('backwards')}

      - + +

      {reverse('backwards')}

      diff --git a/test/runtime/samples/if-block-component-without-outro/_config.js b/test/runtime/samples/if-block-component-without-outro/_config.js index c07164843..8106081c7 100644 --- a/test/runtime/samples/if-block-component-without-outro/_config.js +++ b/test/runtime/samples/if-block-component-without-outro/_config.js @@ -1,15 +1,12 @@ export default { - skipIntroByDefault: true, - nestedTransitions: true, - - data: { + props: { foo: true, }, html: '
      A wild component appears
      ', - test(assert, component, target) { - component.set({ foo: false }); + test({ assert, component, target }) { + component.foo = false; assert.htmlEqual(target.innerHTML, ''); }, }; diff --git a/test/runtime/samples/if-block-component-without-outro/main.html b/test/runtime/samples/if-block-component-without-outro/main.html index f043b3644..45498b97a 100644 --- a/test/runtime/samples/if-block-component-without-outro/main.html +++ b/test/runtime/samples/if-block-component-without-outro/main.html @@ -1,11 +1,9 @@ + + {#if foo} -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/if-block-else-in-each/_config.js b/test/runtime/samples/if-block-else-in-each/_config.js index 99337dfc4..44268f32b 100644 --- a/test/runtime/samples/if-block-else-in-each/_config.js +++ b/test/runtime/samples/if-block-else-in-each/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { array: [true, false], }, html: ` diff --git a/test/runtime/samples/if-block-else-partial-outro/_config.js b/test/runtime/samples/if-block-else-partial-outro/_config.js index 228e9a45e..a358680ed 100644 --- a/test/runtime/samples/if-block-else-partial-outro/_config.js +++ b/test/runtime/samples/if-block-else-partial-outro/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 1, y: false, }, @@ -8,10 +8,8 @@ export default { 1 `, - nestedTransitions: true, - - test(assert, component, target) { - component.set({ x: 2 }); + test({ assert, component, target }) { + component.x = 2; assert.htmlEqual(target.innerHTML, ` 2 `); diff --git a/test/runtime/samples/if-block-else-partial-outro/main.html b/test/runtime/samples/if-block-else-partial-outro/main.html index 9cb4408b7..90c253c73 100644 --- a/test/runtime/samples/if-block-else-partial-outro/main.html +++ b/test/runtime/samples/if-block-else-partial-outro/main.html @@ -1,20 +1,12 @@ + + {#if y} {:else} {x} -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/if-block-else/_config.js b/test/runtime/samples/if-block-else/_config.js index a6a365624..5a60973e0 100644 --- a/test/runtime/samples/if-block-else/_config.js +++ b/test/runtime/samples/if-block-else/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { foo: true, bar: false }, @@ -9,20 +9,20 @@ export default {

      not bar

      `, - test ( assert, component, target ) { - component.set({ foo: false }); + test({ assert, component, target }) { + component.foo = false; assert.htmlEqual( target.innerHTML, `

      not foo

      not bar

      ` ); - component.set({ bar: true }); + component.bar = true; assert.htmlEqual( target.innerHTML, `

      not foo

      bar

      ` ); - component.set({ foo: true }); + component.foo = true; assert.htmlEqual( target.innerHTML, `

      foo

      bar

      diff --git a/test/runtime/samples/if-block-elseif-no-else/_config.js b/test/runtime/samples/if-block-elseif-no-else/_config.js index a9b3b9c6e..ec3379737 100644 --- a/test/runtime/samples/if-block-elseif-no-else/_config.js +++ b/test/runtime/samples/if-block-elseif-no-else/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 11 }, @@ -7,15 +7,13 @@ export default {

      x is greater than 10

      `, - test(assert, component, target) { - component.set({ x: 4 }); + test({ assert, component, target }) { + component.x = 4; assert.htmlEqual(target.innerHTML, `

      x is less than 5

      `); - component.set({ x: 6 }); + component.x = 6; assert.htmlEqual(target.innerHTML, ``); - - component.destroy(); } }; diff --git a/test/runtime/samples/if-block-elseif-text/_config.js b/test/runtime/samples/if-block-elseif-text/_config.js index 89c8b011a..d5031ffcf 100644 --- a/test/runtime/samples/if-block-elseif-text/_config.js +++ b/test/runtime/samples/if-block-elseif-text/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 11 }, @@ -7,17 +7,15 @@ export default { before-if-after `, - test ( assert, component, target ) { - component.set({ x: 4 }); - assert.htmlEqual( target.innerHTML, ` + test({ assert, component, target }) { + component.x = 4; + assert.htmlEqual(target.innerHTML, ` before-elseif-after - ` ); + `); - component.set({ x: 6 }); - assert.htmlEqual( target.innerHTML, ` + component.x = 6; + assert.htmlEqual(target.innerHTML, ` before-else-after - ` ); - - component.destroy(); + `); } }; diff --git a/test/runtime/samples/if-block-elseif/_config.js b/test/runtime/samples/if-block-elseif/_config.js index ec24f3dd9..d09e88a2e 100644 --- a/test/runtime/samples/if-block-elseif/_config.js +++ b/test/runtime/samples/if-block-elseif/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 11 }, @@ -7,17 +7,15 @@ export default {

      x is greater than 10

      `, - test ( assert, component, target ) { - component.set({ x: 4 }); - assert.htmlEqual( target.innerHTML, ` + test({ assert, component, target }) { + component.x = 4; + assert.htmlEqual(target.innerHTML, `

      x is less than 5

      - ` ); + `); - component.set({ x: 6 }); - assert.htmlEqual( target.innerHTML, ` + component.x = 6; + assert.htmlEqual(target.innerHTML, `

      x is between 5 and 10

      - ` ); - - component.destroy(); + `); } }; diff --git a/test/runtime/samples/if-block-first/_config.js b/test/runtime/samples/if-block-first/_config.js index e7020cbf8..01cf37dfb 100644 --- a/test/runtime/samples/if-block-first/_config.js +++ b/test/runtime/samples/if-block-first/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { visible: false }, html: '
      before me
      ', - test ( assert, component, target ) { - component.set({ visible: true }); + test({ assert, component, target }) { + component.visible = true; assert.htmlEqual(target.innerHTML, '
      i am visible
      before me
      ' ); } }; diff --git a/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js b/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js index 60adf28e3..b2e71ea01 100644 --- a/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js +++ b/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js @@ -1,6 +1,4 @@ export default { - nestedTransitions: true, - html: `
      A wild component appears

      x

      @@ -13,8 +11,8 @@ export default { `, - test(assert, component, target) { - component.set({ x: 'y' }); + test({ assert, component, target }) { + component.x = 'y'; assert.htmlEqual(target.innerHTML, `
      A wild component appears

      y

      diff --git a/test/runtime/samples/if-block-no-outro-else-with-outro/main.html b/test/runtime/samples/if-block-no-outro-else-with-outro/main.html index 5789f2386..2007bf2ea 100644 --- a/test/runtime/samples/if-block-no-outro-else-with-outro/main.html +++ b/test/runtime/samples/if-block-no-outro-else-with-outro/main.html @@ -1,21 +1,14 @@ + + {#if foo}

      foo

      {:else}

      {x}

      - -{/if} - - \ No newline at end of file + +{/if} \ No newline at end of file diff --git a/test/runtime/samples/if-block-or/_config.js b/test/runtime/samples/if-block-or/_config.js index ffecd6ca8..bd1b7df4f 100644 --- a/test/runtime/samples/if-block-or/_config.js +++ b/test/runtime/samples/if-block-or/_config.js @@ -1,15 +1,15 @@ export default { - data: { + props: { a: true, b: false }, html: '

      i am visible

      ', - test ( assert, component, target ) { - component.set({ a: false }); + test({ assert, component, target }) { + component.a = false; assert.htmlEqual( target.innerHTML, '' ); - component.set({ b: true }); + component.b = true; assert.htmlEqual( target.innerHTML, '

      i am visible

      ' ); } }; diff --git a/test/runtime/samples/if-block-outro-nested-else/_config.js b/test/runtime/samples/if-block-outro-nested-else/_config.js index 4fe5eaa92..226116fe1 100644 --- a/test/runtime/samples/if-block-outro-nested-else/_config.js +++ b/test/runtime/samples/if-block-outro-nested-else/_config.js @@ -1,8 +1,6 @@ export default { - nestedTransitions: true, - - test ( assert, component, target ) { + test({ assert, component, target }) { // Would cause "TypeError: Cannot read property 'o' of undefined" - component.set({ foo: false }); + component.foo = false; } }; diff --git a/test/runtime/samples/if-block-outro-nested-else/main.html b/test/runtime/samples/if-block-outro-nested-else/main.html index 02e000b3c..c10f861a6 100644 --- a/test/runtime/samples/if-block-outro-nested-else/main.html +++ b/test/runtime/samples/if-block-outro-nested-else/main.html @@ -1,3 +1,9 @@ + + {#if foo} {#if false} @@ -5,12 +11,3 @@ {/if} {/if} - - diff --git a/test/runtime/samples/if-block-outro-unique-select-block-type/_config.js b/test/runtime/samples/if-block-outro-unique-select-block-type/_config.js index f3cbb42e2..b94da1a57 100644 --- a/test/runtime/samples/if-block-outro-unique-select-block-type/_config.js +++ b/test/runtime/samples/if-block-outro-unique-select-block-type/_config.js @@ -1,5 +1,4 @@ export default { - nestedTransitions: true, html: `
      diff --git a/test/runtime/samples/if-block-outro-unique-select-block-type/main.html b/test/runtime/samples/if-block-outro-unique-select-block-type/main.html index a27aba9d7..77b3a6dfe 100644 --- a/test/runtime/samples/if-block-outro-unique-select-block-type/main.html +++ b/test/runtime/samples/if-block-outro-unique-select-block-type/main.html @@ -1,3 +1,9 @@ + + {#if foo} {:else} @@ -9,12 +15,3 @@ {:else}
      {/if} - - diff --git a/test/runtime/samples/if-block-widget/_config.js b/test/runtime/samples/if-block-widget/_config.js index b82b4dfeb..44dc32a91 100644 --- a/test/runtime/samples/if-block-widget/_config.js +++ b/test/runtime/samples/if-block-widget/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { visible: true }, @@ -9,15 +9,15 @@ export default { after `, - test ( assert, component, target ) { - component.set({ visible: false }); + test({ assert, component, target }) { + component.visible = false; assert.htmlEqual( target.innerHTML, ` before after ` ); - component.set({ visible: true }); + component.visible = true; assert.htmlEqual( target.innerHTML, ` before

      Widget

      diff --git a/test/runtime/samples/if-block-widget/main.html b/test/runtime/samples/if-block-widget/main.html index cd73d020a..12996bbcd 100644 --- a/test/runtime/samples/if-block-widget/main.html +++ b/test/runtime/samples/if-block-widget/main.html @@ -1,14 +1,11 @@ + + before {#if visible} {/if} after - diff --git a/test/runtime/samples/if-block/_config.js b/test/runtime/samples/if-block/_config.js index 8f9f85ab6..a94d9aa35 100644 --- a/test/runtime/samples/if-block/_config.js +++ b/test/runtime/samples/if-block/_config.js @@ -1,14 +1,14 @@ export default { - data: { + props: { visible: true }, html: '

      i am visible

      ', - test ( assert, component, target ) { - component.set({ visible: false }); + test({ assert, component, target }) { + component.visible = false; assert.htmlEqual( target.innerHTML, '' ); - component.set({ visible: true }); + component.visible = true; assert.htmlEqual( target.innerHTML, '

      i am visible

      ' ); } }; diff --git a/test/runtime/samples/if-in-keyed-each/_config.js b/test/runtime/samples/if-in-keyed-each/_config.js index d7f8c5870..b4a24202d 100644 --- a/test/runtime/samples/if-in-keyed-each/_config.js +++ b/test/runtime/samples/if-in-keyed-each/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { items: [ { id: 1, name: 'one' }, { id: 2, name: 'two' } diff --git a/test/runtime/samples/ignore-unchanged-attribute-compound/_config.js b/test/runtime/samples/ignore-unchanged-attribute-compound/_config.js index 5780a83e6..741d5bc78 100644 --- a/test/runtime/samples/ignore-unchanged-attribute-compound/_config.js +++ b/test/runtime/samples/ignore-unchanged-attribute-compound/_config.js @@ -1,7 +1,7 @@ import counter from './counter.js'; export default { - data: { + props: { x: 1, y: 2 }, @@ -11,16 +11,18 @@ export default {

      `, - test(assert, component) { + test({ assert, component }) { counter.count = 0; - component.set({ x: 3 }); + component.x = 3; assert.equal(counter.count, 0); - component.set({ x: 4, y: 5 }); + component.x = 4; + component.y = 5; assert.equal(counter.count, 1); - component.set({ x: 5, y: 5 }); + component.x = 5; + component.y = 5; assert.equal(counter.count, 1); } }; diff --git a/test/runtime/samples/ignore-unchanged-attribute-compound/main.html b/test/runtime/samples/ignore-unchanged-attribute-compound/main.html index a99f94147..08dcebbbd 100644 --- a/test/runtime/samples/ignore-unchanged-attribute-compound/main.html +++ b/test/runtime/samples/ignore-unchanged-attribute-compound/main.html @@ -1,15 +1,14 @@ -

      {x}

      -

      - + +

      {x}

      +

      diff --git a/test/runtime/samples/ignore-unchanged-attribute/_config.js b/test/runtime/samples/ignore-unchanged-attribute/_config.js index eb62f5dd8..c1f8b23b9 100644 --- a/test/runtime/samples/ignore-unchanged-attribute/_config.js +++ b/test/runtime/samples/ignore-unchanged-attribute/_config.js @@ -1,7 +1,7 @@ import counter from './counter.js'; export default { - data: { + props: { x: 1, y: 2 }, @@ -11,16 +11,18 @@ export default {

      `, - test(assert, component) { + test({ assert, component }) { counter.count = 0; - component.set({ x: 3 }); + component.x = 3; assert.equal(counter.count, 0); - component.set({ x: 4, y: 5 }); + component.x = 4; + component.y = 5; assert.equal(counter.count, 1); - component.set({ x: 5, y: 5 }); + component.x = 5; + component.y = 5; assert.equal(counter.count, 1); } }; diff --git a/test/runtime/samples/ignore-unchanged-attribute/main.html b/test/runtime/samples/ignore-unchanged-attribute/main.html index 463e21735..5f657cb6b 100644 --- a/test/runtime/samples/ignore-unchanged-attribute/main.html +++ b/test/runtime/samples/ignore-unchanged-attribute/main.html @@ -1,15 +1,14 @@ -

      {x}

      -

      - + +

      {x}

      +

      diff --git a/test/runtime/samples/ignore-unchanged-raw/_config.js b/test/runtime/samples/ignore-unchanged-raw/_config.js index b8c58367b..15e9430c3 100644 --- a/test/runtime/samples/ignore-unchanged-raw/_config.js +++ b/test/runtime/samples/ignore-unchanged-raw/_config.js @@ -1,7 +1,7 @@ import counter from './counter.js'; export default { - data: { + props: { x: 1, y: 2 }, @@ -11,16 +11,18 @@ export default {

      2

      `, - test(assert, component) { + test({ assert, component }) { counter.count = 0; - component.set({ x: 3 }); + component.x = 3; assert.equal(counter.count, 0); - component.set({ x: 4, y: 5 }); + component.x = 4; + component.y = 5; assert.equal(counter.count, 1); - component.set({ x: 5, y: 5 }); + component.x = 5; + component.y = 5; assert.equal(counter.count, 1); } }; diff --git a/test/runtime/samples/ignore-unchanged-raw/main.html b/test/runtime/samples/ignore-unchanged-raw/main.html index c28e7b537..ed2e3b2b5 100644 --- a/test/runtime/samples/ignore-unchanged-raw/main.html +++ b/test/runtime/samples/ignore-unchanged-raw/main.html @@ -1,15 +1,14 @@ -

      {x}

      -

      {@html myHelper(y)}

      - + +

      {x}

      +

      {@html myHelper(y)}

      diff --git a/test/runtime/samples/ignore-unchanged-tag/_config.js b/test/runtime/samples/ignore-unchanged-tag/_config.js index b8c58367b..15e9430c3 100644 --- a/test/runtime/samples/ignore-unchanged-tag/_config.js +++ b/test/runtime/samples/ignore-unchanged-tag/_config.js @@ -1,7 +1,7 @@ import counter from './counter.js'; export default { - data: { + props: { x: 1, y: 2 }, @@ -11,16 +11,18 @@ export default {

      2

      `, - test(assert, component) { + test({ assert, component }) { counter.count = 0; - component.set({ x: 3 }); + component.x = 3; assert.equal(counter.count, 0); - component.set({ x: 4, y: 5 }); + component.x = 4; + component.y = 5; assert.equal(counter.count, 1); - component.set({ x: 5, y: 5 }); + component.x = 5; + component.y = 5; assert.equal(counter.count, 1); } }; diff --git a/test/runtime/samples/ignore-unchanged-tag/main.html b/test/runtime/samples/ignore-unchanged-tag/main.html index e2a789912..6c748f564 100644 --- a/test/runtime/samples/ignore-unchanged-tag/main.html +++ b/test/runtime/samples/ignore-unchanged-tag/main.html @@ -1,15 +1,14 @@ -

      {x}

      -

      {myHelper(y)}

      - + +

      {x}

      +

      {myHelper(y)}

      diff --git a/test/runtime/samples/immutable-mutable/Nested.html b/test/runtime/samples/immutable-mutable/Nested.html deleted file mode 100644 index 1d623779e..000000000 --- a/test/runtime/samples/immutable-mutable/Nested.html +++ /dev/null @@ -1,13 +0,0 @@ -

      Called {count} times.

      - - \ No newline at end of file diff --git a/test/runtime/samples/immutable-mutable/_config.js b/test/runtime/samples/immutable-mutable/_config.js deleted file mode 100644 index d7381a38a..000000000 --- a/test/runtime/samples/immutable-mutable/_config.js +++ /dev/null @@ -1,18 +0,0 @@ -export default { - immutable: true, - html: `

      Called 0 times.

      `, - - test(assert, component, target, window) { - var nested = component.refs.nested; - nested.on('state', ({ changed }) => { - if (changed.foo) { - nested.set({ count: nested.get().count + 1 }); - } - }); - - assert.htmlEqual(target.innerHTML, `

      Called 0 times.

      `); - - nested.set({ foo: nested.get().foo }); - assert.htmlEqual(target.innerHTML, `

      Called 1 times.

      `); - } -}; diff --git a/test/runtime/samples/immutable-mutable/main.html b/test/runtime/samples/immutable-mutable/main.html deleted file mode 100644 index 4e3614336..000000000 --- a/test/runtime/samples/immutable-mutable/main.html +++ /dev/null @@ -1,13 +0,0 @@ -
      - -
      - - diff --git a/test/runtime/samples/immutable-nested/Nested.html b/test/runtime/samples/immutable-nested/Nested.html index 1f3d808d6..45385e9b0 100644 --- a/test/runtime/samples/immutable-nested/Nested.html +++ b/test/runtime/samples/immutable-nested/Nested.html @@ -1,12 +1,17 @@ -

      Called {count} times.

      - \ No newline at end of file + import { beforeUpdate, onMount } from 'svelte'; + + let mounted; + export let count = 0; + export let foo = { bar: 'baz' }; + + onMount(() => { + mounted = true; + }); + + beforeUpdate(() => { + if (mounted) count += 1; + }); + + +

      Called {count} times.

      \ No newline at end of file diff --git a/test/runtime/samples/immutable-nested/_config.js b/test/runtime/samples/immutable-nested/_config.js index 1268a4a98..e5c515fc7 100644 --- a/test/runtime/samples/immutable-nested/_config.js +++ b/test/runtime/samples/immutable-nested/_config.js @@ -1,18 +1,16 @@ export default { immutable: true, - html: `

      Called 0 times.

      `, - test(assert, component, target, window) { - var nested = component.refs.nested; - nested.on('state', ({ changed }) => { - if (changed.foo) { - nested.set({ count: nested.get().count + 1 }); - } - }); + html: `

      Called 1 times.

      `, - assert.htmlEqual(target.innerHTML, `

      Called 0 times.

      `); + ssrHtml: `

      Called 0 times.

      `, - nested.set({ foo: nested.get().foo }); - assert.htmlEqual(target.innerHTML, `

      Called 0 times.

      `); + test({ assert, component, target, window }) { + var nested = component.nested; + + assert.htmlEqual(target.innerHTML, `

      Called 1 times.

      `); + + nested.foo = nested.foo; + assert.htmlEqual(target.innerHTML, `

      Called 1 times.

      `); } }; diff --git a/test/runtime/samples/immutable-nested/main.html b/test/runtime/samples/immutable-nested/main.html index 4e3614336..f036cbdfc 100644 --- a/test/runtime/samples/immutable-nested/main.html +++ b/test/runtime/samples/immutable-nested/main.html @@ -1,13 +1,9 @@ -
      - -
      - + +
      + +
      diff --git a/test/runtime/samples/immutable-root/_config.js b/test/runtime/samples/immutable-root/_config.js index ab0b4287d..174dbb808 100644 --- a/test/runtime/samples/immutable-root/_config.js +++ b/test/runtime/samples/immutable-root/_config.js @@ -2,16 +2,16 @@ export default { immutable: true, html: `

      Called 0 times.

      `, - test(assert, component, target, window) { - component.on('state', ({ changed }) => { + test({ assert, component, target, window }) { + component.$on('state', ({ changed }) => { if (changed.foo) { - component.set({ count: component.get().count + 1 }); + component.count = component.count + 1; } }); assert.htmlEqual(target.innerHTML, `

      Called 0 times.

      `); - component.set({ foo: component.get().foo }); + component.foo = component.foo; assert.htmlEqual(target.innerHTML, `

      Called 0 times.

      `); } }; diff --git a/test/runtime/samples/immutable-root/main.html b/test/runtime/samples/immutable-root/main.html index b54f41743..85c31ae98 100644 --- a/test/runtime/samples/immutable-root/main.html +++ b/test/runtime/samples/immutable-root/main.html @@ -1,14 +1,8 @@ + +

      Called {count} times.

      -
      - - \ No newline at end of file +
      \ No newline at end of file diff --git a/test/runtime/samples/imported-renamed-components/main.html b/test/runtime/samples/imported-renamed-components/main.html index a97683037..9c6efdb23 100644 --- a/test/runtime/samples/imported-renamed-components/main.html +++ b/test/runtime/samples/imported-renamed-components/main.html @@ -1,10 +1,9 @@ - - + + diff --git a/test/runtime/samples/initial-state-assign/_config.js b/test/runtime/samples/initial-state-assign/_config.js index 961cffae4..b4067fef8 100644 --- a/test/runtime/samples/initial-state-assign/_config.js +++ b/test/runtime/samples/initial-state-assign/_config.js @@ -1,5 +1,5 @@ export default { - data: { bar: 'bar' }, + props: { bar: 'bar' }, html: ` "foo" "bar" diff --git a/test/runtime/samples/initial-state-assign/main.html b/test/runtime/samples/initial-state-assign/main.html index be3a61378..258b12fec 100644 --- a/test/runtime/samples/initial-state-assign/main.html +++ b/test/runtime/samples/initial-state-assign/main.html @@ -1,10 +1,7 @@ -{JSON.stringify(foo)} -{JSON.stringify(bar)} - + +{JSON.stringify(foo)} +{JSON.stringify(bar)} diff --git a/test/runtime/samples/inline-expressions/_config.js b/test/runtime/samples/inline-expressions/_config.js index 8037302ac..50cec3046 100644 --- a/test/runtime/samples/inline-expressions/_config.js +++ b/test/runtime/samples/inline-expressions/_config.js @@ -1,11 +1,12 @@ export default { - data: { + props: { a: 1, b: 2 }, html: '

      1 + 2 = 3

      ', - test ( assert, component, target ) { - component.set({ a: 3, b: 4 }); + test({ assert, component, target }) { + component.a = 3; + component.b = 4; assert.equal( target.innerHTML, '

      3 + 4 = 7

      ' ); } }; diff --git a/test/runtime/samples/instrumentation-script-destructuring/_config.js b/test/runtime/samples/instrumentation-script-destructuring/_config.js new file mode 100644 index 000000000..a0b2de9e7 --- /dev/null +++ b/test/runtime/samples/instrumentation-script-destructuring/_config.js @@ -0,0 +1,29 @@ +export default { + html: ` + + + +

      x: 0

      + `, + + async test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const click = new window.MouseEvent('click'); + + await buttons[0].dispatchEvent(click); + assert.htmlEqual(target.innerHTML, ` + + + +

      x: 1

      + `); + + await buttons[1].dispatchEvent(click); + assert.htmlEqual(target.innerHTML, ` + + + +

      x: 2

      + `); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-script-destructuring/main.html b/test/runtime/samples/instrumentation-script-destructuring/main.html new file mode 100644 index 000000000..9c96ffe62 --- /dev/null +++ b/test/runtime/samples/instrumentation-script-destructuring/main.html @@ -0,0 +1,16 @@ + + + + + +

      x: {x}

      \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-script-loop-scope/_config.js b/test/runtime/samples/instrumentation-script-loop-scope/_config.js new file mode 100644 index 000000000..1195055c4 --- /dev/null +++ b/test/runtime/samples/instrumentation-script-loop-scope/_config.js @@ -0,0 +1,17 @@ +export default { + html: ` + +

      x: 0

      + `, + + async test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const click = new window.MouseEvent('click'); + + await buttons[0].dispatchEvent(click); + assert.htmlEqual(target.innerHTML, ` + +

      x: 42

      + `); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-script-loop-scope/main.html b/test/runtime/samples/instrumentation-script-loop-scope/main.html new file mode 100644 index 000000000..d2ca75a82 --- /dev/null +++ b/test/runtime/samples/instrumentation-script-loop-scope/main.html @@ -0,0 +1,14 @@ + + + + +

      x: {x}

      \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-script-multiple-assignments/_config.js b/test/runtime/samples/instrumentation-script-multiple-assignments/_config.js new file mode 100644 index 000000000..c5107e496 --- /dev/null +++ b/test/runtime/samples/instrumentation-script-multiple-assignments/_config.js @@ -0,0 +1,28 @@ +export default { + props: { + foo: 0, + bar: 0 + }, + + html: ` + +

      foo: 0

      +

      bar: 0

      + `, + + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const click = new window.MouseEvent('click'); + + await button.dispatchEvent(click); + + assert.equal(component.foo, 4); + assert.equal(component.bar, 2); + + assert.htmlEqual(target.innerHTML, ` + +

      foo: 4

      +

      bar: 2

      + `); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-script-multiple-assignments/main.html b/test/runtime/samples/instrumentation-script-multiple-assignments/main.html new file mode 100644 index 000000000..42eecb698 --- /dev/null +++ b/test/runtime/samples/instrumentation-script-multiple-assignments/main.html @@ -0,0 +1,12 @@ + + + + +

      foo: {foo}

      +

      bar: {bar}

      \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-script-update/_config.js b/test/runtime/samples/instrumentation-script-update/_config.js new file mode 100644 index 000000000..4e97140fa --- /dev/null +++ b/test/runtime/samples/instrumentation-script-update/_config.js @@ -0,0 +1,17 @@ +export default { + html: ` + +

      x: 0

      + `, + + async test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const click = new window.MouseEvent('click'); + + await buttons[0].dispatchEvent(click); + assert.htmlEqual(target.innerHTML, ` + +

      x: 1

      + `); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-script-update/main.html b/test/runtime/samples/instrumentation-script-update/main.html new file mode 100644 index 000000000..2ab583a96 --- /dev/null +++ b/test/runtime/samples/instrumentation-script-update/main.html @@ -0,0 +1,11 @@ + + + + +

      x: {x}

      \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-template-destructuring/_config.js b/test/runtime/samples/instrumentation-template-destructuring/_config.js new file mode 100644 index 000000000..a0b2de9e7 --- /dev/null +++ b/test/runtime/samples/instrumentation-template-destructuring/_config.js @@ -0,0 +1,29 @@ +export default { + html: ` + + + +

      x: 0

      + `, + + async test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const click = new window.MouseEvent('click'); + + await buttons[0].dispatchEvent(click); + assert.htmlEqual(target.innerHTML, ` + + + +

      x: 1

      + `); + + await buttons[1].dispatchEvent(click); + assert.htmlEqual(target.innerHTML, ` + + + +

      x: 2

      + `); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-template-destructuring/main.html b/test/runtime/samples/instrumentation-template-destructuring/main.html new file mode 100644 index 000000000..65ad5792b --- /dev/null +++ b/test/runtime/samples/instrumentation-template-destructuring/main.html @@ -0,0 +1,8 @@ + + + + + +

      x: {x}

      \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-template-loop-scope/_config.js b/test/runtime/samples/instrumentation-template-loop-scope/_config.js new file mode 100644 index 000000000..1195055c4 --- /dev/null +++ b/test/runtime/samples/instrumentation-template-loop-scope/_config.js @@ -0,0 +1,17 @@ +export default { + html: ` + +

      x: 0

      + `, + + async test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const click = new window.MouseEvent('click'); + + await buttons[0].dispatchEvent(click); + assert.htmlEqual(target.innerHTML, ` + +

      x: 42

      + `); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-template-loop-scope/main.html b/test/runtime/samples/instrumentation-template-loop-scope/main.html new file mode 100644 index 000000000..6032067ff --- /dev/null +++ b/test/runtime/samples/instrumentation-template-loop-scope/main.html @@ -0,0 +1,12 @@ + + + + +

      x: {x}

      \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-template-multiple-assignments/_config.js b/test/runtime/samples/instrumentation-template-multiple-assignments/_config.js new file mode 100644 index 000000000..c5107e496 --- /dev/null +++ b/test/runtime/samples/instrumentation-template-multiple-assignments/_config.js @@ -0,0 +1,28 @@ +export default { + props: { + foo: 0, + bar: 0 + }, + + html: ` + +

      foo: 0

      +

      bar: 0

      + `, + + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const click = new window.MouseEvent('click'); + + await button.dispatchEvent(click); + + assert.equal(component.foo, 4); + assert.equal(component.bar, 2); + + assert.htmlEqual(target.innerHTML, ` + +

      foo: 4

      +

      bar: 2

      + `); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-template-multiple-assignments/main.html b/test/runtime/samples/instrumentation-template-multiple-assignments/main.html new file mode 100644 index 000000000..e2fa6fdae --- /dev/null +++ b/test/runtime/samples/instrumentation-template-multiple-assignments/main.html @@ -0,0 +1,8 @@ + + + + +

      foo: {foo}

      +

      bar: {bar}

      \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-template-update/_config.js b/test/runtime/samples/instrumentation-template-update/_config.js new file mode 100644 index 000000000..4e97140fa --- /dev/null +++ b/test/runtime/samples/instrumentation-template-update/_config.js @@ -0,0 +1,17 @@ +export default { + html: ` + +

      x: 0

      + `, + + async test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const click = new window.MouseEvent('click'); + + await buttons[0].dispatchEvent(click); + assert.htmlEqual(target.innerHTML, ` + +

      x: 1

      + `); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/instrumentation-template-update/main.html b/test/runtime/samples/instrumentation-template-update/main.html new file mode 100644 index 000000000..8ace384c3 --- /dev/null +++ b/test/runtime/samples/instrumentation-template-update/main.html @@ -0,0 +1,7 @@ + + + + +

      x: {x}

      \ No newline at end of file diff --git a/test/runtime/samples/lifecycle-events/_config.js b/test/runtime/samples/lifecycle-events/_config.js index 2a9d25564..53bc4c4d8 100644 --- a/test/runtime/samples/lifecycle-events/_config.js +++ b/test/runtime/samples/lifecycle-events/_config.js @@ -1,7 +1,8 @@ export default { - test(assert, component) { - assert.deepEqual(component.events, ['create']); - component.destroy(); - assert.deepEqual(component.events, ['create', 'destroy']); + test({ assert, component }) { + const { events } = component; + assert.deepEqual(events, ['mount']); + component.$destroy(); + assert.deepEqual(events, ['mount', 'destroy']); } }; diff --git a/test/runtime/samples/lifecycle-events/main.html b/test/runtime/samples/lifecycle-events/main.html index b39ce292d..e835e4619 100644 --- a/test/runtime/samples/lifecycle-events/main.html +++ b/test/runtime/samples/lifecycle-events/main.html @@ -1,13 +1,15 @@ -
      - \ No newline at end of file + import { onDestroy, onMount } from 'svelte'; + + export let events; + + onMount(() => { + events = ['mount']; + + return () => { + events.push('destroy'); + }; + }); + + +
      \ No newline at end of file diff --git a/test/runtime/samples/onstate-before-render/_config.js b/test/runtime/samples/lifecycle-render-order/_config.js similarity index 53% rename from test/runtime/samples/onstate-before-render/_config.js rename to test/runtime/samples/lifecycle-render-order/_config.js index 97c3af508..44d7f61da 100644 --- a/test/runtime/samples/onstate-before-render/_config.js +++ b/test/runtime/samples/lifecycle-render-order/_config.js @@ -1,14 +1,14 @@ import order from './order.js'; export default { - 'skip-ssr': true, + skip_if_ssr: true, - test(assert, component, target) { + test({ assert, component, target }) { assert.deepEqual(order, [ - 'onstate', + 'beforeUpdate', 'render', - 'oncreate', - 'onupdate' + 'afterUpdate', + 'onMount' ]); order.length = 0; diff --git a/test/runtime/samples/lifecycle-render-order/main.html b/test/runtime/samples/lifecycle-render-order/main.html new file mode 100644 index 000000000..719cd6832 --- /dev/null +++ b/test/runtime/samples/lifecycle-render-order/main.html @@ -0,0 +1,24 @@ + + +{identity(42)} \ No newline at end of file diff --git a/test/runtime/samples/onstate-before-render/order.js b/test/runtime/samples/lifecycle-render-order/order.js similarity index 100% rename from test/runtime/samples/onstate-before-render/order.js rename to test/runtime/samples/lifecycle-render-order/order.js diff --git a/test/runtime/samples/module-context/_config.js b/test/runtime/samples/module-context/_config.js new file mode 100644 index 000000000..0ea26ee44 --- /dev/null +++ b/test/runtime/samples/module-context/_config.js @@ -0,0 +1,3 @@ +export default { + html: `

      42

      ` +}; \ No newline at end of file diff --git a/test/runtime/samples/module-context/main.html b/test/runtime/samples/module-context/main.html new file mode 100644 index 000000000..851d98bea --- /dev/null +++ b/test/runtime/samples/module-context/main.html @@ -0,0 +1,5 @@ + + +

      {foo}

      \ No newline at end of file diff --git a/test/runtime/samples/names-deconflicted-nested/_config.js b/test/runtime/samples/names-deconflicted-nested/_config.js index f666a0044..ec35d3e4e 100644 --- a/test/runtime/samples/names-deconflicted-nested/_config.js +++ b/test/runtime/samples/names-deconflicted-nested/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { array: [ [0,0,0], [0,0,0], [0,0,0] ] }, diff --git a/test/runtime/samples/names-deconflicted/_config.js b/test/runtime/samples/names-deconflicted/_config.js index 0c4f9d910..07b337a1e 100644 --- a/test/runtime/samples/names-deconflicted/_config.js +++ b/test/runtime/samples/names-deconflicted/_config.js @@ -1,13 +1,11 @@ export default { html: `

      1: foo

      2: bar

      3: baz

      `, - test ( assert, component, target ) { - component.set({ - widgets: [ - { name: 'bish' }, - { name: 'bosh' } - ] - }); + test({ assert, component, target }) { + component.widgets = [ + { name: 'bish' }, + { name: 'bosh' } + ]; assert.htmlEqual( target.innerHTML, `

      1: bish

      2: bosh

      ` ); } diff --git a/test/runtime/samples/names-deconflicted/main.html b/test/runtime/samples/names-deconflicted/main.html index 282c43826..f2c47a771 100644 --- a/test/runtime/samples/names-deconflicted/main.html +++ b/test/runtime/samples/names-deconflicted/main.html @@ -1,21 +1,13 @@ -{#each widgets as widget, i} - -{/each} - + +{#each widgets as widget, i} + +{/each} diff --git a/test/runtime/samples/nbsp/_config.js b/test/runtime/samples/nbsp/_config.js index c09c14e7c..6322725f9 100644 --- a/test/runtime/samples/nbsp/_config.js +++ b/test/runtime/samples/nbsp/_config.js @@ -1,7 +1,7 @@ export default { html: ` `, - test ( assert, component, target ) { + test({ assert, component, target }) { const text = target.querySelector( 'span' ).textContent; assert.equal( text.charCodeAt( 0 ), 160 ); } diff --git a/test/runtime/samples/nested-transition-detach-each/_config.js b/test/runtime/samples/nested-transition-detach-each/_config.js index 5c6386fae..e17fe1bc4 100644 --- a/test/runtime/samples/nested-transition-detach-each/_config.js +++ b/test/runtime/samples/nested-transition-detach-each/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { visible: false, rows: [1, 2, 3], cols: ['a', 'b', 'c'] @@ -8,13 +8,11 @@ export default { html: ``, compileOptions: { - dev: true, - nestedTransitions: true, - skipIntroByDefault: true, + dev: true }, - test(assert, component, target, window, raf) { - component.set({ visible: true }); + test({ assert, component, target, window, raf }) { + component.visible = true; assert.htmlEqual(target.innerHTML, `
      1, a
      @@ -33,7 +31,7 @@ export default {
      `); - component.set({ visible: false }); + component.visible = false; raf.tick(0); raf.tick(100); assert.htmlEqual(target.innerHTML, ``); diff --git a/test/runtime/samples/nested-transition-detach-each/main.html b/test/runtime/samples/nested-transition-detach-each/main.html index c81fc3eb7..6f04d3fb6 100644 --- a/test/runtime/samples/nested-transition-detach-each/main.html +++ b/test/runtime/samples/nested-transition-detach-each/main.html @@ -1,3 +1,16 @@ + + {#if visible} {#each rows as row}
      @@ -6,17 +19,4 @@ {/each}
      {/each} -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/nested-transition-detach-if-false/Folder.html b/test/runtime/samples/nested-transition-detach-if-false/Folder.html index cd3448a3f..b37ba80b7 100644 --- a/test/runtime/samples/nested-transition-detach-if-false/Folder.html +++ b/test/runtime/samples/nested-transition-detach-if-false/Folder.html @@ -1,9 +1,30 @@ + +
    • {dir} {#if open}
        - {#each items as item (item.filename)} + {#each get_items() as item (item.filename)} {#if item.isDir} {:else} @@ -12,33 +33,4 @@ {/each}
      {/if} -
    • - - \ No newline at end of file +
    • \ No newline at end of file diff --git a/test/runtime/samples/nested-transition-detach-if-false/_config.js b/test/runtime/samples/nested-transition-detach-if-false/_config.js index 1e26a5478..b76eb5cd3 100644 --- a/test/runtime/samples/nested-transition-detach-if-false/_config.js +++ b/test/runtime/samples/nested-transition-detach-if-false/_config.js @@ -13,10 +13,8 @@ export default { `, - nestedTransitions: true, - - test(assert, component, target, window, raf) { - component.refs.folder.set({ open: false }); + test({ assert, component, target, window, raf }) { + component.folder.open = false; assert.htmlEqual(target.innerHTML, `
    • a diff --git a/test/runtime/samples/nested-transition-detach-if-false/main.html b/test/runtime/samples/nested-transition-detach-if-false/main.html index cf14773c9..41429fca3 100644 --- a/test/runtime/samples/nested-transition-detach-if-false/main.html +++ b/test/runtime/samples/nested-transition-detach-if-false/main.html @@ -1,9 +1,7 @@ - - \ No newline at end of file + export let folder; + + import Folder from './Folder.html'; + + + \ No newline at end of file diff --git a/test/runtime/samples/nested-transition-if-block-not-remounted/_config.js b/test/runtime/samples/nested-transition-if-block-not-remounted/_config.js index 128a51813..6696389e6 100644 --- a/test/runtime/samples/nested-transition-if-block-not-remounted/_config.js +++ b/test/runtime/samples/nested-transition-if-block-not-remounted/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: true, value: 'one' }, @@ -11,9 +11,7 @@ export default {
    `, - nestedTransitions: true, - - test(assert, component, target, window, raf) { + test({ assert, component, target, window, raf }) { const div = target.querySelector('div'); const { appendChild, insertBefore } = div; @@ -21,6 +19,6 @@ export default { throw new Error('DOM was mutated'); }; - component.set({ value: 'two' }); + component.value = 'two'; }, }; diff --git a/test/runtime/samples/nested-transition-if-block-not-remounted/main.html b/test/runtime/samples/nested-transition-if-block-not-remounted/main.html index ad8b2454a..373d3d048 100644 --- a/test/runtime/samples/nested-transition-if-block-not-remounted/main.html +++ b/test/runtime/samples/nested-transition-if-block-not-remounted/main.html @@ -1,14 +1,12 @@ + +
    {#if x} - + x {/if} -
    - - \ No newline at end of file +
    \ No newline at end of file diff --git a/test/runtime/samples/noscript-removal/_config.js b/test/runtime/samples/noscript-removal/_config.js index d935af949..35bdcefd9 100644 --- a/test/runtime/samples/noscript-removal/_config.js +++ b/test/runtime/samples/noscript-removal/_config.js @@ -1,5 +1,5 @@ export default { - 'skip-ssr': true, + skip_if_ssr: true, html: `
    foo
    diff --git a/test/runtime/samples/object-rest/_config.js b/test/runtime/samples/object-rest/_config.js deleted file mode 100644 index 7a60f0d56..000000000 --- a/test/runtime/samples/object-rest/_config.js +++ /dev/null @@ -1,27 +0,0 @@ -export default { - skip: +/v(\d+)/.exec(process.version)[1] < 8, - - html: ` -
    {"wanted":2}
    - `, - - test(assert, component, target) { - component.set({ - unwanted: 3, - wanted: 4 - }); - - assert.htmlEqual(target.innerHTML, ` -
    {"wanted":4}
    - `); - - component.set({ - unwanted: 5, - wanted: 6 - }); - - assert.htmlEqual(target.innerHTML, ` -
    {"wanted":6}
    - `); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/object-rest/main.html b/test/runtime/samples/object-rest/main.html deleted file mode 100644 index e66a89291..000000000 --- a/test/runtime/samples/object-rest/main.html +++ /dev/null @@ -1,18 +0,0 @@ -
    {JSON.stringify(props)}
    - \ No newline at end of file diff --git a/test/runtime/samples/observe-binding-ignores-unchanged/Nested.html b/test/runtime/samples/observe-binding-ignores-unchanged/Nested.html deleted file mode 100644 index 8f7559a77..000000000 --- a/test/runtime/samples/observe-binding-ignores-unchanged/Nested.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/observe-binding-ignores-unchanged/_config.js b/test/runtime/samples/observe-binding-ignores-unchanged/_config.js deleted file mode 100644 index 7163e8e4a..000000000 --- a/test/runtime/samples/observe-binding-ignores-unchanged/_config.js +++ /dev/null @@ -1,34 +0,0 @@ -export default { - html: ` - -

    field1: 1

    -

    field2: 2

    - `, - - ssrHtml: ` - -

    field1: 1

    -

    field2: 2

    - `, - - test(assert, component, target, window) { - let triggered = false; - component.refs.nested.on('state', ({ changed }) => { - if (changed.field2) triggered = true; - }); - - const input = target.querySelector('input'); - const event = new window.Event('input'); - - input.value = 3; - input.dispatchEvent(event); // will throw error if observer fires incorrectly - - assert.ok(!triggered); - - assert.htmlEqual(target.innerHTML, ` - -

    field1: 3

    -

    field2: 2

    - `); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/observe-binding-ignores-unchanged/main.html b/test/runtime/samples/observe-binding-ignores-unchanged/main.html deleted file mode 100644 index 2492f1830..000000000 --- a/test/runtime/samples/observe-binding-ignores-unchanged/main.html +++ /dev/null @@ -1,21 +0,0 @@ - -

    field1: {myObject.field1}

    -

    field2: {myObject.field2}

    - - \ No newline at end of file diff --git a/test/runtime/samples/observe-component-ignores-irrelevant-changes/Foo.html b/test/runtime/samples/observe-component-ignores-irrelevant-changes/Foo.html deleted file mode 100644 index 7c89b545c..000000000 --- a/test/runtime/samples/observe-component-ignores-irrelevant-changes/Foo.html +++ /dev/null @@ -1 +0,0 @@ -
    diff --git a/test/runtime/samples/observe-component-ignores-irrelevant-changes/_config.js b/test/runtime/samples/observe-component-ignores-irrelevant-changes/_config.js deleted file mode 100644 index f14d044a1..000000000 --- a/test/runtime/samples/observe-component-ignores-irrelevant-changes/_config.js +++ /dev/null @@ -1,15 +0,0 @@ -export default { - test(assert, component) { - const foo = component.refs.foo; - let count = 0; - - foo.on('state', ({ changed }) => { - if (changed.foo) count += 1; - }); - - assert.equal(count, 0); - - component.set({ y: {} }); - assert.equal(count, 0); - } -}; diff --git a/test/runtime/samples/observe-component-ignores-irrelevant-changes/main.html b/test/runtime/samples/observe-component-ignores-irrelevant-changes/main.html deleted file mode 100644 index 2063d8c1b..000000000 --- a/test/runtime/samples/observe-component-ignores-irrelevant-changes/main.html +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/test/runtime/samples/observe-deferred/_config.js b/test/runtime/samples/observe-deferred/_config.js deleted file mode 100644 index 8ccca0d2a..000000000 --- a/test/runtime/samples/observe-deferred/_config.js +++ /dev/null @@ -1,22 +0,0 @@ -export default { - 'skip-ssr': true, - - data: { - value: 'hello!' - }, - - html: ` -

    hello!

    -

    hello!

    - `, - - test ( assert, component, target ) { - component.set({ value: 'goodbye!' }); - assert.htmlEqual( target.innerHTML, ` -

    goodbye!

    -

    goodbye!

    - ` ); - - component.destroy(); - } -}; diff --git a/test/runtime/samples/observe-deferred/main.html b/test/runtime/samples/observe-deferred/main.html deleted file mode 100644 index 9765e9115..000000000 --- a/test/runtime/samples/observe-deferred/main.html +++ /dev/null @@ -1,14 +0,0 @@ -

    {value}

    -

    - - \ No newline at end of file diff --git a/test/runtime/samples/observe-prevents-loop/_config.js b/test/runtime/samples/observe-prevents-loop/_config.js deleted file mode 100644 index 52a03e377..000000000 --- a/test/runtime/samples/observe-prevents-loop/_config.js +++ /dev/null @@ -1,29 +0,0 @@ -export default { - data: { - thing: { a: 1 } - }, - - test(assert, component) { - const thing = component.get().thing; - - component.on('state', ({ changed, current }) => { - if (changed.thing) { - const { thing } = current; - thing.b = thing.a * 2; - component.set({ thing }); // triggers infinite loop, unless event handler breaks it - } - }); - - assert.deepEqual(thing, { - a: 1 - }); - - thing.a = 3; - component.set({ thing }); - - assert.deepEqual(thing, { - a: 3, - b: 6 - }); - } -}; diff --git a/test/runtime/samples/observe-prevents-loop/main.html b/test/runtime/samples/observe-prevents-loop/main.html deleted file mode 100644 index 7c89b545c..000000000 --- a/test/runtime/samples/observe-prevents-loop/main.html +++ /dev/null @@ -1 +0,0 @@ -
    diff --git a/test/runtime/samples/oncreate-async-arrow-block/_config.js b/test/runtime/samples/oncreate-async-arrow-block/_config.js deleted file mode 100644 index a5ed4ad14..000000000 --- a/test/runtime/samples/oncreate-async-arrow-block/_config.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - skip: +(/^v(\d)/.exec(process.version)[1]) < 8 -}; diff --git a/test/runtime/samples/oncreate-async-arrow-block/main.html b/test/runtime/samples/oncreate-async-arrow-block/main.html deleted file mode 100644 index 6a3f4c48f..000000000 --- a/test/runtime/samples/oncreate-async-arrow-block/main.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/test/runtime/samples/oncreate-async-arrow/_config.js b/test/runtime/samples/oncreate-async-arrow/_config.js deleted file mode 100644 index a5ed4ad14..000000000 --- a/test/runtime/samples/oncreate-async-arrow/_config.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - skip: +(/^v(\d)/.exec(process.version)[1]) < 8 -}; diff --git a/test/runtime/samples/oncreate-async-arrow/main.html b/test/runtime/samples/oncreate-async-arrow/main.html deleted file mode 100644 index b37145dd1..000000000 --- a/test/runtime/samples/oncreate-async-arrow/main.html +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/test/runtime/samples/oncreate-async/_config.js b/test/runtime/samples/oncreate-async/_config.js deleted file mode 100644 index a5ed4ad14..000000000 --- a/test/runtime/samples/oncreate-async/_config.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - skip: +(/^v(\d)/.exec(process.version)[1]) < 8 -}; diff --git a/test/runtime/samples/oncreate-async/main.html b/test/runtime/samples/oncreate-async/main.html deleted file mode 100644 index b8b74050b..000000000 --- a/test/runtime/samples/oncreate-async/main.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/test/runtime/samples/oncreate-sibling-order/Nested.html b/test/runtime/samples/oncreate-sibling-order/Nested.html deleted file mode 100644 index 6bf82772a..000000000 --- a/test/runtime/samples/oncreate-sibling-order/Nested.html +++ /dev/null @@ -1,11 +0,0 @@ -

    {name}

    - - \ No newline at end of file diff --git a/test/runtime/samples/oncreate-sibling-order/main.html b/test/runtime/samples/oncreate-sibling-order/main.html deleted file mode 100644 index ba594477f..000000000 --- a/test/runtime/samples/oncreate-sibling-order/main.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - \ No newline at end of file diff --git a/test/runtime/samples/ondestroy-before-cleanup/Top.html b/test/runtime/samples/ondestroy-before-cleanup/Top.html index 1e936b48f..a0a3549ef 100644 --- a/test/runtime/samples/ondestroy-before-cleanup/Top.html +++ b/test/runtime/samples/ondestroy-before-cleanup/Top.html @@ -1,9 +1,12 @@ -
    - + +
    diff --git a/test/runtime/samples/ondestroy-before-cleanup/_config.js b/test/runtime/samples/ondestroy-before-cleanup/_config.js index d83fbf17a..e9721f24b 100644 --- a/test/runtime/samples/ondestroy-before-cleanup/_config.js +++ b/test/runtime/samples/ondestroy-before-cleanup/_config.js @@ -1,9 +1,13 @@ +import container from './container.js'; + export default { - test(assert, component, target) { - const top = component.refs.top; + test({ assert, component, target }) { + container.div = null; + + const top = component.top; const div = target.querySelector('div'); - component.set({ visible: false }); - assert.equal(top.refOnDestroy, div); + component.visible = false; + assert.equal(container.div, div); } }; \ No newline at end of file diff --git a/test/runtime/samples/ondestroy-before-cleanup/container.js b/test/runtime/samples/ondestroy-before-cleanup/container.js new file mode 100644 index 000000000..7c645e42f --- /dev/null +++ b/test/runtime/samples/ondestroy-before-cleanup/container.js @@ -0,0 +1 @@ +export default {}; \ No newline at end of file diff --git a/test/runtime/samples/ondestroy-before-cleanup/main.html b/test/runtime/samples/ondestroy-before-cleanup/main.html index cce0356f6..15da7a5cb 100644 --- a/test/runtime/samples/ondestroy-before-cleanup/main.html +++ b/test/runtime/samples/ondestroy-before-cleanup/main.html @@ -1,18 +1,10 @@ -{#if visible} - -{/if} - \ No newline at end of file + + export let top; + export let visible = true; + + +{#if visible} + +{/if} \ No newline at end of file diff --git a/test/runtime/samples/onmount-async/_config.js b/test/runtime/samples/onmount-async/_config.js new file mode 100644 index 000000000..f1dcc36d4 --- /dev/null +++ b/test/runtime/samples/onmount-async/_config.js @@ -0,0 +1,3 @@ +export default { + skip: +(/^v(\d+)/.exec(process.version)[1]) < 8 +}; diff --git a/test/runtime/samples/onmount-async/main.html b/test/runtime/samples/onmount-async/main.html new file mode 100644 index 000000000..f75c6ccd4 --- /dev/null +++ b/test/runtime/samples/onmount-async/main.html @@ -0,0 +1,7 @@ + diff --git a/test/runtime/samples/onrender-fires-when-ready-nested/ParentWidget.html b/test/runtime/samples/onmount-fires-when-ready-nested/ParentWidget.html similarity index 63% rename from test/runtime/samples/onrender-fires-when-ready-nested/ParentWidget.html rename to test/runtime/samples/onmount-fires-when-ready-nested/ParentWidget.html index 5774edea1..e1dc10c77 100644 --- a/test/runtime/samples/onrender-fires-when-ready-nested/ParentWidget.html +++ b/test/runtime/samples/onmount-fires-when-ready-nested/ParentWidget.html @@ -1,11 +1,7 @@ -{#if foo}{/if} - + +{#if foo}{/if} diff --git a/test/runtime/samples/onmount-fires-when-ready-nested/Widget.html b/test/runtime/samples/onmount-fires-when-ready-nested/Widget.html new file mode 100644 index 000000000..80c2dad6c --- /dev/null +++ b/test/runtime/samples/onmount-fires-when-ready-nested/Widget.html @@ -0,0 +1,13 @@ + + +

    {inDocument}

    diff --git a/test/runtime/samples/onrender-fires-when-ready-nested/_config.js b/test/runtime/samples/onmount-fires-when-ready-nested/_config.js similarity index 64% rename from test/runtime/samples/onrender-fires-when-ready-nested/_config.js rename to test/runtime/samples/onmount-fires-when-ready-nested/_config.js index f16d3ddeb..b7446c1d7 100644 --- a/test/runtime/samples/onrender-fires-when-ready-nested/_config.js +++ b/test/runtime/samples/onmount-fires-when-ready-nested/_config.js @@ -1,5 +1,5 @@ export default { - 'skip-ssr': true, // uses oncreate + skip_if_ssr: true, // uses oncreate html: `

    true

    \n

    true

    ` }; diff --git a/test/runtime/samples/onrender-fires-when-ready-nested/main.html b/test/runtime/samples/onmount-fires-when-ready-nested/main.html similarity index 67% rename from test/runtime/samples/onrender-fires-when-ready-nested/main.html rename to test/runtime/samples/onmount-fires-when-ready-nested/main.html index 6ba25d0a6..910f63e08 100644 --- a/test/runtime/samples/onrender-fires-when-ready-nested/main.html +++ b/test/runtime/samples/onmount-fires-when-ready-nested/main.html @@ -1,16 +1,9 @@ -
    - - -
    - + +
    + + +
    diff --git a/test/runtime/samples/onmount-fires-when-ready/Widget.html b/test/runtime/samples/onmount-fires-when-ready/Widget.html new file mode 100644 index 000000000..80c2dad6c --- /dev/null +++ b/test/runtime/samples/onmount-fires-when-ready/Widget.html @@ -0,0 +1,13 @@ + + +

    {inDocument}

    diff --git a/test/runtime/samples/onmount-fires-when-ready/_config.js b/test/runtime/samples/onmount-fires-when-ready/_config.js new file mode 100644 index 000000000..de095cbdb --- /dev/null +++ b/test/runtime/samples/onmount-fires-when-ready/_config.js @@ -0,0 +1,10 @@ +export default { + skip_if_ssr: true, // uses oncreate + + html: `

    true

    `, + + test({ assert, component, target }) { + component.foo = true; + assert.htmlEqual(target.innerHTML, `

    true

    \n

    true

    `); + } +}; diff --git a/test/runtime/samples/onrender-fires-when-ready/main.html b/test/runtime/samples/onmount-fires-when-ready/main.html similarity index 68% rename from test/runtime/samples/onrender-fires-when-ready/main.html rename to test/runtime/samples/onmount-fires-when-ready/main.html index 49bfc412d..f2760ecff 100644 --- a/test/runtime/samples/onrender-fires-when-ready/main.html +++ b/test/runtime/samples/onmount-fires-when-ready/main.html @@ -1,3 +1,9 @@ + +
    @@ -5,13 +11,3 @@ {/if}
    - - diff --git a/test/runtime/samples/onmount-sibling-order/Nested.html b/test/runtime/samples/onmount-sibling-order/Nested.html new file mode 100644 index 000000000..da163387d --- /dev/null +++ b/test/runtime/samples/onmount-sibling-order/Nested.html @@ -0,0 +1,13 @@ + + +

    {name}

    \ No newline at end of file diff --git a/test/runtime/samples/oncreate-sibling-order/_config.js b/test/runtime/samples/onmount-sibling-order/_config.js similarity index 52% rename from test/runtime/samples/oncreate-sibling-order/_config.js rename to test/runtime/samples/onmount-sibling-order/_config.js index 4e28940b7..bf8a52b2f 100644 --- a/test/runtime/samples/oncreate-sibling-order/_config.js +++ b/test/runtime/samples/onmount-sibling-order/_config.js @@ -1,10 +1,13 @@ import result from './result.js'; export default { - test(assert) { + // TODO is sibling onMount order important? + skip: true, + + test({ assert }) { assert.deepEqual(result, [ - 'oncreate foo', - 'oncreate bar' + 'onMount foo', + 'onMount bar' ]); result.pop(); diff --git a/test/runtime/samples/onmount-sibling-order/main.html b/test/runtime/samples/onmount-sibling-order/main.html new file mode 100644 index 000000000..e4218aa4b --- /dev/null +++ b/test/runtime/samples/onmount-sibling-order/main.html @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/test/runtime/samples/oncreate-sibling-order/result.js b/test/runtime/samples/onmount-sibling-order/result.js similarity index 100% rename from test/runtime/samples/oncreate-sibling-order/result.js rename to test/runtime/samples/onmount-sibling-order/result.js diff --git a/test/runtime/samples/onrender-chain/Item.html b/test/runtime/samples/onrender-chain/Item.html deleted file mode 100644 index ca0f489b5..000000000 --- a/test/runtime/samples/onrender-chain/Item.html +++ /dev/null @@ -1,14 +0,0 @@ -{foo} - - \ No newline at end of file diff --git a/test/runtime/samples/onrender-chain/List.html b/test/runtime/samples/onrender-chain/List.html deleted file mode 100644 index 513c62b2e..000000000 --- a/test/runtime/samples/onrender-chain/List.html +++ /dev/null @@ -1,25 +0,0 @@ -{#each items as item} - -{/each} - - diff --git a/test/runtime/samples/onrender-chain/_config.js b/test/runtime/samples/onrender-chain/_config.js deleted file mode 100644 index 1bbf61611..000000000 --- a/test/runtime/samples/onrender-chain/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -export default { - 'skip-ssr': true, - - html: ` - 321 - `, - - test ( assert, component, target ) { - component.refs.list.update(); - - assert.htmlEqual( target.innerHTML, ` - 12345 - ` ); - - component.destroy(); - } -}; diff --git a/test/runtime/samples/onrender-fires-when-ready-nested/Widget.html b/test/runtime/samples/onrender-fires-when-ready-nested/Widget.html deleted file mode 100644 index 4bbcb98f3..000000000 --- a/test/runtime/samples/onrender-fires-when-ready-nested/Widget.html +++ /dev/null @@ -1,9 +0,0 @@ -

    {inDocument}

    - - diff --git a/test/runtime/samples/onrender-fires-when-ready/Widget.html b/test/runtime/samples/onrender-fires-when-ready/Widget.html deleted file mode 100644 index 4bbcb98f3..000000000 --- a/test/runtime/samples/onrender-fires-when-ready/Widget.html +++ /dev/null @@ -1,9 +0,0 @@ -

    {inDocument}

    - - diff --git a/test/runtime/samples/onrender-fires-when-ready/_config.js b/test/runtime/samples/onrender-fires-when-ready/_config.js deleted file mode 100644 index d70d2c6e5..000000000 --- a/test/runtime/samples/onrender-fires-when-ready/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -export default { - 'skip-ssr': true, // uses oncreate - - html: `

    true

    `, - - test ( assert, component, target ) { - component.set({ foo: true }); - assert.htmlEqual( target.innerHTML, `

    true

    \n

    true

    ` ); - - component.destroy(); - } -}; diff --git a/test/runtime/samples/onstate-before-oncreate/_config.js b/test/runtime/samples/onstate-before-oncreate/_config.js deleted file mode 100644 index ff2b87b71..000000000 --- a/test/runtime/samples/onstate-before-oncreate/_config.js +++ /dev/null @@ -1,8 +0,0 @@ -export default { - 'skip-ssr': true, - - test(assert, component, target) { - assert.ok(component.onstateRanBeforeOncreate); - assert.ok(!component.onupdateRanBeforeOncreate); - } -}; diff --git a/test/runtime/samples/onstate-before-oncreate/main.html b/test/runtime/samples/onstate-before-oncreate/main.html deleted file mode 100644 index 9d4aa980e..000000000 --- a/test/runtime/samples/onstate-before-oncreate/main.html +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/onstate-before-render/main.html b/test/runtime/samples/onstate-before-render/main.html deleted file mode 100644 index 572275268..000000000 --- a/test/runtime/samples/onstate-before-render/main.html +++ /dev/null @@ -1,26 +0,0 @@ -{identity(42)} - - \ No newline at end of file diff --git a/test/runtime/samples/onstate-event/_config.js b/test/runtime/samples/onstate-event/_config.js deleted file mode 100644 index d3f24376f..000000000 --- a/test/runtime/samples/onstate-event/_config.js +++ /dev/null @@ -1,49 +0,0 @@ -export default { - 'skip-ssr': true, - - data: { - foo: 'woo!' - }, - - html: ` -

    woo!

    -

    undefined

    - `, - - test(assert, component, target) { - const history = []; - - component.on('state', ({ changed, current, previous }) => { - history.push({ changed, current, previous }); - component.set({ bar: current.foo.toUpperCase() }); - }); - - component.set({ foo: 'yeah!' }); - assert.htmlEqual(target.innerHTML, ` -

    yeah!

    -

    YEAH!

    - `); - - component.set({ unused: 'x' }); - - assert.deepEqual(history, [ - { - changed: { foo: true }, - current: { foo: 'yeah!' }, - previous: { foo: 'woo!' } - }, - // this is NOT received, because Svelte will not allow - // an event handler to trigger itself recursively - // { - // changed: { bar: true }, - // current: { foo: 'yeah!', bar: 'YEAH!' }, - // previous: { foo: 'yeah!' } - // }, - { - changed: { unused: true }, - current: { foo: 'yeah!', bar: 'YEAH!', unused: 'x' }, - previous: { foo: 'yeah!', bar: 'YEAH!' } - } - ]); - } -}; diff --git a/test/runtime/samples/onstate-event/main.html b/test/runtime/samples/onstate-event/main.html deleted file mode 100644 index fbcc02f2f..000000000 --- a/test/runtime/samples/onstate-event/main.html +++ /dev/null @@ -1,2 +0,0 @@ -

    {foo}

    -

    {bar}

    \ No newline at end of file diff --git a/test/runtime/samples/onstate-no-template/_config.js b/test/runtime/samples/onstate-no-template/_config.js deleted file mode 100644 index 87d7c599c..000000000 --- a/test/runtime/samples/onstate-no-template/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -export default { - 'skip-ssr': true, - - data: { - foo: 'woo!' - }, - - test(assert, component) { - assert.deepEqual(component.changed, { foo: 1 }); - } -}; diff --git a/test/runtime/samples/onstate-no-template/main.html b/test/runtime/samples/onstate-no-template/main.html deleted file mode 100644 index a3c59f99b..000000000 --- a/test/runtime/samples/onstate-no-template/main.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/test/runtime/samples/onstate/_config.js b/test/runtime/samples/onstate/_config.js deleted file mode 100644 index 48712bb41..000000000 --- a/test/runtime/samples/onstate/_config.js +++ /dev/null @@ -1,20 +0,0 @@ -export default { - 'skip-ssr': true, - - data: { - foo: 'woo!' - }, - - html: ` -

    woo!

    -

    WOO!

    - `, - - test(assert, component, target) { - component.set({ foo: 'yeah!' }); - assert.htmlEqual(target.innerHTML, ` -

    yeah!

    -

    YEAH!

    - `); - } -}; diff --git a/test/runtime/samples/onstate/main.html b/test/runtime/samples/onstate/main.html deleted file mode 100644 index f35c64cd7..000000000 --- a/test/runtime/samples/onstate/main.html +++ /dev/null @@ -1,10 +0,0 @@ -

    {foo}

    -

    {bar}

    - - \ No newline at end of file diff --git a/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/_config.js b/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/_config.js deleted file mode 100644 index ff2b87b71..000000000 --- a/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/_config.js +++ /dev/null @@ -1,8 +0,0 @@ -export default { - 'skip-ssr': true, - - test(assert, component, target) { - assert.ok(component.onstateRanBeforeOncreate); - assert.ok(!component.onupdateRanBeforeOncreate); - } -}; diff --git a/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/main.html b/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/main.html deleted file mode 100644 index d930bbcbb..000000000 --- a/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/main.html +++ /dev/null @@ -1,17 +0,0 @@ -
    - diff --git a/test/runtime/samples/onupdate/main.html b/test/runtime/samples/onupdate/main.html deleted file mode 100644 index 49afda13e..000000000 --- a/test/runtime/samples/onupdate/main.html +++ /dev/null @@ -1,12 +0,0 @@ -

    {value}

    -

    - - \ No newline at end of file diff --git a/test/runtime/samples/option-without-select/_config.js b/test/runtime/samples/option-without-select/_config.js index 95c250458..48303961a 100644 --- a/test/runtime/samples/option-without-select/_config.js +++ b/test/runtime/samples/option-without-select/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { foo: 'hello' }, html: ``, - test(assert, component, target) { - component.set({ foo: 'goodbye' }); + test({ assert, component, target }) { + component.foo = 'goodbye'; assert.htmlEqual(target.innerHTML, ` `); diff --git a/test/runtime/samples/options/_config.js b/test/runtime/samples/options/_config.js deleted file mode 100644 index 6f321d7a6..000000000 --- a/test/runtime/samples/options/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -export default { - 'skip-ssr': true, - html: `

    from this.options

    `, - - options: { - text: 'from this.options' - }, - - test(assert, component) { - assert.equal(component.options.text, 'from this.options'); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/options/main.html b/test/runtime/samples/options/main.html deleted file mode 100644 index 1053bc4c0..000000000 --- a/test/runtime/samples/options/main.html +++ /dev/null @@ -1,11 +0,0 @@ -

    {text}

    - - \ No newline at end of file diff --git a/test/runtime/samples/paren-wrapped-expressions/_config.js b/test/runtime/samples/paren-wrapped-expressions/_config.js index 4b784625c..0c757dc85 100644 --- a/test/runtime/samples/paren-wrapped-expressions/_config.js +++ b/test/runtime/samples/paren-wrapped-expressions/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { a: 'foo', b: true, c: [ 1, 2, 3 ], diff --git a/test/runtime/samples/preload/_config.js b/test/runtime/samples/preload/_config.js index bfc7f6ee7..1b35ebbe7 100644 --- a/test/runtime/samples/preload/_config.js +++ b/test/runtime/samples/preload/_config.js @@ -1,6 +1,5 @@ export default { - test(assert, component) { - const Component = component.constructor; - assert.deepEqual(Component.preload({ foo: 1 }), { bar: 2 }); + test({ assert, mod }) { + assert.deepEqual(mod.preload({ foo: 1 }), { bar: 2 }); } }; \ No newline at end of file diff --git a/test/runtime/samples/preload/main.html b/test/runtime/samples/preload/main.html index ef3f26067..f7f2adff1 100644 --- a/test/runtime/samples/preload/main.html +++ b/test/runtime/samples/preload/main.html @@ -1,9 +1,7 @@ - \ No newline at end of file diff --git a/test/runtime/samples/raw-anchor-first-child/_config.js b/test/runtime/samples/raw-anchor-first-child/_config.js index 003dda1ea..32f948bcb 100644 --- a/test/runtime/samples/raw-anchor-first-child/_config.js +++ b/test/runtime/samples/raw-anchor-first-child/_config.js @@ -1,14 +1,12 @@ export default { - data: { + props: { raw: `foo` }, - test ( assert, component, target ) { + test({ assert, component, target }) { const span = target.querySelector('span'); assert.ok(!span.previousSibling); - component.set({ - raw: `bar` - }); + component.raw = `bar`; } }; diff --git a/test/runtime/samples/raw-anchor-first-last-child/_config.js b/test/runtime/samples/raw-anchor-first-last-child/_config.js index 4e8e79611..31f8c343e 100644 --- a/test/runtime/samples/raw-anchor-first-last-child/_config.js +++ b/test/runtime/samples/raw-anchor-first-last-child/_config.js @@ -1,15 +1,13 @@ export default { - data: { + props: { raw: `foo` }, - test ( assert, component, target ) { + test({ assert, component, target }) { const span = target.querySelector('span'); assert.ok(!span.previousSibling); assert.ok(!span.nextSibling); - component.set({ - raw: `bar` - }); + component.raw = `bar`; } }; diff --git a/test/runtime/samples/raw-anchor-last-child/_config.js b/test/runtime/samples/raw-anchor-last-child/_config.js index 54a774f46..ea2217b4c 100644 --- a/test/runtime/samples/raw-anchor-last-child/_config.js +++ b/test/runtime/samples/raw-anchor-last-child/_config.js @@ -1,14 +1,12 @@ export default { - data: { + props: { raw: `foo` }, - test ( assert, component, target ) { + test({ assert, component, target }) { const span = target.querySelector('span'); assert.ok(!span.nextSibling); - component.set({ - raw: `bar` - }); + component.raw = `bar`; } }; diff --git a/test/runtime/samples/raw-anchor-next-previous-sibling/_config.js b/test/runtime/samples/raw-anchor-next-previous-sibling/_config.js index 7c9769ea7..d28e84fc3 100644 --- a/test/runtime/samples/raw-anchor-next-previous-sibling/_config.js +++ b/test/runtime/samples/raw-anchor-next-previous-sibling/_config.js @@ -1,15 +1,13 @@ export default { - data: { + props: { raw: `foo` }, - test ( assert, component, target ) { + test({ assert, component, target }) { const span = target.querySelector('span'); assert.equal(span.previousSibling.nodeName, 'BR'); assert.equal(span.nextSibling.nodeName, 'BR'); - component.set({ - raw: `bar` - }); + component.raw = `bar`; } }; diff --git a/test/runtime/samples/raw-anchor-next-sibling/_config.js b/test/runtime/samples/raw-anchor-next-sibling/_config.js index 26046ea6f..dc6ad98e2 100644 --- a/test/runtime/samples/raw-anchor-next-sibling/_config.js +++ b/test/runtime/samples/raw-anchor-next-sibling/_config.js @@ -1,14 +1,12 @@ export default { - data: { + props: { raw: `foo` }, - test ( assert, component, target ) { + test({ assert, component, target }) { const span = target.querySelector('span'); assert.equal(span.previousSibling.nodeName, 'BR'); - component.set({ - raw: `bar` - }); + component.raw = `bar`; } }; diff --git a/test/runtime/samples/raw-anchor-previous-sibling/_config.js b/test/runtime/samples/raw-anchor-previous-sibling/_config.js index 26046ea6f..dc6ad98e2 100644 --- a/test/runtime/samples/raw-anchor-previous-sibling/_config.js +++ b/test/runtime/samples/raw-anchor-previous-sibling/_config.js @@ -1,14 +1,12 @@ export default { - data: { + props: { raw: `foo` }, - test ( assert, component, target ) { + test({ assert, component, target }) { const span = target.querySelector('span'); assert.equal(span.previousSibling.nodeName, 'BR'); - component.set({ - raw: `bar` - }); + component.raw = `bar`; } }; diff --git a/test/runtime/samples/raw-mustaches-preserved/_config.js b/test/runtime/samples/raw-mustaches-preserved/_config.js index d613f852c..66b829f7c 100644 --- a/test/runtime/samples/raw-mustaches-preserved/_config.js +++ b/test/runtime/samples/raw-mustaches-preserved/_config.js @@ -1,19 +1,17 @@ export default { - 'skip-ssr': true, + skip_if_ssr: true, - data: { + props: { raw: '

    does not change

    ' }, html: `

    does not change

    `, - test ( assert, component, target ) { - const p = target.querySelector( 'p' ); + test({ assert, component, target }) { + const p = target.querySelector('p'); - component.set({ raw: '

    does not change

    ' }); - assert.equal( target.innerHTML, `

    does not change

    ` ); - assert.strictEqual( target.querySelector( 'p' ), p ); - - component.destroy(); + component.raw = '

    does not change

    '; + assert.equal(target.innerHTML, `

    does not change

    `); + assert.strictEqual(target.querySelector('p'), p); } }; diff --git a/test/runtime/samples/raw-mustaches/_config.js b/test/runtime/samples/raw-mustaches/_config.js index 22269ea97..c81e2c5cd 100644 --- a/test/runtime/samples/raw-mustaches/_config.js +++ b/test/runtime/samples/raw-mustaches/_config.js @@ -1,20 +1,20 @@ const ns = ''; export default { - 'skip-ssr': true, + skip_if_ssr: true, - data: { + props: { raw: 'raw html!!!\\o/' }, html: `before${ns}raw html!!!\\o/${ns}after`, - test ( assert, component, target ) { - component.set({ raw: '' }); - assert.equal( target.innerHTML, `before${ns}${ns}after` ); - component.set({ raw: 'how about unclosed elements?' }); - assert.equal( target.innerHTML, `before${ns}how about unclosed elements?${ns}after` ); - component.destroy(); - assert.equal( target.innerHTML, '' ); + test({ assert, component, target }) { + component.raw = ''; + assert.equal(target.innerHTML, `before${ns}${ns}after`); + component.raw = 'how about unclosed elements?'; + assert.equal(target.innerHTML, `before${ns}how about unclosed elements?${ns}after`); + component.$destroy(); + assert.equal(target.innerHTML, ''); } }; diff --git a/test/runtime/samples/reactive-function/_config.js b/test/runtime/samples/reactive-function/_config.js new file mode 100644 index 000000000..a29c022b5 --- /dev/null +++ b/test/runtime/samples/reactive-function/_config.js @@ -0,0 +1,16 @@ +export default { + html: '

    50

    ', + + test({ assert, component, target }) { + console.group('range [50,100]'); + component.range = [50, 100]; + assert.htmlEqual(target.innerHTML, '

    75

    '); + console.groupEnd(); + + component.range = [50, 60]; + assert.htmlEqual(target.innerHTML, '

    55

    '); + + component.x = 8; + assert.htmlEqual(target.innerHTML, '

    58

    '); + } +}; diff --git a/test/runtime/samples/reactive-function/main.html b/test/runtime/samples/reactive-function/main.html new file mode 100644 index 000000000..e6f7465b7 --- /dev/null +++ b/test/runtime/samples/reactive-function/main.html @@ -0,0 +1,14 @@ + + +

    {scale(x)}

    \ No newline at end of file diff --git a/test/runtime/samples/computed-values-deconflicted/_config.js b/test/runtime/samples/reactive-values-deconflicted/_config.js similarity index 64% rename from test/runtime/samples/computed-values-deconflicted/_config.js rename to test/runtime/samples/reactive-values-deconflicted/_config.js index 180aad8fe..c9ab700bd 100644 --- a/test/runtime/samples/computed-values-deconflicted/_config.js +++ b/test/runtime/samples/reactive-values-deconflicted/_config.js @@ -1,8 +1,8 @@ export default { html: 'waiting', - test(assert, component, target) { - component.set({ x: 'ready' }); + test({ assert, component, target }) { + component.x = 'ready'; assert.htmlEqual(target.innerHTML, ` ready `); diff --git a/test/runtime/samples/reactive-values-deconflicted/main.html b/test/runtime/samples/reactive-values-deconflicted/main.html new file mode 100644 index 000000000..b7a6a6f85 --- /dev/null +++ b/test/runtime/samples/reactive-values-deconflicted/main.html @@ -0,0 +1,8 @@ + + +{state} \ No newline at end of file diff --git a/test/runtime/samples/reactive-values-function-dependency/_config.js b/test/runtime/samples/reactive-values-function-dependency/_config.js new file mode 100644 index 000000000..b9ece1f68 --- /dev/null +++ b/test/runtime/samples/reactive-values-function-dependency/_config.js @@ -0,0 +1,9 @@ +export default { + html: '

    2

    ', + + test({ assert, component, target }) { + component.y = 2; + assert.equal(component.x, 4); + assert.equal(target.innerHTML, '

    4

    '); + } +}; diff --git a/test/runtime/samples/reactive-values-function-dependency/main.html b/test/runtime/samples/reactive-values-function-dependency/main.html new file mode 100644 index 000000000..3a8dc8326 --- /dev/null +++ b/test/runtime/samples/reactive-values-function-dependency/main.html @@ -0,0 +1,21 @@ + + +

    {x}

    \ No newline at end of file diff --git a/test/runtime/samples/reactive-values-second-order/_config.js b/test/runtime/samples/reactive-values-second-order/_config.js new file mode 100644 index 000000000..c1dee87e2 --- /dev/null +++ b/test/runtime/samples/reactive-values-second-order/_config.js @@ -0,0 +1,8 @@ +export default { + test({ assert, component, target }) { + assert.equal(component.qux, 2); + + component.foo = 2; + assert.equal(component.qux, 4); + } +}; diff --git a/test/runtime/samples/reactive-values-second-order/main.html b/test/runtime/samples/reactive-values-second-order/main.html new file mode 100644 index 000000000..1d0e840c0 --- /dev/null +++ b/test/runtime/samples/reactive-values-second-order/main.html @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/test/runtime/samples/reactive-values-self-dependency/_config.js b/test/runtime/samples/reactive-values-self-dependency/_config.js new file mode 100644 index 000000000..5a3d1978f --- /dev/null +++ b/test/runtime/samples/reactive-values-self-dependency/_config.js @@ -0,0 +1,15 @@ +export default { + html: ` +

    1 + 2 = 3

    +

    Times calculated: 1

    + `, + + test({ assert, component, target }) { + component.a = 3; + + assert.htmlEqual(target.innerHTML, ` +

    3 + 2 = 5

    +

    Times calculated: 2

    + `); + } +}; diff --git a/test/runtime/samples/reactive-values-self-dependency/main.html b/test/runtime/samples/reactive-values-self-dependency/main.html new file mode 100644 index 000000000..938a1ddd7 --- /dev/null +++ b/test/runtime/samples/reactive-values-self-dependency/main.html @@ -0,0 +1,15 @@ + + +

    {a} + {b} = {c}

    +

    Times calculated: {count}

    \ No newline at end of file diff --git a/test/runtime/samples/reactive-values/_config.js b/test/runtime/samples/reactive-values/_config.js new file mode 100644 index 000000000..345166046 --- /dev/null +++ b/test/runtime/samples/reactive-values/_config.js @@ -0,0 +1,16 @@ +export default { + html: ` +

    1 + 2 = 3

    +

    3 * 3 = 9

    + `, + + test({ assert, component, target }) { + component.a = 3; + assert.equal(component.c, 5); + assert.equal(component.cSquared, 25); + assert.htmlEqual(target.innerHTML, ` +

    3 + 2 = 5

    +

    5 * 5 = 25

    + `); + } +}; diff --git a/test/runtime/samples/reactive-values/main.html b/test/runtime/samples/reactive-values/main.html new file mode 100644 index 000000000..61d2d2004 --- /dev/null +++ b/test/runtime/samples/reactive-values/main.html @@ -0,0 +1,12 @@ + + +

    {a} + {b} = {c}

    +

    {c} * {c} = {cSquared}

    \ No newline at end of file diff --git a/test/runtime/samples/refs-no-innerhtml/_config.js b/test/runtime/samples/refs-no-innerhtml/_config.js index a1e5ddd7f..c69386994 100644 --- a/test/runtime/samples/refs-no-innerhtml/_config.js +++ b/test/runtime/samples/refs-no-innerhtml/_config.js @@ -1,7 +1,8 @@ export default { html: '
    ', - test ( assert, component, target ) { - const canvas = target.querySelector( 'canvas' ); - assert.equal( canvas, component.refs.foo ); + + test({ assert, component, target }) { + const canvas = target.querySelector('canvas'); + assert.equal(canvas, component.foo); } }; diff --git a/test/runtime/samples/refs-no-innerhtml/main.html b/test/runtime/samples/refs-no-innerhtml/main.html index 35d9d3a54..e2f7740f2 100644 --- a/test/runtime/samples/refs-no-innerhtml/main.html +++ b/test/runtime/samples/refs-no-innerhtml/main.html @@ -1 +1,5 @@ + +
    diff --git a/test/runtime/samples/refs-unset/_config.js b/test/runtime/samples/refs-unset/_config.js index dd69303ec..d940af30b 100644 --- a/test/runtime/samples/refs-unset/_config.js +++ b/test/runtime/samples/refs-unset/_config.js @@ -1,23 +1,23 @@ export default { - data: { + props: { x: true }, html: '', - test ( assert, component, target ) { - let canvas = target.querySelector( 'canvas' ); - assert.equal( canvas, component.refs.foo ); - assert.equal( canvas.getAttribute( 'data-x' ), 'true' ); + test({ assert, component, target }) { + let canvas = target.querySelector('canvas'); + assert.equal(canvas, component.foo); + assert.equal(canvas.getAttribute('data-x'), 'true'); - component.set({ x: false }); - canvas = target.querySelector( 'canvas' ); - assert.equal( canvas, component.refs.foo ); - assert.equal( canvas.getAttribute( 'data-x' ), 'false' ); + component.x = false; + canvas = target.querySelector('canvas'); + assert.equal(canvas, component.foo); + assert.equal(canvas.getAttribute('data-x'), 'false'); - component.set({ x: true }); - canvas = target.querySelector( 'canvas' ); - assert.equal( canvas, component.refs.foo ); - assert.equal( canvas.getAttribute( 'data-x' ), 'true' ); + component.x = true; + canvas = target.querySelector('canvas'); + assert.equal(canvas, component.foo); + assert.equal(canvas.getAttribute('data-x'), 'true'); } }; diff --git a/test/runtime/samples/refs-unset/main.html b/test/runtime/samples/refs-unset/main.html index 6a18aa6be..6dc6d654d 100644 --- a/test/runtime/samples/refs-unset/main.html +++ b/test/runtime/samples/refs-unset/main.html @@ -1,3 +1,8 @@ + + {#if x} {:else} diff --git a/test/runtime/samples/refs/_config.js b/test/runtime/samples/refs/_config.js index e8070770b..5b5ca9d96 100644 --- a/test/runtime/samples/refs/_config.js +++ b/test/runtime/samples/refs/_config.js @@ -1,7 +1,8 @@ export default { html: '', - test ( assert, component, target ) { - const canvas = target.querySelector( 'canvas' ); - assert.equal( canvas, component.refs.foo ); + + test({ assert, component, target }) { + const canvas = target.querySelector('canvas'); + assert.equal(canvas, component.foo); } }; diff --git a/test/runtime/samples/refs/main.html b/test/runtime/samples/refs/main.html index e5594a4af..68b013377 100644 --- a/test/runtime/samples/refs/main.html +++ b/test/runtime/samples/refs/main.html @@ -1 +1,5 @@ + + diff --git a/test/runtime/samples/select-bind-array/_config.js b/test/runtime/samples/select-bind-array/_config.js index 0cbe3010f..317196e8c 100644 --- a/test/runtime/samples/select-bind-array/_config.js +++ b/test/runtime/samples/select-bind-array/_config.js @@ -1,20 +1,20 @@ const items = [ { id: 'a' }, { id: 'b' } ]; export default { - 'skip-ssr': true, + skip_if_ssr: true, - data: { + props: { foo: 'b', items }, - test ( assert, component, target ) { + test({ assert, component, target }) { const options = target.querySelectorAll( 'option' ); assert.equal( options[0].selected, false ); assert.equal( options[1].selected, true ); - component.set( { foo: items[0].id } ); + component.foo = items[0].id; assert.equal( options[0].selected, true ); assert.equal( options[1].selected, false ); diff --git a/test/runtime/samples/select-bind-array/main.html b/test/runtime/samples/select-bind-array/main.html index 67c1dfdb9..a863eec89 100644 --- a/test/runtime/samples/select-bind-array/main.html +++ b/test/runtime/samples/select-bind-array/main.html @@ -1,4 +1,4 @@ - {#each items as item} {/each} diff --git a/test/runtime/samples/select-bind-in-array/_config.js b/test/runtime/samples/select-bind-in-array/_config.js index 32b522982..d104743d4 100644 --- a/test/runtime/samples/select-bind-in-array/_config.js +++ b/test/runtime/samples/select-bind-in-array/_config.js @@ -1,14 +1,14 @@ const items = [ { id: 'a' }, { id: 'b' } ]; export default { - 'skip-ssr': true, + skip_if_ssr: true, - data: { + props: { items }, - test ( assert, component, target ) { - const items = component.get().items; + test({ assert, component, target }) { + const items = component.items; assert.equal( items[0].id, 'a' ); assert.equal( items[1].id, 'b' ); diff --git a/test/runtime/samples/select-bind-in-array/main.html b/test/runtime/samples/select-bind-in-array/main.html index 9a4d1e82c..51f33c761 100644 --- a/test/runtime/samples/select-bind-in-array/main.html +++ b/test/runtime/samples/select-bind-in-array/main.html @@ -1,5 +1,5 @@ {#each items as item} - diff --git a/test/runtime/samples/select-change-handler/_config.js b/test/runtime/samples/select-change-handler/_config.js index 8ea4d66e8..9620ca5ab 100644 --- a/test/runtime/samples/select-change-handler/_config.js +++ b/test/runtime/samples/select-change-handler/_config.js @@ -1,22 +1,20 @@ export default { - data: { + props: { options: [ { id: 'a' }, { id: 'b' }, { id: 'c' } ], selected: 'b' }, - test ( assert, component, target, window ) { - const select = target.querySelector( 'select' ); - assert.equal( select.value, 'b' ); + test({ assert, component, target, window }) { + const select = target.querySelector('select'); + assert.equal(select.value, 'b'); - const event = new window.Event( 'change' ); + const event = new window.Event('change'); select.value = 'c'; - select.dispatchEvent( event ); + select.dispatchEvent(event); - assert.equal( select.value, 'c' ); - assert.equal( component.get().lastChangedTo, 'c' ); - assert.equal( component.get().selected, 'c' ); - - component.destroy(); + assert.equal(select.value, 'c'); + assert.equal(component.lastChangedTo, 'c'); + assert.equal(component.selected, 'c'); } }; diff --git a/test/runtime/samples/select-change-handler/main.html b/test/runtime/samples/select-change-handler/main.html index 13d9bd75a..436752176 100644 --- a/test/runtime/samples/select-change-handler/main.html +++ b/test/runtime/samples/select-change-handler/main.html @@ -1,15 +1,15 @@ - {#each options as option} {/each} - - diff --git a/test/runtime/samples/select-no-whitespace/_config.js b/test/runtime/samples/select-no-whitespace/_config.js index dabd1a540..738852784 100644 --- a/test/runtime/samples/select-no-whitespace/_config.js +++ b/test/runtime/samples/select-no-whitespace/_config.js @@ -1,5 +1,5 @@ export default { - test ( assert, component, target ) { + test({ assert, component, target }) { const select = target.querySelector( 'select' ); assert.equal( select.childNodes.length, 3 ); } diff --git a/test/runtime/samples/select-one-way-bind-object/_config.js b/test/runtime/samples/select-one-way-bind-object/_config.js index 0d7ddacca..bc6ab286b 100644 --- a/test/runtime/samples/select-one-way-bind-object/_config.js +++ b/test/runtime/samples/select-one-way-bind-object/_config.js @@ -1,20 +1,20 @@ const items = [ {}, {} ]; export default { - 'skip-ssr': true, + skip_if_ssr: true, - data: { + props: { foo: items[0], items }, - test ( assert, component, target ) { + test({ assert, component, target }) { const options = target.querySelectorAll( 'option' ); assert.equal( options[0].selected, true ); assert.equal( options[1].selected, false ); - component.set( { foo: items[1] } ); + component.foo = items[1]; assert.equal( options[0].selected, false ); assert.equal( options[1].selected, true ); diff --git a/test/runtime/samples/select-one-way-bind/_config.js b/test/runtime/samples/select-one-way-bind/_config.js index 7fd1f668f..94288e5e6 100644 --- a/test/runtime/samples/select-one-way-bind/_config.js +++ b/test/runtime/samples/select-one-way-bind/_config.js @@ -1,17 +1,17 @@ export default { - 'skip-ssr': true, + skip_if_ssr: true, - data: { + props: { foo: 'a' }, - test ( assert, component, target ) { + test({ assert, component, target }) { const options = target.querySelectorAll( 'option' ); assert.equal( options[0].selected, true ); assert.equal( options[1].selected, false ); - component.set( { foo: 'b' } ); + component.foo = 'b'; assert.equal( options[0].selected, false ); assert.equal( options[1].selected, true ); diff --git a/test/runtime/samples/select-props/_config.js b/test/runtime/samples/select-props/_config.js index 0f93196cf..640fee0ef 100644 --- a/test/runtime/samples/select-props/_config.js +++ b/test/runtime/samples/select-props/_config.js @@ -1,15 +1,15 @@ export default { - test ( assert, component, target, window ) { - const selects = document.querySelectorAll( 'select' ); + test({ assert, component, target, window }) { + const selects = document.querySelectorAll('select'); - const event1 = new window.Event( 'change' ); + const event1 = new window.Event('change'); selects[0].value = 'b'; selects[0].dispatchEvent(event1); - const event2 = new window.Event( 'change' ); + const event2 = new window.Event('change'); selects[1].value = 'b'; selects[1].dispatchEvent(event2); - assert.deepEqual( component.get().log, [ 1, 2 ] ); + assert.deepEqual(component.log, [1, 2]); } }; diff --git a/test/runtime/samples/select-props/main.html b/test/runtime/samples/select-props/main.html index 9886a8b7b..ff3855f08 100644 --- a/test/runtime/samples/select-props/main.html +++ b/test/runtime/samples/select-props/main.html @@ -1,19 +1,15 @@ + + {#each foo as bar} - {/each} - - diff --git a/test/runtime/samples/select/_config.js b/test/runtime/samples/select/_config.js index 8fffd0d25..eb400a3ca 100644 --- a/test/runtime/samples/select/_config.js +++ b/test/runtime/samples/select/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { item: { name: 'One', key: 'a' @@ -14,8 +14,8 @@ export default { `, - test ( assert, component, target ) { - assert.htmlEqual( target.innerHTML,` + test({ assert, component, target }) { + assert.htmlEqual(target.innerHTML,` `); - assert.equal( target.querySelector( 'select' ).value, 'a' ); + assert.equal(target.querySelector('select').value, 'a'); - component.destroy(); - assert.htmlEqual( target.innerHTML, '' ); + component.$destroy(); + assert.htmlEqual(target.innerHTML, ''); } }; diff --git a/test/runtime/samples/self-reference-tree/_config.js b/test/runtime/samples/self-reference-tree/_config.js index 5613b2626..581f03ead 100644 --- a/test/runtime/samples/self-reference-tree/_config.js +++ b/test/runtime/samples/self-reference-tree/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { file: { name: '/', type: 'folder', diff --git a/test/runtime/samples/self-reference/_config.js b/test/runtime/samples/self-reference/_config.js index dabb46783..69be606bb 100644 --- a/test/runtime/samples/self-reference/_config.js +++ b/test/runtime/samples/self-reference/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { depth: 5 }, diff --git a/test/runtime/samples/set-after-destroy/_config.js b/test/runtime/samples/set-after-destroy/_config.js index 1f8fb08f7..9d7932954 100644 --- a/test/runtime/samples/set-after-destroy/_config.js +++ b/test/runtime/samples/set-after-destroy/_config.js @@ -1,10 +1,10 @@ export default { - data: { + props: { x: 1 }, - test(assert, component) { - component.destroy(); - component.set({ x: 2 }); + test({ assert, component }) { + component.$destroy(); + component.x = 2; } }; \ No newline at end of file diff --git a/test/runtime/samples/set-clones-input/_config.js b/test/runtime/samples/set-clones-input/_config.js deleted file mode 100644 index 051ad0c42..000000000 --- a/test/runtime/samples/set-clones-input/_config.js +++ /dev/null @@ -1,16 +0,0 @@ -export default { - compileOptions: { - dev: true - }, - - data: { - a: 42 - }, - - test ( assert, component ) { - const obj = { a: 1 }; - component.set( obj ); - component.set( obj ); // will fail if the object is not cloned - component.destroy(); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/set-clones-input/main.html b/test/runtime/samples/set-clones-input/main.html deleted file mode 100644 index b5291a079..000000000 --- a/test/runtime/samples/set-clones-input/main.html +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/set-in-oncreate/_config.js b/test/runtime/samples/set-in-oncreate/_config.js index 307b5cb86..6f54649e1 100644 --- a/test/runtime/samples/set-in-oncreate/_config.js +++ b/test/runtime/samples/set-in-oncreate/_config.js @@ -1,5 +1,5 @@ export default { - 'skip-ssr': true, // uses oncreate + skip_if_ssr: true, // uses oncreate html: '

    2

    ' }; diff --git a/test/runtime/samples/set-in-oncreate/main.html b/test/runtime/samples/set-in-oncreate/main.html index 77633574f..66463c030 100644 --- a/test/runtime/samples/set-in-oncreate/main.html +++ b/test/runtime/samples/set-in-oncreate/main.html @@ -1,13 +1,11 @@ -

    {foo}

    - + +

    {foo}

    diff --git a/test/runtime/samples/set-in-ondestroy/_config.js b/test/runtime/samples/set-in-ondestroy/_config.js deleted file mode 100644 index 9923ebeb5..000000000 --- a/test/runtime/samples/set-in-ondestroy/_config.js +++ /dev/null @@ -1,26 +0,0 @@ -export default { - 'skip-ssr': true, - - data: { - foo: 1 - }, - - test(assert, component) { - const values = []; - let valueOnDestroy; - - component.on('destroy', () => { - component.set({ foo: 2 }); - valueOnDestroy = component.get().foo; - }); - - component.on('state', ({ current }) => { - values.push(current.foo); - }); - - component.destroy(); - - assert.deepEqual(values, [2]); - assert.equal(valueOnDestroy, 2); - } -}; diff --git a/test/runtime/samples/set-in-ondestroy/main.html b/test/runtime/samples/set-in-ondestroy/main.html deleted file mode 100644 index c6cac6926..000000000 --- a/test/runtime/samples/set-in-ondestroy/main.html +++ /dev/null @@ -1 +0,0 @@ -empty diff --git a/test/runtime/samples/set-in-onstate-dedupes-renders/Widget.html b/test/runtime/samples/set-in-onstate-dedupes-renders/Widget.html index 1d9c77e30..d72b4d48e 100644 --- a/test/runtime/samples/set-in-onstate-dedupes-renders/Widget.html +++ b/test/runtime/samples/set-in-onstate-dedupes-renders/Widget.html @@ -1,13 +1,14 @@ -
    {foo.x}
    - \ No newline at end of file + }); + + +
    {foo.x}
    \ No newline at end of file diff --git a/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js b/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js index 776bfefc5..1d572f52f 100644 --- a/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js +++ b/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js @@ -1,8 +1,7 @@ export default { skip: true, // nice-to-have – tricky though, so skipping for now - test ( assert, component ) { - component.set({ foo: { x: 2 } }); - component.destroy(); + test({ assert, component }) { + component.foo = { x: 2 }; } }; diff --git a/test/runtime/samples/set-in-onstate-dedupes-renders/main.html b/test/runtime/samples/set-in-onstate-dedupes-renders/main.html index 6813463ec..d6fe905c3 100644 --- a/test/runtime/samples/set-in-onstate-dedupes-renders/main.html +++ b/test/runtime/samples/set-in-onstate-dedupes-renders/main.html @@ -1,24 +1,14 @@ - - + + diff --git a/test/runtime/samples/set-in-onstate/_config.js b/test/runtime/samples/set-in-onstate/_config.js index 5c7c3d213..f54527f3c 100644 --- a/test/runtime/samples/set-in-onstate/_config.js +++ b/test/runtime/samples/set-in-onstate/_config.js @@ -1,16 +1,16 @@ export default { - 'skip-ssr': true, // uses oncreate + skip_if_ssr: true, // uses oncreate html: `

    1

    2

    `, - test ( assert, component, target ) { - component.set({ foo: 2 }); - assert.htmlEqual( target.innerHTML, ` + test({ assert, component, target }) { + component.foo = 2; + assert.htmlEqual(target.innerHTML, `

    2

    4

    - ` ); + `); } }; diff --git a/test/runtime/samples/set-in-onstate/main.html b/test/runtime/samples/set-in-onstate/main.html index a5776566e..9009324f7 100644 --- a/test/runtime/samples/set-in-onstate/main.html +++ b/test/runtime/samples/set-in-onstate/main.html @@ -1,16 +1,13 @@ -

    {foo}

    -

    {bar}

    - + +

    {foo}

    +

    {bar}

    diff --git a/test/runtime/samples/set-mutated-data/_config.js b/test/runtime/samples/set-mutated-data/_config.js deleted file mode 100644 index bae3fab68..000000000 --- a/test/runtime/samples/set-mutated-data/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -const data = { foo: 0 }; - -export default { - data, - - html: '0', - - test(assert, component, target) { - data.foo = 42; - component.set(data); - - assert.htmlEqual(target.innerHTML, '42'); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/set-mutated-data/main.html b/test/runtime/samples/set-mutated-data/main.html deleted file mode 100644 index e076ac55f..000000000 --- a/test/runtime/samples/set-mutated-data/main.html +++ /dev/null @@ -1 +0,0 @@ -{foo} \ No newline at end of file diff --git a/test/runtime/samples/set-null-text-node/_config.js b/test/runtime/samples/set-null-text-node/_config.js index f0a7fd1df..6bc775f3b 100644 --- a/test/runtime/samples/set-null-text-node/_config.js +++ b/test/runtime/samples/set-null-text-node/_config.js @@ -1,13 +1,13 @@ export default { - data: { foo: null }, + props: { foo: null }, html: 'foo is null', - test(assert, component, target) { - component.set({ foo: 42 }); + test({ assert, component, target }) { + component.foo = 42; assert.htmlEqual(target.innerHTML, 'foo is 42'); - component.set({ foo: null }); + component.foo = null; assert.htmlEqual(target.innerHTML, 'foo is null'); } }; \ No newline at end of file diff --git a/test/runtime/samples/set-prevents-loop/main.html b/test/runtime/samples/set-prevents-loop/main.html index 685bfeaa1..890e81db7 100644 --- a/test/runtime/samples/set-prevents-loop/main.html +++ b/test/runtime/samples/set-prevents-loop/main.html @@ -1,20 +1,12 @@ + + {#if visible} {:else} {/if} - - diff --git a/test/runtime/samples/set-undefined-attr/main.html b/test/runtime/samples/set-undefined-attr/main.html index 09e63ca45..8191acbef 100644 --- a/test/runtime/samples/set-undefined-attr/main.html +++ b/test/runtime/samples/set-undefined-attr/main.html @@ -1,14 +1,12 @@ -
    - + +
    diff --git a/test/runtime/samples/setup/_config.js b/test/runtime/samples/setup/_config.js deleted file mode 100644 index 47b0cf332..000000000 --- a/test/runtime/samples/setup/_config.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - test(assert, component) { - assert.ok(component.constructor.FOO); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/setup/main.html b/test/runtime/samples/setup/main.html deleted file mode 100644 index a1192323c..000000000 --- a/test/runtime/samples/setup/main.html +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/sigil-component-attribute/_config.js b/test/runtime/samples/sigil-component-attribute/_config.js index 079bf3e9a..066505cfa 100644 --- a/test/runtime/samples/sigil-component-attribute/_config.js +++ b/test/runtime/samples/sigil-component-attribute/_config.js @@ -1,4 +1,4 @@ export default { - data: { foo: 'foo' }, + props: { foo: 'foo' }, html: `
    foo @ foo # foo
    `, }; diff --git a/test/runtime/samples/sigil-component-attribute/main.html b/test/runtime/samples/sigil-component-attribute/main.html index a5abcd92e..93ff1b8fe 100644 --- a/test/runtime/samples/sigil-component-attribute/main.html +++ b/test/runtime/samples/sigil-component-attribute/main.html @@ -1,6 +1,6 @@ - - + + diff --git a/test/runtime/samples/spread-component-dynamic-undefined/_config.js b/test/runtime/samples/spread-component-dynamic-undefined/_config.js index 366750870..09e5f87c1 100644 --- a/test/runtime/samples/spread-component-dynamic-undefined/_config.js +++ b/test/runtime/samples/spread-component-dynamic-undefined/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { props: { a: 1, }, @@ -7,12 +7,10 @@ export default { html: ``, - test(assert, component, target) { - component.set({ - props: { - a: 2, - }, - }); + test({ assert, component, target }) { + component.props = { + a: 2, + }; assert.htmlEqual(target.innerHTML, ``); }, diff --git a/test/runtime/samples/spread-component-dynamic/_config.js b/test/runtime/samples/spread-component-dynamic/_config.js index 9637d2257..a6bf952ae 100644 --- a/test/runtime/samples/spread-component-dynamic/_config.js +++ b/test/runtime/samples/spread-component-dynamic/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { props: { a: 1, }, @@ -9,12 +9,10 @@ export default {

    a: 1

    `, - test(assert, component, target) { - component.set({ - props: { - a: 2, - }, - }); + test({ assert, component, target }) { + component.props = { + a: 2, + }; assert.htmlEqual(target.innerHTML, `

    a: 2

    `); }, diff --git a/test/runtime/samples/spread-component-dynamic/main.html b/test/runtime/samples/spread-component-dynamic/main.html index 7b89cf5a1..4b83ee530 100644 --- a/test/runtime/samples/spread-component-dynamic/main.html +++ b/test/runtime/samples/spread-component-dynamic/main.html @@ -1,13 +1,7 @@ - - \ No newline at end of file + export let props; + + + \ No newline at end of file diff --git a/test/runtime/samples/spread-component-multiple-dependencies/_config.js b/test/runtime/samples/spread-component-multiple-dependencies/_config.js index 42b0c5693..bc05f3113 100644 --- a/test/runtime/samples/spread-component-multiple-dependencies/_config.js +++ b/test/runtime/samples/spread-component-multiple-dependencies/_config.js @@ -1,7 +1,7 @@ export default { html: `b baz`, - test(assert, component, target) { - component.set({ foo: true }); + test({ assert, component, target }) { + component.foo = true; assert.htmlEqual( target.innerHTML, `a baz` diff --git a/test/runtime/samples/spread-component-multiple-dependencies/main.html b/test/runtime/samples/spread-component-multiple-dependencies/main.html index dedfa2747..79ed1d297 100644 --- a/test/runtime/samples/spread-component-multiple-dependencies/main.html +++ b/test/runtime/samples/spread-component-multiple-dependencies/main.html @@ -1,13 +1,10 @@ - - + + diff --git a/test/runtime/samples/spread-component-with-bind/_config.js b/test/runtime/samples/spread-component-with-bind/_config.js index 06476712a..96eb3c947 100644 --- a/test/runtime/samples/spread-component-with-bind/_config.js +++ b/test/runtime/samples/spread-component-with-bind/_config.js @@ -9,11 +9,11 @@ export default { `, - test (assert, component, target, window) { + async test({ assert, component, target, window }) { const input = target.querySelector('input'); input.value = 'bar'; - input.dispatchEvent(new window.Event('input')); + await input.dispatchEvent(new window.Event('input')); assert.htmlEqual(target.innerHTML, `

    bar

    diff --git a/test/runtime/samples/spread-component-with-bind/main.html b/test/runtime/samples/spread-component-with-bind/main.html index 97ad6f7e4..e4c81624f 100644 --- a/test/runtime/samples/spread-component-with-bind/main.html +++ b/test/runtime/samples/spread-component-with-bind/main.html @@ -1,15 +1,8 @@ - - \ No newline at end of file + export let props = {}; + export let x = 'foo'; + + + \ No newline at end of file diff --git a/test/runtime/samples/spread-component/_config.js b/test/runtime/samples/spread-component/_config.js index 06acc4906..b2cf9d704 100644 --- a/test/runtime/samples/spread-component/_config.js +++ b/test/runtime/samples/spread-component/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { props: { foo: 'lol', baz: 40 + 2, @@ -8,18 +8,26 @@ export default { } }, - html: `

    foo: lol

    \n

    baz: 42 (number)

    \n

    qux: named

    \n

    quux: core

    `, + html: ` +

    foo: lol

    +

    baz: 42 (number)

    +

    qux: named

    +

    quux: core

    + `, - test ( assert, component, target ) { - component.set({ - props: { - foo: 'wut', - baz: 40 + 3, - qux: `this is a ${'rather boring'} string`, - quux: 'heart' - } - }); + test({ assert, component, target }) { + component.props = { + foo: 'wut', + baz: 40 + 3, + qux: `this is a ${'rather boring'} string`, + quux: 'heart' + }; - assert.equal( target.innerHTML, `

    foo: wut

    \n

    baz: 43 (number)

    \n

    qux: named

    \n

    quux: heart

    ` ); + assert.htmlEqual(target.innerHTML, ` +

    foo: wut

    +

    baz: 43 (number)

    +

    qux: named

    +

    quux: heart

    + `); } }; diff --git a/test/runtime/samples/spread-component/main.html b/test/runtime/samples/spread-component/main.html index ea7e0a812..351a7964e 100644 --- a/test/runtime/samples/spread-component/main.html +++ b/test/runtime/samples/spread-component/main.html @@ -1,11 +1,9 @@ -
    - -
    - + +
    + +
    diff --git a/test/runtime/samples/spread-each-component/_config.js b/test/runtime/samples/spread-each-component/_config.js index c5fcfb06b..bc4d8ee7a 100644 --- a/test/runtime/samples/spread-each-component/_config.js +++ b/test/runtime/samples/spread-each-component/_config.js @@ -4,19 +4,17 @@ export default {
    `, - data: { + props: { things: [ { a: 1, b: 2 }, { a: 3, b: 4 } ] }, - test(assert, component, target) { - const { things } = component.get(); + test({ assert, component, target }) { + const { things } = component; - component.set({ - things: things.reverse() - }); + component.things = things.reverse(); assert.htmlEqual(target.innerHTML, `
    diff --git a/test/runtime/samples/spread-each-component/main.html b/test/runtime/samples/spread-each-component/main.html index 0e1e9ce1d..212486116 100644 --- a/test/runtime/samples/spread-each-component/main.html +++ b/test/runtime/samples/spread-each-component/main.html @@ -1,11 +1,9 @@ -{#each things as thing} - -{/each} - \ No newline at end of file + export let things; + + +{#each things as thing} + +{/each} \ No newline at end of file diff --git a/test/runtime/samples/spread-each-element/_config.js b/test/runtime/samples/spread-each-element/_config.js index 913a7cc86..5dbd82a89 100644 --- a/test/runtime/samples/spread-each-element/_config.js +++ b/test/runtime/samples/spread-each-element/_config.js @@ -4,19 +4,17 @@ export default {
    `, - data: { + props: { things: [ { 'data-a': 1, 'data-b': 2 }, { 'data-c': 3, 'data-d': 4 } ] }, - test(assert, component, target) { - const { things } = component.get(); + test({ assert, component, target }) { + const { things } = component; - component.set({ - things: things.reverse() - }); + component.things = things.reverse(); assert.htmlEqual(target.innerHTML, `
    diff --git a/test/runtime/samples/spread-element-boolean/_config.js b/test/runtime/samples/spread-element-boolean/_config.js index 83a1590f2..3ee277eec 100644 --- a/test/runtime/samples/spread-element-boolean/_config.js +++ b/test/runtime/samples/spread-element-boolean/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { props: { disabled: true } @@ -9,14 +9,12 @@ export default { `, - test(assert, component, target) { + test({ assert, component, target }) { const button = target.querySelector('button'); assert.ok(button.disabled); - component.set({ - props: { disabled: false } - }); + component.props = { disabled: false }; assert.htmlEqual( target.innerHTML, diff --git a/test/runtime/samples/spread-element-input/_config.js b/test/runtime/samples/spread-element-input/_config.js index 26f6d9cec..80685b9d2 100644 --- a/test/runtime/samples/spread-element-input/_config.js +++ b/test/runtime/samples/spread-element-input/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { props: { 'data-foo': 'bar' } diff --git a/test/runtime/samples/spread-element-multiple-dependencies/_config.js b/test/runtime/samples/spread-element-multiple-dependencies/_config.js index e8f3d68e3..69ef1f8eb 100644 --- a/test/runtime/samples/spread-element-multiple-dependencies/_config.js +++ b/test/runtime/samples/spread-element-multiple-dependencies/_config.js @@ -1,7 +1,7 @@ export default { html: `
    `, - test(assert, component, target) { - component.set({ foo: true }); + test({ assert, component, target }) { + component.foo = true; assert.htmlEqual( target.innerHTML, `
    ` diff --git a/test/runtime/samples/spread-element-multiple-dependencies/main.html b/test/runtime/samples/spread-element-multiple-dependencies/main.html index f6f436714..a1ed0ba64 100644 --- a/test/runtime/samples/spread-element-multiple-dependencies/main.html +++ b/test/runtime/samples/spread-element-multiple-dependencies/main.html @@ -1,12 +1,8 @@ -
    - + +
    diff --git a/test/runtime/samples/spread-element-multiple/_config.js b/test/runtime/samples/spread-element-multiple/_config.js index 4a1aae2d8..641f74d72 100644 --- a/test/runtime/samples/spread-element-multiple/_config.js +++ b/test/runtime/samples/spread-element-multiple/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { a: { 'data-one': 1, 'data-two': 2, @@ -14,16 +14,14 @@ export default {
    test
    `, - test(assert, component, target) { - component.set({ - a: { - 'data-one': 10 - }, - c: { - 'data-c': 'new' - }, - d: 'DEEEEEE' - }); + test({ assert, component, target }) { + component.a = { + 'data-one': 10 + }; + component.c = { + 'data-c': 'new' + }; + component.d = 'DEEEEEE'; assert.htmlEqual( target.innerHTML, diff --git a/test/runtime/samples/spread-element/_config.js b/test/runtime/samples/spread-element/_config.js index bd6c0b891..0763634b0 100644 --- a/test/runtime/samples/spread-element/_config.js +++ b/test/runtime/samples/spread-element/_config.js @@ -1,18 +1,20 @@ export default { html: `
    red
    `, - test ( assert, component, target ) { + test({ assert, component, target }) { const div = target.querySelector( 'div' ); assert.equal( div.dataset.foo, 'bar' ); assert.equal( div.dataset.named, 'value' ); - component.set({ color: 'blue', props: { 'data-foo': 'baz', 'data-named': 'qux' } }); + component.color = 'blue'; + component.props = { 'data-foo': 'baz', 'data-named': 'qux' }; assert.htmlEqual( target.innerHTML, `
    blue
    ` ); assert.equal( div.dataset.foo, 'baz' ); assert.equal( div.dataset.named, 'value' ); - component.set({ color: 'blue', props: {} }); + component.color = 'blue'; + component.props = {}; assert.htmlEqual( target.innerHTML, `
    blue
    ` ); assert.equal( div.dataset.foo, undefined ); } diff --git a/test/runtime/samples/spread-element/main.html b/test/runtime/samples/spread-element/main.html index 391566826..bf469e30e 100644 --- a/test/runtime/samples/spread-element/main.html +++ b/test/runtime/samples/spread-element/main.html @@ -1,13 +1,9 @@ -
    {color}
    - + +
    {color}
    diff --git a/test/runtime/samples/spread-own-props/Widget.html b/test/runtime/samples/spread-own-props/Widget.html new file mode 100644 index 000000000..a60afb741 --- /dev/null +++ b/test/runtime/samples/spread-own-props/Widget.html @@ -0,0 +1,4 @@ +

    foo: {foo}

    +

    baz: {baz} ({typeof baz})

    +

    qux: {qux}

    +

    quux: {quux}

    diff --git a/test/runtime/samples/spread-own-props/_config.js b/test/runtime/samples/spread-own-props/_config.js new file mode 100644 index 000000000..e834cc95f --- /dev/null +++ b/test/runtime/samples/spread-own-props/_config.js @@ -0,0 +1,31 @@ +export default { + props: { + foo: 'lol', + baz: 40 + 2, + qux: `this is a ${'piece of'} string`, + quux: 'core' + }, + + html: ` +

    foo: lol

    +

    baz: 42 (number)

    +

    qux: named

    +

    quux: core

    + `, + + async test({ assert, component, target }) { + await component.$set({ + foo: 'wut', + baz: 40 + 3, + qux: `this is a ${'rather boring'} string`, + quux: 'heart' + }); + + assert.htmlEqual(target.innerHTML, ` +

    foo: wut

    +

    baz: 43 (number)

    +

    qux: named

    +

    quux: heart

    + `); + } +}; diff --git a/test/runtime/samples/spread-own-props/main.html b/test/runtime/samples/spread-own-props/main.html new file mode 100644 index 000000000..5f0a0089b --- /dev/null +++ b/test/runtime/samples/spread-own-props/main.html @@ -0,0 +1,11 @@ + + + + +
    + +
    diff --git a/test/runtime/samples/state-deconflicted/_config.js b/test/runtime/samples/state-deconflicted/_config.js index 05678a857..325875440 100644 --- a/test/runtime/samples/state-deconflicted/_config.js +++ b/test/runtime/samples/state-deconflicted/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { state: 'deconflicted', states: [ 'Alabama', @@ -22,19 +22,17 @@ export default { `, - test ( assert, component, target ) { - component.set({ - states: [ - 'Maine', - 'Maryland', - 'Massachusetts', - 'Michigan', - 'Minnesota', - 'Mississippi', - 'Missouri', - 'Montana' - ] - }); + test({ assert, component, target }) { + component.states = [ + 'Maine', + 'Maryland', + 'Massachusetts', + 'Michigan', + 'Minnesota', + 'Mississippi', + 'Missouri', + 'Montana' + ]; assert.htmlEqual( target.innerHTML, `

    Current state: deconflicted

    diff --git a/test/runtime/samples/store-binding/NameInput.html b/test/runtime/samples/store-binding/NameInput.html deleted file mode 100644 index a5e4f5e48..000000000 --- a/test/runtime/samples/store-binding/NameInput.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/store-binding/_config.js b/test/runtime/samples/store-binding/_config.js deleted file mode 100644 index 1b257f47e..000000000 --- a/test/runtime/samples/store-binding/_config.js +++ /dev/null @@ -1,33 +0,0 @@ -import { Store } from '../../../../store.js'; - -const store = new Store({ - name: 'world' -}); - -export default { - store, - - html: ` -

    Hello world!

    - - `, - - ssrHtml: ` -

    Hello world!

    - - `, - - test(assert, component, target, window) { - const input = target.querySelector('input'); - const event = new window.Event('input'); - - input.value = 'everybody'; - input.dispatchEvent(event); - - assert.equal(store.get().name, 'everybody'); - assert.htmlEqual(target.innerHTML, ` -

    Hello everybody!

    - - `); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/store-binding/main.html b/test/runtime/samples/store-binding/main.html deleted file mode 100644 index 0f9e902bf..000000000 --- a/test/runtime/samples/store-binding/main.html +++ /dev/null @@ -1,10 +0,0 @@ -

    Hello {$name}!

    - - - \ No newline at end of file diff --git a/test/runtime/samples/store-child-data/Component.html b/test/runtime/samples/store-child-data/Component.html deleted file mode 100644 index df36fe526..000000000 --- a/test/runtime/samples/store-child-data/Component.html +++ /dev/null @@ -1 +0,0 @@ -

    {$items[index].title}

    \ No newline at end of file diff --git a/test/runtime/samples/store-child-data/_config.js b/test/runtime/samples/store-child-data/_config.js deleted file mode 100644 index 4322386f4..000000000 --- a/test/runtime/samples/store-child-data/_config.js +++ /dev/null @@ -1,22 +0,0 @@ -import { Store } from '../../../../store.js'; - -const store = new Store({ - selectedIndex: 0, - items: [{ title: 'One' }, { title: 'Two' }] -}); - -export default { - store, - - html: ` -

    One

    - `, - - test(assert, component, target, window) { - store.set({ selectedIndex: 2, items: [{ title: 'One' }, { title: 'Two' }, { title: 'Three' }]}); - - assert.htmlEqual(target.innerHTML, ` -

    Three

    - `); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/store-child-data/main.html b/test/runtime/samples/store-child-data/main.html deleted file mode 100644 index 0f3f9862d..000000000 --- a/test/runtime/samples/store-child-data/main.html +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/test/runtime/samples/store-component-binding-deep/TextInput.html b/test/runtime/samples/store-component-binding-deep/TextInput.html deleted file mode 100644 index f24d608cd..000000000 --- a/test/runtime/samples/store-component-binding-deep/TextInput.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/store-component-binding-deep/_config.js b/test/runtime/samples/store-component-binding-deep/_config.js deleted file mode 100644 index 39c48445a..000000000 --- a/test/runtime/samples/store-component-binding-deep/_config.js +++ /dev/null @@ -1,47 +0,0 @@ -import { Store } from '../../../../store.js'; - -const store = new Store({ - name: { - value: 'world' - } -}); - -export default { - store, - - html: ` -

    Hello world!

    - - `, - - ssrHtml: ` -

    Hello world!

    - - `, - - test(assert, component, target, window) { - const input = target.querySelector('input'); - const event = new window.Event('input'); - - const changeRecord = []; - store.on('state', ({ changed, current }) => { - changeRecord.push({ changed, current }); - }); - - input.value = 'everybody'; - input.dispatchEvent(event); - - assert.equal(store.get().name.value, 'everybody'); - assert.htmlEqual(target.innerHTML, ` -

    Hello everybody!

    - - `); - - assert.deepEqual(changeRecord, [ - { - current: { name: { value: 'everybody' } }, - changed: { name: true } - } - ]); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/store-component-binding-deep/main.html b/test/runtime/samples/store-component-binding-deep/main.html deleted file mode 100644 index 578c14ced..000000000 --- a/test/runtime/samples/store-component-binding-deep/main.html +++ /dev/null @@ -1,10 +0,0 @@ -

    Hello {$name.value}!

    - - - \ No newline at end of file diff --git a/test/runtime/samples/store-component-binding-each/Widget.html b/test/runtime/samples/store-component-binding-each/Widget.html deleted file mode 100644 index f24d608cd..000000000 --- a/test/runtime/samples/store-component-binding-each/Widget.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/store-component-binding-each/_config.js b/test/runtime/samples/store-component-binding-each/_config.js deleted file mode 100644 index 32aa44bee..000000000 --- a/test/runtime/samples/store-component-binding-each/_config.js +++ /dev/null @@ -1,41 +0,0 @@ -import { Store } from '../../../../store.js'; - -const store = new Store({ - a: ['foo', 'bar', 'baz'] -}); - -export default { - store, - - html: ` - - - -

    foo, bar, baz

    - `, - - ssrHtml: ` - - - -

    foo, bar, baz

    - `, - - test(assert, component, target, window) { - const event = new window.MouseEvent('input'); - const inputs = target.querySelectorAll('input'); - - inputs[0].value = 'blah'; - inputs[0].dispatchEvent(event); - - assert.deepEqual(store.get().a, ['blah', 'bar', 'baz']); - assert.htmlEqual(target.innerHTML, ` - - - -

    blah, bar, baz

    - `); - - component.destroy(); - }, -}; diff --git a/test/runtime/samples/store-component-binding-each/main.html b/test/runtime/samples/store-component-binding-each/main.html deleted file mode 100644 index 01be9e6b4..000000000 --- a/test/runtime/samples/store-component-binding-each/main.html +++ /dev/null @@ -1,15 +0,0 @@ -{#each $a as x} - -{/each} - -

    {$a.join(', ')}

    - - diff --git a/test/runtime/samples/store-component-binding/TextInput.html b/test/runtime/samples/store-component-binding/TextInput.html deleted file mode 100644 index f24d608cd..000000000 --- a/test/runtime/samples/store-component-binding/TextInput.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/store-component-binding/_config.js b/test/runtime/samples/store-component-binding/_config.js deleted file mode 100644 index 57ee8a63d..000000000 --- a/test/runtime/samples/store-component-binding/_config.js +++ /dev/null @@ -1,45 +0,0 @@ -import { Store } from '../../../../store.js'; - -const store = new Store({ - name: 'world' -}); - -export default { - store, - - html: ` -

    Hello world!

    - - `, - - ssrHtml: ` -

    Hello world!

    - - `, - - test(assert, component, target, window) { - const input = target.querySelector('input'); - const event = new window.Event('input'); - - const changeRecord = []; - store.on('state', ({ changed, current }) => { - changeRecord.push({ changed, current }); - }); - - input.value = 'everybody'; - input.dispatchEvent(event); - - assert.equal(store.get().name, 'everybody'); - assert.htmlEqual(target.innerHTML, ` -

    Hello everybody!

    - - `); - - assert.deepEqual(changeRecord, [ - { - current: { name: 'everybody' }, - changed: { name: true } - } - ]); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/store-component-binding/main.html b/test/runtime/samples/store-component-binding/main.html deleted file mode 100644 index 8abfd6c23..000000000 --- a/test/runtime/samples/store-component-binding/main.html +++ /dev/null @@ -1,10 +0,0 @@ -

    Hello {$name}!

    - - - \ No newline at end of file diff --git a/test/runtime/samples/store-computed-oncreate/_config.js b/test/runtime/samples/store-computed-oncreate/_config.js deleted file mode 100644 index 5e58271ba..000000000 --- a/test/runtime/samples/store-computed-oncreate/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -import { Store } from '../../../../store.js'; - -export default { - 'skip-ssr': true, - - store: new Store(), - - html: ` -

    Hello Brian!

    - ` -}; \ No newline at end of file diff --git a/test/runtime/samples/store-computed-oncreate/main.html b/test/runtime/samples/store-computed-oncreate/main.html deleted file mode 100644 index ce35a047b..000000000 --- a/test/runtime/samples/store-computed-oncreate/main.html +++ /dev/null @@ -1,10 +0,0 @@ -

    Hello {$name}!

    - - \ No newline at end of file diff --git a/test/runtime/samples/store-computed/Todo.html b/test/runtime/samples/store-computed/Todo.html deleted file mode 100644 index c665d86d3..000000000 --- a/test/runtime/samples/store-computed/Todo.html +++ /dev/null @@ -1,15 +0,0 @@ -{#if isVisible} -
    {todo.description}
    -{/if} - - \ No newline at end of file diff --git a/test/runtime/samples/store-computed/_config.js b/test/runtime/samples/store-computed/_config.js deleted file mode 100644 index f922a5573..000000000 --- a/test/runtime/samples/store-computed/_config.js +++ /dev/null @@ -1,63 +0,0 @@ -import { Store } from '../../../../store.js'; - -class MyStore extends Store { - setFilter(filter) { - this.set({ filter }); - } - - toggleTodo(todo) { - todo.done = !todo.done; - this.set({ todos: this.get().todos }); - } -} - -const todos = [ - { - description: 'Buy some milk', - done: true, - }, - { - description: 'Do the laundry', - done: true, - }, - { - description: "Find life's true purpose", - done: false, - } -]; - -const store = new MyStore({ - filter: 'all', - todos -}); - -export default { - store, - - html: ` -
    Buy some milk
    -
    Do the laundry
    -
    Find life's true purpose
    - `, - - test(assert, component, target) { - store.setFilter('pending'); - - assert.htmlEqual(target.innerHTML, ` -
    Find life's true purpose
    - `); - - store.toggleTodo(todos[1]); - - assert.htmlEqual(target.innerHTML, ` -
    Do the laundry
    -
    Find life's true purpose
    - `); - - store.setFilter('done'); - - assert.htmlEqual(target.innerHTML, ` -
    Buy some milk
    - `); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/store-computed/main.html b/test/runtime/samples/store-computed/main.html deleted file mode 100644 index 42af517dd..000000000 --- a/test/runtime/samples/store-computed/main.html +++ /dev/null @@ -1,11 +0,0 @@ -{#each $todos as todo} - -{/each} - - \ No newline at end of file diff --git a/test/runtime/samples/store-event/NameInput.html b/test/runtime/samples/store-event/NameInput.html deleted file mode 100644 index d1d31bf64..000000000 --- a/test/runtime/samples/store-event/NameInput.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/store-event/_config.js b/test/runtime/samples/store-event/_config.js deleted file mode 100644 index 58afa1561..000000000 --- a/test/runtime/samples/store-event/_config.js +++ /dev/null @@ -1,34 +0,0 @@ -import { Store } from '../../../../store.js'; - -class MyStore extends Store { - setName(name) { - this.set({ name }); - } -} - -const store = new MyStore({ - name: 'world' -}); - -export default { - store, - - html: ` -

    Hello world!

    - - `, - - test(assert, component, target, window) { - const input = target.querySelector('input'); - const event = new window.Event('input'); - - input.value = 'everybody'; - input.dispatchEvent(event); - - assert.equal(store.get().name, 'everybody'); - assert.htmlEqual(target.innerHTML, ` -

    Hello everybody!

    - - `); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/store-event/main.html b/test/runtime/samples/store-event/main.html deleted file mode 100644 index 0f9e902bf..000000000 --- a/test/runtime/samples/store-event/main.html +++ /dev/null @@ -1,10 +0,0 @@ -

    Hello {$name}!

    - - - \ No newline at end of file diff --git a/test/runtime/samples/store-nested/Nested.html b/test/runtime/samples/store-nested/Nested.html deleted file mode 100644 index 0ba00df43..000000000 --- a/test/runtime/samples/store-nested/Nested.html +++ /dev/null @@ -1,13 +0,0 @@ -

    Hello, {$name}!

    - - diff --git a/test/runtime/samples/store-nested/_config.js b/test/runtime/samples/store-nested/_config.js deleted file mode 100644 index 594bd6587..000000000 --- a/test/runtime/samples/store-nested/_config.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - html: ` -

    Hello, world!

    - `, -}; diff --git a/test/runtime/samples/store-nested/main.html b/test/runtime/samples/store-nested/main.html deleted file mode 100644 index a1e069b2a..000000000 --- a/test/runtime/samples/store-nested/main.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/test/runtime/samples/store-onstate-dollar/_config.js b/test/runtime/samples/store-onstate-dollar/_config.js deleted file mode 100644 index 281fa7629..000000000 --- a/test/runtime/samples/store-onstate-dollar/_config.js +++ /dev/null @@ -1,27 +0,0 @@ -import { Store } from '../../../../store.js'; - -const store = new Store({ - name: 'world' -}); - -export default { - store, - - html: `

    Hello world!

    `, - - compileOptions: { - dev: true - }, - - test(assert, component) { - const names = []; - - component.on('state', ({ current }) => { - names.push(current.$name); - }); - - store.set({ name: 'everybody' }); - - assert.deepEqual(names, ['everybody']); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/store-onstate-dollar/main.html b/test/runtime/samples/store-onstate-dollar/main.html deleted file mode 100644 index ddb69c214..000000000 --- a/test/runtime/samples/store-onstate-dollar/main.html +++ /dev/null @@ -1 +0,0 @@ -

    Hello {$name}!

    \ No newline at end of file diff --git a/test/runtime/samples/store-root/Nested.html b/test/runtime/samples/store-root/Nested.html deleted file mode 100644 index 2bee21b9b..000000000 --- a/test/runtime/samples/store-root/Nested.html +++ /dev/null @@ -1 +0,0 @@ -

    It's nice to see you, {$name}.

    \ No newline at end of file diff --git a/test/runtime/samples/store-root/_config.js b/test/runtime/samples/store-root/_config.js deleted file mode 100644 index 278cbff30..000000000 --- a/test/runtime/samples/store-root/_config.js +++ /dev/null @@ -1,15 +0,0 @@ -export default { - html: ` -

    Hello world!

    -

    It's nice to see you, world.

    - `, - - test(assert, component, target) { - component.store.set({ name: 'everybody' }); - - assert.htmlEqual(target.innerHTML, ` -

    Hello everybody!

    -

    It's nice to see you, everybody.

    - `); - } -}; diff --git a/test/runtime/samples/store-root/main.html b/test/runtime/samples/store-root/main.html deleted file mode 100644 index b880433be..000000000 --- a/test/runtime/samples/store-root/main.html +++ /dev/null @@ -1,19 +0,0 @@ -

    Hello {$name}!

    - - - diff --git a/test/runtime/samples/store/_config.js b/test/runtime/samples/store/_config.js deleted file mode 100644 index 4e266ff09..000000000 --- a/test/runtime/samples/store/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -import { Store } from '../../../../store.js'; - -const store = new Store({ - name: 'world' -}); - -export default { - store, - - html: `

    Hello world!

    `, - - test(assert, component, target) { - store.set({ name: 'everybody' }); - - assert.htmlEqual(target.innerHTML, `

    Hello everybody!

    `); - } -}; \ No newline at end of file diff --git a/test/runtime/samples/store/main.html b/test/runtime/samples/store/main.html deleted file mode 100644 index ddb69c214..000000000 --- a/test/runtime/samples/store/main.html +++ /dev/null @@ -1 +0,0 @@ -

    Hello {$name}!

    \ No newline at end of file diff --git a/test/runtime/samples/svg-attributes/_config.js b/test/runtime/samples/svg-attributes/_config.js index a14ad958b..668fb391c 100644 --- a/test/runtime/samples/svg-attributes/_config.js +++ b/test/runtime/samples/svg-attributes/_config.js @@ -7,9 +7,8 @@ export default { `, - test ( assert, component, target ) { - const circle = target.querySelector( 'circle' ); - assert.equal( circle.getAttribute( 'class' ), 'red' ); - component.destroy(); + test({ assert, component, target }) { + const circle = target.querySelector('circle'); + assert.equal(circle.getAttribute('class'), 'red'); } }; diff --git a/test/runtime/samples/svg-child-component-declared-namespace-backtick-string/Rect.html b/test/runtime/samples/svg-child-component-declared-namespace-backtick-string/Rect.html deleted file mode 100644 index 143b2f822..000000000 --- a/test/runtime/samples/svg-child-component-declared-namespace-backtick-string/Rect.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/test/runtime/samples/svg-child-component-declared-namespace-backtick-string/_config.js b/test/runtime/samples/svg-child-component-declared-namespace-backtick-string/_config.js deleted file mode 100644 index b4a0da70d..000000000 --- a/test/runtime/samples/svg-child-component-declared-namespace-backtick-string/_config.js +++ /dev/null @@ -1,21 +0,0 @@ -export default { - data: { - x: 0, - y: 0, - width: 100, - height: 100 - }, - - html: ``, - - test ( assert, component, target ) { - const svg = target.querySelector( 'svg' ); - const rect = target.querySelector( 'rect' ); - - assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' ); - assert.equal( rect.namespaceURI, 'http://www.w3.org/2000/svg' ); - - component.set({ width: 150, height: 50 }); - assert.equal( target.innerHTML, `` ); - }, -}; diff --git a/test/runtime/samples/svg-child-component-declared-namespace-backtick-string/main.html b/test/runtime/samples/svg-child-component-declared-namespace-backtick-string/main.html deleted file mode 100644 index 6ae6ad859..000000000 --- a/test/runtime/samples/svg-child-component-declared-namespace-backtick-string/main.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - diff --git a/test/runtime/samples/svg-child-component-declared-namespace-shorthand/Rect.html b/test/runtime/samples/svg-child-component-declared-namespace-shorthand/Rect.html index 536f47107..4e72c96fb 100644 --- a/test/runtime/samples/svg-child-component-declared-namespace-shorthand/Rect.html +++ b/test/runtime/samples/svg-child-component-declared-namespace-shorthand/Rect.html @@ -1,7 +1,10 @@ - + + + diff --git a/test/runtime/samples/svg-child-component-declared-namespace-shorthand/_config.js b/test/runtime/samples/svg-child-component-declared-namespace-shorthand/_config.js index 37d94a160..e7f839739 100644 --- a/test/runtime/samples/svg-child-component-declared-namespace-shorthand/_config.js +++ b/test/runtime/samples/svg-child-component-declared-namespace-shorthand/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 0, y: 0, width: 100, @@ -8,14 +8,15 @@ export default { html: ``, - test ( assert, component, target ) { + test({ assert, component, target }) { const svg = target.querySelector( 'svg' ); const rect = target.querySelector( 'rect' ); assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' ); assert.equal( rect.namespaceURI, 'http://www.w3.org/2000/svg' ); - component.set({ width: 150, height: 50 }); + component.width = 150; + component.height = 50; assert.equal( target.innerHTML, `` ); } }; diff --git a/test/runtime/samples/svg-child-component-declared-namespace-shorthand/main.html b/test/runtime/samples/svg-child-component-declared-namespace-shorthand/main.html index 6ae6ad859..9e82368db 100644 --- a/test/runtime/samples/svg-child-component-declared-namespace-shorthand/main.html +++ b/test/runtime/samples/svg-child-component-declared-namespace-shorthand/main.html @@ -1,11 +1,12 @@ - - - - + + + + diff --git a/test/runtime/samples/svg-child-component-declared-namespace/Rect.html b/test/runtime/samples/svg-child-component-declared-namespace/Rect.html index d6c96e8e4..b9d1584b4 100644 --- a/test/runtime/samples/svg-child-component-declared-namespace/Rect.html +++ b/test/runtime/samples/svg-child-component-declared-namespace/Rect.html @@ -1,7 +1,10 @@ - + + + diff --git a/test/runtime/samples/svg-child-component-declared-namespace/_config.js b/test/runtime/samples/svg-child-component-declared-namespace/_config.js index 37d94a160..e7f839739 100644 --- a/test/runtime/samples/svg-child-component-declared-namespace/_config.js +++ b/test/runtime/samples/svg-child-component-declared-namespace/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 0, y: 0, width: 100, @@ -8,14 +8,15 @@ export default { html: ``, - test ( assert, component, target ) { + test({ assert, component, target }) { const svg = target.querySelector( 'svg' ); const rect = target.querySelector( 'rect' ); assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' ); assert.equal( rect.namespaceURI, 'http://www.w3.org/2000/svg' ); - component.set({ width: 150, height: 50 }); + component.width = 150; + component.height = 50; assert.equal( target.innerHTML, `` ); } }; diff --git a/test/runtime/samples/svg-child-component-declared-namespace/main.html b/test/runtime/samples/svg-child-component-declared-namespace/main.html index 6ae6ad859..9e82368db 100644 --- a/test/runtime/samples/svg-child-component-declared-namespace/main.html +++ b/test/runtime/samples/svg-child-component-declared-namespace/main.html @@ -1,11 +1,12 @@ - - - - + + + + diff --git a/test/runtime/samples/svg-class/_config.js b/test/runtime/samples/svg-class/_config.js index 74141d167..3bb353cf5 100644 --- a/test/runtime/samples/svg-class/_config.js +++ b/test/runtime/samples/svg-class/_config.js @@ -3,12 +3,10 @@ export default { html: ``, - test ( assert, component, target ) { - const svg = target.querySelector( 'svg' ); + test({ assert, component, target }) { + const svg = target.querySelector('svg'); - assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' ); - assert.equal( svg.getAttribute( 'class' ), 'foo' ); - - component.destroy(); + assert.equal(svg.namespaceURI, 'http://www.w3.org/2000/svg'); + assert.equal(svg.getAttribute('class'), 'foo'); } }; diff --git a/test/runtime/samples/svg-each-block-anchor/_config.js b/test/runtime/samples/svg-each-block-anchor/_config.js index 9ca280965..a4e6f9e04 100644 --- a/test/runtime/samples/svg-each-block-anchor/_config.js +++ b/test/runtime/samples/svg-each-block-anchor/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { foo: ['a'], bar: ['c'] }, @@ -11,8 +11,8 @@ export default { `, - test(assert, component, target) { - component.set({ foo: ['a', 'b'] }); + test({ assert, component, target }) { + component.foo = ['a', 'b']; assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/svg-each-block-namespace/_config.js b/test/runtime/samples/svg-each-block-namespace/_config.js index 1bdab1a60..795510c87 100644 --- a/test/runtime/samples/svg-each-block-namespace/_config.js +++ b/test/runtime/samples/svg-each-block-namespace/_config.js @@ -5,11 +5,10 @@ export default { `, - test ( assert, component, target ) { - const circles = target.querySelectorAll( 'circle' ); - assert.equal( circles[0].namespaceURI, 'http://www.w3.org/2000/svg' ); - assert.equal( circles[1].namespaceURI, 'http://www.w3.org/2000/svg' ); - assert.equal( circles[2].namespaceURI, 'http://www.w3.org/2000/svg' ); - component.destroy(); + test({ assert, component, target }) { + const circles = target.querySelectorAll('circle'); + assert.equal(circles[0].namespaceURI, 'http://www.w3.org/2000/svg'); + assert.equal(circles[1].namespaceURI, 'http://www.w3.org/2000/svg'); + assert.equal(circles[2].namespaceURI, 'http://www.w3.org/2000/svg'); } }; diff --git a/test/runtime/samples/svg-each-block-namespace/main.html b/test/runtime/samples/svg-each-block-namespace/main.html index 4a85ffb64..94bf834c6 100644 --- a/test/runtime/samples/svg-each-block-namespace/main.html +++ b/test/runtime/samples/svg-each-block-namespace/main.html @@ -1,15 +1,9 @@ + + {#each colours as colour, i} {/each} - - diff --git a/test/runtime/samples/svg-multiple/_config.js b/test/runtime/samples/svg-multiple/_config.js index 9fd938e47..4f002d302 100644 --- a/test/runtime/samples/svg-multiple/_config.js +++ b/test/runtime/samples/svg-multiple/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 0, y: 0, width: 100, @@ -11,7 +11,7 @@ export default { `, - test ( assert, component, target ) { + test({ assert, component, target }) { const svgs = target.querySelectorAll( 'svg' ); const rects = target.querySelectorAll( 'rect' ); @@ -20,7 +20,8 @@ export default { assert.equal( rects[1].namespaceURI, 'http://www.w3.org/2000/svg' ); assert.equal( rects[1].namespaceURI, 'http://www.w3.org/2000/svg' ); - component.set({ width: 150, height: 50 }); + component.width = 150; + component.height = 50; assert.htmlEqual( target.innerHTML, ` diff --git a/test/runtime/samples/svg-no-whitespace/_config.js b/test/runtime/samples/svg-no-whitespace/_config.js index f2a670abd..6d4cefba2 100644 --- a/test/runtime/samples/svg-no-whitespace/_config.js +++ b/test/runtime/samples/svg-no-whitespace/_config.js @@ -1,5 +1,5 @@ export default { - test ( assert, component, target ) { + test({ assert, component, target }) { const svg = target.querySelector( 'svg' ); assert.equal( svg.childNodes.length, 2 ); diff --git a/test/runtime/samples/svg-with-style/_config.js b/test/runtime/samples/svg-with-style/_config.js index e4cbe253e..dd37cfee4 100644 --- a/test/runtime/samples/svg-with-style/_config.js +++ b/test/runtime/samples/svg-with-style/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 'bar' }, diff --git a/test/runtime/samples/svg-xlink/_config.js b/test/runtime/samples/svg-xlink/_config.js index 55bb6440a..6e0ad4664 100644 --- a/test/runtime/samples/svg-xlink/_config.js +++ b/test/runtime/samples/svg-xlink/_config.js @@ -8,12 +8,10 @@ export default { `, - test ( assert, component, target ) { - const use = target.querySelector( 'use' ); + test({ assert, component, target }) { + const use = target.querySelector('use'); const href = use.attributes[ 'xlink:href' ]; - assert.equal( href.namespaceURI, 'http://www.w3.org/1999/xlink' ); - - component.destroy(); + assert.equal(href.namespaceURI, 'http://www.w3.org/1999/xlink'); } }; diff --git a/test/runtime/samples/svg-xmlns/_config.js b/test/runtime/samples/svg-xmlns/_config.js index 58a57c434..daf6ef03e 100644 --- a/test/runtime/samples/svg-xmlns/_config.js +++ b/test/runtime/samples/svg-xmlns/_config.js @@ -1,7 +1,7 @@ export default { - 'skip-ssr': true, + skip_if_ssr: true, - data: { + props: { x: 0, y: 0, width: 100, @@ -10,14 +10,15 @@ export default { html: ``, - test ( assert, component, target ) { + test({ assert, component, target }) { const svg = target.querySelector( 'svg' ); const rect = target.querySelector( 'rect' ); assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' ); assert.equal( rect.namespaceURI, 'http://www.w3.org/2000/svg' ); - component.set({ width: 150, height: 50 }); + component.width = 150; + component.height = 50; assert.equal( target.innerHTML, `` ); } }; diff --git a/test/runtime/samples/svg/_config.js b/test/runtime/samples/svg/_config.js index 37d94a160..e7f839739 100644 --- a/test/runtime/samples/svg/_config.js +++ b/test/runtime/samples/svg/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { x: 0, y: 0, width: 100, @@ -8,14 +8,15 @@ export default { html: ``, - test ( assert, component, target ) { + test({ assert, component, target }) { const svg = target.querySelector( 'svg' ); const rect = target.querySelector( 'rect' ); assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' ); assert.equal( rect.namespaceURI, 'http://www.w3.org/2000/svg' ); - component.set({ width: 150, height: 50 }); + component.width = 150; + component.height = 50; assert.equal( target.innerHTML, `` ); } }; diff --git a/test/runtime/samples/template/_config.js b/test/runtime/samples/template/_config.js index 134618007..ccc04a1c9 100644 --- a/test/runtime/samples/template/_config.js +++ b/test/runtime/samples/template/_config.js @@ -7,7 +7,7 @@ export default { `, - test(assert, component, target) { + test({ assert, component, target }) { const template = target.querySelector('template'); assert.htmlEqual(template.innerHTML, ` diff --git a/test/runtime/samples/textarea-children/_config.js b/test/runtime/samples/textarea-children/_config.js index f21519b26..8f46370b0 100644 --- a/test/runtime/samples/textarea-children/_config.js +++ b/test/runtime/samples/textarea-children/_config.js @@ -1,17 +1,17 @@ export default { - 'skip-ssr': true, // SSR behaviour is awkwardly different + skip_if_ssr: true, // SSR behaviour is awkwardly different - data: { + props: { foo: 42 }, html: ``, - test ( assert, component, target ) { + test({ assert, component, target }) { const textarea = target.querySelector( 'textarea' ); assert.strictEqual( textarea.value, `\n\t

    not actually an element. 42

    \n` ); - component.set({ foo: 43 }); + component.foo = 43; assert.strictEqual( textarea.value, `\n\t

    not actually an element. 43

    \n` ); } }; \ No newline at end of file diff --git a/test/runtime/samples/textarea-value/_config.js b/test/runtime/samples/textarea-value/_config.js index 89ff63508..412754b51 100644 --- a/test/runtime/samples/textarea-value/_config.js +++ b/test/runtime/samples/textarea-value/_config.js @@ -1,17 +1,17 @@ export default { - 'skip-ssr': true, // SSR behaviour is awkwardly different + skip_if_ssr: true, // SSR behaviour is awkwardly different - data: { + props: { foo: 42 }, html: ``, - test ( assert, component, target ) { + test({ assert, component, target }) { const textarea = target.querySelector( 'textarea' ); assert.strictEqual( textarea.value, '42' ); - component.set({ foo: 43 }); + component.foo = 43; assert.strictEqual( textarea.value, '43' ); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-css-deferred-removal/_config.js b/test/runtime/samples/transition-css-deferred-removal/_config.js index f8196a70a..cd9dbfeb7 100644 --- a/test/runtime/samples/transition-css-deferred-removal/_config.js +++ b/test/runtime/samples/transition-css-deferred-removal/_config.js @@ -1,10 +1,10 @@ export default { - data: { + props: { visible: true }, - test(assert, component, target, window, raf) { - component.set({ visible: false }); + test({ assert, component, target, window, raf }) { + component.visible = false; const outer = target.querySelector('.outer'); const inner = target.querySelector('.inner'); diff --git a/test/runtime/samples/transition-css-deferred-removal/main.html b/test/runtime/samples/transition-css-deferred-removal/main.html index a93aed836..34a98ca08 100644 --- a/test/runtime/samples/transition-css-deferred-removal/main.html +++ b/test/runtime/samples/transition-css-deferred-removal/main.html @@ -1,31 +1,29 @@ + + {#if visible} double transition -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-css-delay/_config.js b/test/runtime/samples/transition-css-delay/_config.js index e51ae5c6c..6e2c4a9ba 100644 --- a/test/runtime/samples/transition-css-delay/_config.js +++ b/test/runtime/samples/transition-css-delay/_config.js @@ -1,12 +1,10 @@ export default { - test ( assert, component, target, window, raf ) { - component.set({ visible: true }); - const div = target.querySelector( 'div' ); - assert.strictEqual( div.style.opacity, '0' ); + test({ assert, component, target, window, raf }) { + component.visible = true; + const div = target.querySelector('div'); + assert.strictEqual(div.style.opacity, '0'); - raf.tick( 50 ); - assert.strictEqual( div.style.opacity, '' ); - - component.destroy(); + raf.tick(50); + assert.strictEqual(div.style.opacity, ''); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-css-delay/main.html b/test/runtime/samples/transition-css-delay/main.html index 46a46aa52..faf89582e 100644 --- a/test/runtime/samples/transition-css-delay/main.html +++ b/test/runtime/samples/transition-css-delay/main.html @@ -1,19 +1,17 @@ -{#if visible} -
    delayed
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    delayed
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-css-duration/_config.js b/test/runtime/samples/transition-css-duration/_config.js index 8a4f88431..ed2535768 100644 --- a/test/runtime/samples/transition-css-duration/_config.js +++ b/test/runtime/samples/transition-css-duration/_config.js @@ -1,10 +1,10 @@ export default { - test(assert, component, target, window, raf) { - component.set({ visible: true }); + test({ assert, component, target, window, raf }) { + component.visible = true; const div = target.querySelector('div'); raf.tick(25); - component.set({ visible: false }); + component.visible = false; assert.ok(~div.style.animation.indexOf('25ms')); }, diff --git a/test/runtime/samples/transition-css-duration/main.html b/test/runtime/samples/transition-css-duration/main.html index e10df79f5..c79672f21 100644 --- a/test/runtime/samples/transition-css-duration/main.html +++ b/test/runtime/samples/transition-css-duration/main.html @@ -1,18 +1,16 @@ -{#if visible} -
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-aborted-outro-in-each/_config.js b/test/runtime/samples/transition-js-aborted-outro-in-each/_config.js index ae2317927..75242d21a 100644 --- a/test/runtime/samples/transition-js-aborted-outro-in-each/_config.js +++ b/test/runtime/samples/transition-js-aborted-outro-in-each/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { things: [ 'one', 'two', @@ -7,10 +7,10 @@ export default { ] }, - test(assert, component, target, window, raf) { - const { things } = component.get(); + test({ assert, component, target, window, raf }) { + const { things } = component; - component.set({ things: [] }); + component.things = []; const spans = target.querySelectorAll('span'); raf.tick(25); @@ -23,7 +23,7 @@ export default { assert.equal(spans[1].foo, 0.25); assert.equal(spans[2].foo, 0.75); - component.set({ things }); + component.things = things; raf.tick(225); assert.htmlEqual(target.innerHTML, ` diff --git a/test/runtime/samples/transition-js-aborted-outro-in-each/main.html b/test/runtime/samples/transition-js-aborted-outro-in-each/main.html index fabdc527a..689d30148 100644 --- a/test/runtime/samples/transition-js-aborted-outro-in-each/main.html +++ b/test/runtime/samples/transition-js-aborted-outro-in-each/main.html @@ -1,19 +1,17 @@ -{#each things as thing, i} - {thing} -{/each} - \ No newline at end of file + }; + } + + +{#each things as thing, i} + {thing} +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-aborted-outro/_config.js b/test/runtime/samples/transition-js-aborted-outro/_config.js index 345fed1a7..87ad32be0 100644 --- a/test/runtime/samples/transition-js-aborted-outro/_config.js +++ b/test/runtime/samples/transition-js-aborted-outro/_config.js @@ -1,16 +1,16 @@ export default { - data: { + props: { visible: true, }, - test(assert, component, target, window, raf) { - component.set({ visible: false }); + test({ assert, component, target, window, raf }) { + component.visible = false; const span = target.querySelector('span'); raf.tick(50); assert.equal(span.foo, 0.5); - component.set({ visible: true }); + component.visible = true; assert.equal(span.foo, 1); raf.tick(75); diff --git a/test/runtime/samples/transition-js-aborted-outro/main.html b/test/runtime/samples/transition-js-aborted-outro/main.html index 47c93a232..564b88a38 100644 --- a/test/runtime/samples/transition-js-aborted-outro/main.html +++ b/test/runtime/samples/transition-js-aborted-outro/main.html @@ -1,18 +1,16 @@ -{#if visible} - hello -{/if} - \ No newline at end of file + }; + } + + +{#if visible} + hello +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-args/_config.js b/test/runtime/samples/transition-js-args/_config.js index d7ea1240b..00682894c 100644 --- a/test/runtime/samples/transition-js-args/_config.js +++ b/test/runtime/samples/transition-js-args/_config.js @@ -1,10 +1,9 @@ export default { - skipIntroByDefault: true, - nestedTransitions: true, - intro: true, + test({ assert, component, target, window, raf }) { + component.visible = true; - test(assert, component, target, window, raf) { const div = target.querySelector('div'); + assert.equal(div.foo, 0); assert.equal(div.oof, 1); diff --git a/test/runtime/samples/transition-js-args/main.html b/test/runtime/samples/transition-js-args/main.html index 890ec9a5e..969d6ef11 100644 --- a/test/runtime/samples/transition-js-args/main.html +++ b/test/runtime/samples/transition-js-args/main.html @@ -1,17 +1,17 @@ -
    - \ No newline at end of file + }; + } + + +{#if visible} +
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-await-block/_config.js b/test/runtime/samples/transition-js-await-block/_config.js index 6c482afe4..5cddc8a95 100644 --- a/test/runtime/samples/transition-js-await-block/_config.js +++ b/test/runtime/samples/transition-js-await-block/_config.js @@ -7,12 +7,13 @@ let promise = new Promise((f, r) => { }); export default { - data: { + props: { promise }, - test(assert, component, target, window, raf) { - component.set({ visible: true }); + intro: true, + + test({ assert, component, target, window, raf }) { let p = target.querySelector('p'); assert.equal(p.className, 'pending'); diff --git a/test/runtime/samples/transition-js-await-block/main.html b/test/runtime/samples/transition-js-await-block/main.html index 9fc038fd6..0a0bb0005 100644 --- a/test/runtime/samples/transition-js-await-block/main.html +++ b/test/runtime/samples/transition-js-await-block/main.html @@ -1,22 +1,20 @@ + + {#await promise}

    loading...

    {:then value}

    {value}

    {:catch error}

    {error.message}

    -{/await} - - \ No newline at end of file +{/await} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-context/_config.js b/test/runtime/samples/transition-js-context/_config.js index c5b3f1460..e2e713518 100644 --- a/test/runtime/samples/transition-js-context/_config.js +++ b/test/runtime/samples/transition-js-context/_config.js @@ -1,5 +1,7 @@ export default { - test(assert, component, target, window, raf) { + test({ assert, component, target, window, raf }) { + component.visible = true; + const div = target.querySelector('div'); assert.equal(div.foo, 42); diff --git a/test/runtime/samples/transition-js-context/main.html b/test/runtime/samples/transition-js-context/main.html index 18f5f50ec..d56ca61a6 100644 --- a/test/runtime/samples/transition-js-context/main.html +++ b/test/runtime/samples/transition-js-context/main.html @@ -1,20 +1,17 @@ -
    - \ No newline at end of file + }; + } + + +{#if visible} +
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-deferred/_config.js b/test/runtime/samples/transition-js-deferred/_config.js index 79d4b41a8..556979537 100644 --- a/test/runtime/samples/transition-js-deferred/_config.js +++ b/test/runtime/samples/transition-js-deferred/_config.js @@ -1,8 +1,6 @@ export default { - skipIntroByDefault: true, - - test(assert, component, target, window, raf) { - component.set({ visible: true }); + test({ assert, component, target, window, raf }) { + component.visible = true; return Promise.resolve().then(() => { const div = target.querySelector('div'); diff --git a/test/runtime/samples/transition-js-deferred/main.html b/test/runtime/samples/transition-js-deferred/main.html index 01985384a..32e68a46f 100644 --- a/test/runtime/samples/transition-js-deferred/main.html +++ b/test/runtime/samples/transition-js-deferred/main.html @@ -1,20 +1,18 @@ + + {#if visible}
    -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-delay-in-out/_config.js b/test/runtime/samples/transition-js-delay-in-out/_config.js index 6e97f19c3..fb77fca01 100644 --- a/test/runtime/samples/transition-js-delay-in-out/_config.js +++ b/test/runtime/samples/transition-js-delay-in-out/_config.js @@ -1,24 +1,22 @@ export default { - test ( assert, component, target, window, raf ) { - component.set({ visible: true }); - const div = target.querySelector( 'div' ); - assert.equal( div.foo, 0 ); + test({ assert, component, target, window, raf }) { + component.visible = true; + const div = target.querySelector('div'); + assert.equal(div.foo, 0); - raf.tick( 50 ); - assert.equal( div.foo, 0 ); + raf.tick(50); + assert.equal(div.foo, 0); - raf.tick( 150 ); - assert.equal( div.foo, 1 ); + raf.tick(150); + assert.equal(div.foo, 1); - component.set({ visible: false }); - assert.equal( div.bar, undefined ); + component.visible = false; + assert.equal(div.bar, undefined); - raf.tick( 200 ); - assert.equal( div.bar, 1 ); + raf.tick(200); + assert.equal(div.bar, 1); - raf.tick( 300 ); - assert.equal( div.bar, 0 ); - - component.destroy(); + raf.tick(300); + assert.equal(div.bar, 0); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-delay-in-out/main.html b/test/runtime/samples/transition-js-delay-in-out/main.html index 43400fd67..bfef30b59 100644 --- a/test/runtime/samples/transition-js-delay-in-out/main.html +++ b/test/runtime/samples/transition-js-delay-in-out/main.html @@ -1,29 +1,27 @@ -{#if visible} -
    delayed
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    delayed
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-delay/_config.js b/test/runtime/samples/transition-js-delay/_config.js index eab832ca3..a0613737b 100644 --- a/test/runtime/samples/transition-js-delay/_config.js +++ b/test/runtime/samples/transition-js-delay/_config.js @@ -1,29 +1,27 @@ export default { - test ( assert, component, target, window, raf ) { - component.set({ visible: true }); - const div = target.querySelector( 'div' ); - assert.equal( div.foo, 0 ); + test({ assert, component, target, window, raf }) { + component.visible = true; + const div = target.querySelector('div'); + assert.equal(div.foo, 0); - raf.tick( 50 ); - assert.equal( div.foo, 0 ); + raf.tick(50); + assert.equal(div.foo, 0); - raf.tick( 100 ); - assert.equal( div.foo, 0.5 ); + raf.tick(100); + assert.equal(div.foo, 0.5); - component.set({ visible: false }); + component.visible = false; - raf.tick( 125 ); - assert.equal( div.foo, 0.75 ); + raf.tick(125); + assert.equal(div.foo, 0.75); - raf.tick( 150 ); - assert.equal( div.foo, 1 ); + raf.tick(150); + assert.equal(div.foo, 1); - raf.tick( 175 ); - assert.equal( div.foo, 0.75 ); + raf.tick(175); + assert.equal(div.foo, 0.75); - raf.tick( 250 ); - assert.equal( div.foo, 0 ); - - component.destroy(); + raf.tick(250); + assert.equal(div.foo, 0); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-delay/main.html b/test/runtime/samples/transition-js-delay/main.html index 1db651008..dbe342797 100644 --- a/test/runtime/samples/transition-js-delay/main.html +++ b/test/runtime/samples/transition-js-delay/main.html @@ -1,19 +1,17 @@ -{#if visible} -
    delayed
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    delayed
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-destroyed-before-end/_config.js b/test/runtime/samples/transition-js-destroyed-before-end/_config.js index d079c4464..7cedf8519 100644 --- a/test/runtime/samples/transition-js-destroyed-before-end/_config.js +++ b/test/runtime/samples/transition-js-destroyed-before-end/_config.js @@ -1,18 +1,16 @@ export default { - skipIntroByDefault: true, - - data: { + props: { visible: true }, - test(assert, component, target, window, raf) { - component.set({ visible: false }); + test({ assert, component, target, window, raf }) { + component.visible = false; const div = target.querySelector('div'); raf.tick(50); assert.equal(div.foo, 0.5); - component.destroy(); + component.$destroy(); raf.tick(100); }, diff --git a/test/runtime/samples/transition-js-destroyed-before-end/main.html b/test/runtime/samples/transition-js-destroyed-before-end/main.html index e6e0ee0c6..3ec92de49 100644 --- a/test/runtime/samples/transition-js-destroyed-before-end/main.html +++ b/test/runtime/samples/transition-js-destroyed-before-end/main.html @@ -1,18 +1,16 @@ -{#if visible} -
    destroy me
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    destroy me
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-dynamic-component/A.html b/test/runtime/samples/transition-js-dynamic-component/A.html index 7671fb5c5..e1764ec76 100644 --- a/test/runtime/samples/transition-js-dynamic-component/A.html +++ b/test/runtime/samples/transition-js-dynamic-component/A.html @@ -1,16 +1,12 @@ -
    a
    - \ No newline at end of file + }; + } + + +
    a
    \ No newline at end of file diff --git a/test/runtime/samples/transition-js-dynamic-component/B.html b/test/runtime/samples/transition-js-dynamic-component/B.html index 4ebe317ca..d242d866f 100644 --- a/test/runtime/samples/transition-js-dynamic-component/B.html +++ b/test/runtime/samples/transition-js-dynamic-component/B.html @@ -1,16 +1,12 @@ -
    b
    - \ No newline at end of file + }; + } + + +
    b
    \ No newline at end of file diff --git a/test/runtime/samples/transition-js-dynamic-component/_config.js b/test/runtime/samples/transition-js-dynamic-component/_config.js index bb4cace57..c7affda07 100644 --- a/test/runtime/samples/transition-js-dynamic-component/_config.js +++ b/test/runtime/samples/transition-js-dynamic-component/_config.js @@ -1,8 +1,5 @@ export default { - nestedTransitions: true, - skipIntroByDefault: true, - - data: { + props: { x: true, }, @@ -10,8 +7,8 @@ export default {
    a
    `, - test (assert, component, target, window, raf) { - component.set({ x: false }); + test({ assert, component, target, window, raf }) { + component.x = false; assert.htmlEqual(target.innerHTML, `
    a
    diff --git a/test/runtime/samples/transition-js-dynamic-component/main.html b/test/runtime/samples/transition-js-dynamic-component/main.html index 02983215c..85c88d944 100644 --- a/test/runtime/samples/transition-js-dynamic-component/main.html +++ b/test/runtime/samples/transition-js-dynamic-component/main.html @@ -1,12 +1,8 @@ - - \ No newline at end of file + export let x; + + + \ No newline at end of file diff --git a/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js b/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js index 65dece1a1..6036be605 100644 --- a/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js +++ b/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js @@ -1,37 +1,36 @@ export default { - data: { + props: { name: 'world' }, - test ( assert, component, target, window, raf ) { + test({ assert, component, target, window, raf }) { global.count = 0; - component.set({ visible: true }); - assert.equal( global.count, 1 ); - const div = target.querySelector( 'div' ); - assert.equal( div.foo, 0 ); + component.visible = true; + assert.equal(global.count, 1); + const div = target.querySelector('div'); + assert.equal(div.foo, 0); - raf.tick( 75 ); - component.set({ name: 'everybody' }); - assert.equal( div.foo, 0.75 ); - assert.htmlEqual( div.innerHTML, 'hello everybody!' ); + raf.tick(75); + component.name = 'everybody'; + assert.equal(div.foo, 0.75); + assert.htmlEqual(div.innerHTML, 'hello everybody!'); - component.set({ visible: false, name: 'again' }); - assert.htmlEqual( div.innerHTML, 'hello everybody!' ); + component.visible = false; + component.name = 'again'; + assert.htmlEqual(div.innerHTML, 'hello everybody!'); - raf.tick( 125 ); - assert.equal( div.foo, 0.25 ); + raf.tick(125); + assert.equal(div.foo, 0.25); - component.set({ visible: true }); - raf.tick( 175 ); - assert.equal( div.foo, 0.75 ); - assert.htmlEqual( div.innerHTML, 'hello again!' ); + component.visible = true; + raf.tick(175); + assert.equal(div.foo, 0.75); + assert.htmlEqual(div.innerHTML, 'hello again!'); - raf.tick( 200 ); - assert.equal( div.foo, 1 ); + raf.tick(200); + assert.equal(div.foo, 1); - raf.tick( 225 ); - - component.destroy(); + raf.tick(225); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-dynamic-if-block-bidi/main.html b/test/runtime/samples/transition-js-dynamic-if-block-bidi/main.html index fba00bcd3..5c28cc164 100644 --- a/test/runtime/samples/transition-js-dynamic-if-block-bidi/main.html +++ b/test/runtime/samples/transition-js-dynamic-if-block-bidi/main.html @@ -1,19 +1,18 @@ -{#if visible} -
    hello {name}!
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    hello {name}!
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-intro-outro/_config.js b/test/runtime/samples/transition-js-each-block-intro-outro/_config.js index da79b64d5..3a764c561 100644 --- a/test/runtime/samples/transition-js-each-block-intro-outro/_config.js +++ b/test/runtime/samples/transition-js-each-block-intro-outro/_config.js @@ -1,43 +1,41 @@ export default { - data: { + props: { visible: false, things: [ 'a', 'b', 'c' ] }, - test ( assert, component, target, window, raf ) { - component.set({ visible: true }); - const divs = target.querySelectorAll( 'div' ); - assert.equal( divs[0].foo, 0 ); - assert.equal( divs[1].foo, 0 ); - assert.equal( divs[2].foo, 0 ); + test({ assert, component, target, window, raf }) { + component.visible = true; + const divs = target.querySelectorAll('div'); + assert.equal(divs[0].foo, 0); + assert.equal(divs[1].foo, 0); + assert.equal(divs[2].foo, 0); - raf.tick( 50 ); - assert.equal( divs[0].foo, 0.5 ); - assert.equal( divs[1].foo, 0.5 ); - assert.equal( divs[2].foo, 0.5 ); + raf.tick(50); + assert.equal(divs[0].foo, 0.5); + assert.equal(divs[1].foo, 0.5); + assert.equal(divs[2].foo, 0.5); - component.set({ visible: false }); + component.visible = false; - raf.tick( 70 ); - assert.equal( divs[0].foo, 0.7 ); - assert.equal( divs[1].foo, 0.7 ); - assert.equal( divs[2].foo, 0.7 ); + raf.tick(70); + assert.equal(divs[0].foo, 0.7); + assert.equal(divs[1].foo, 0.7); + assert.equal(divs[2].foo, 0.7); - assert.equal( divs[0].bar, 0.8 ); - assert.equal( divs[1].bar, 0.8 ); - assert.equal( divs[2].bar, 0.8 ); + assert.equal(divs[0].bar, 0.8); + assert.equal(divs[1].bar, 0.8); + assert.equal(divs[2].bar, 0.8); - component.set({ visible: true }); + component.visible = true; - raf.tick( 100 ); - assert.equal( divs[0].foo, 0.3 ); - assert.equal( divs[1].foo, 0.3 ); - assert.equal( divs[2].foo, 0.3 ); + raf.tick(100); + assert.equal(divs[0].foo, 0.3); + assert.equal(divs[1].foo, 0.3); + assert.equal(divs[2].foo, 0.3); - assert.equal( divs[0].bar, 1 ); - assert.equal( divs[1].bar, 1 ); - assert.equal( divs[2].bar, 1 ); - - component.destroy(); + assert.equal(divs[0].bar, 1); + assert.equal(divs[1].bar, 1); + assert.equal(divs[2].bar, 1); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-intro-outro/main.html b/test/runtime/samples/transition-js-each-block-intro-outro/main.html index 08b239840..a582a22eb 100644 --- a/test/runtime/samples/transition-js-each-block-intro-outro/main.html +++ b/test/runtime/samples/transition-js-each-block-intro-outro/main.html @@ -1,29 +1,28 @@ + + {#each things as thing} {#if visible}
    {thing}
    {/if} -{/each} - - \ No newline at end of file +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-intro/_config.js b/test/runtime/samples/transition-js-each-block-intro/_config.js index 7deb8c97a..3d143ea51 100644 --- a/test/runtime/samples/transition-js-each-block-intro/_config.js +++ b/test/runtime/samples/transition-js-each-block-intro/_config.js @@ -1,32 +1,32 @@ export default { - data: { - things: [ 'a', 'b', 'c' ] + props: { + things: ['a', 'b', 'c'] }, - test ( assert, component, target, window, raf ) { - let divs = target.querySelectorAll( 'div' ); - assert.equal( divs[0].foo, 0 ); - assert.equal( divs[1].foo, 0 ); - assert.equal( divs[2].foo, 0 ); + intro: true, - raf.tick( 50 ); - assert.equal( divs[0].foo, 0.5 ); - assert.equal( divs[1].foo, 0.5 ); - assert.equal( divs[2].foo, 0.5 ); + test({ assert, component, target, window, raf }) { + let divs = target.querySelectorAll('div'); + assert.equal(divs[0].foo, 0); + assert.equal(divs[1].foo, 0); + assert.equal(divs[2].foo, 0); - component.set({ things: [ 'a', 'b', 'c', 'd' ] }); - divs = target.querySelectorAll( 'div' ); - assert.equal( divs[0].foo, 0.5 ); - assert.equal( divs[1].foo, 0.5 ); - assert.equal( divs[2].foo, 0.5 ); - assert.equal( divs[3].foo, 0 ); + raf.tick(50); + assert.equal(divs[0].foo, 0.5); + assert.equal(divs[1].foo, 0.5); + assert.equal(divs[2].foo, 0.5); - raf.tick( 75 ); - assert.equal( divs[0].foo, 0.75 ); - assert.equal( divs[1].foo, 0.75 ); - assert.equal( divs[2].foo, 0.75 ); - assert.equal( divs[3].foo, 0.25 ); + component.things = ['a', 'b', 'c', 'd']; + divs = target.querySelectorAll('div'); + assert.equal(divs[0].foo, 0.5); + assert.equal(divs[1].foo, 0.5); + assert.equal(divs[2].foo, 0.5); + assert.equal(divs[3].foo, 0); - component.destroy(); + raf.tick(75); + assert.equal(divs[0].foo, 0.75); + assert.equal(divs[1].foo, 0.75); + assert.equal(divs[2].foo, 0.75); + assert.equal(divs[3].foo, 0.25); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-intro/main.html b/test/runtime/samples/transition-js-each-block-intro/main.html index 4264a2d68..d19924af6 100644 --- a/test/runtime/samples/transition-js-each-block-intro/main.html +++ b/test/runtime/samples/transition-js-each-block-intro/main.html @@ -1,18 +1,16 @@ -{#each things as thing} -
    {thing}
    -{/each} - \ No newline at end of file + }; + } + + +{#each things as thing} +
    {thing}
    +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js index 0b5c3a1d1..083752cbd 100644 --- a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js +++ b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { things: [ { name: 'a' }, { name: 'b' }, @@ -7,59 +7,57 @@ export default { ] }, - test ( assert, component, target, window, raf ) { - const divs = target.querySelectorAll( 'div' ); + intro: true, + + test({ assert, component, target, window, raf }) { + const divs = target.querySelectorAll('div'); divs[0].i = 0; // for debugging divs[1].i = 1; divs[2].i = 2; - assert.equal( divs[0].foo, 0 ); - assert.equal( divs[1].foo, 0 ); - assert.equal( divs[2].foo, 0 ); - - raf.tick( 100 ); - assert.equal( divs[0].foo, 1 ); - assert.equal( divs[1].foo, 1 ); - assert.equal( divs[2].foo, 1 ); - - component.set({ - things: [ - { name: 'a' }, - { name: 'c' } - ] - }); + assert.equal(divs[0].foo, 0); + assert.equal(divs[1].foo, 0); + assert.equal(divs[2].foo, 0); - const divs2 = target.querySelectorAll( 'div' ); - assert.strictEqual( divs[0], divs2[0] ); - assert.strictEqual( divs[1], divs2[1] ); - assert.strictEqual( divs[2], divs2[2] ); + raf.tick(100); + assert.equal(divs[0].foo, 1); + assert.equal(divs[1].foo, 1); + assert.equal(divs[2].foo, 1); - raf.tick( 150 ); - assert.equal( divs[0].foo, 1 ); - assert.equal( divs[1].foo, 0.5 ); - assert.equal( divs[2].foo, 1 ); - - component.set({ - things: [ - { name: 'a' }, - { name: 'b' }, - { name: 'c' } - ] - }); + component.things = [ + { name: 'a' }, + { name: 'c' } + ]; - raf.tick( 175 ); - assert.equal( divs[0].foo, 1 ); - assert.equal( divs[1].foo, 0.75 ); - assert.equal( divs[2].foo, 1 ); + const divs2 = target.querySelectorAll('div'); + assert.strictEqual(divs[0], divs2[0]); + assert.strictEqual(divs[1], divs2[1]); + assert.strictEqual(divs[2], divs2[2]); - raf.tick( 225 ); - const divs3 = target.querySelectorAll( 'div' ); - assert.strictEqual( divs[0], divs3[0] ); - assert.strictEqual( divs[1], divs3[1] ); - assert.strictEqual( divs[2], divs3[2] ); + raf.tick(150); + assert.equal(divs[0].foo, 1); + assert.equal(divs[1].foo, 0.5); + assert.equal(divs[2].foo, 1); - assert.equal( divs[0].foo, 1 ); - assert.equal( divs[1].foo, 1 ); - assert.equal( divs[2].foo, 1 ); + component.things = [ + { name: 'a' }, + { name: 'b' }, + { name: 'c' } + ]; + + raf.tick(175); + assert.equal(divs[0].foo, 1); + assert.equal(divs[1].foo, 0.75); + assert.equal(divs[2].foo, 1); + + raf.tick(225); + const divs3 = target.querySelectorAll('div'); + assert.strictEqual(divs[0], divs3[0]); + assert.strictEqual(divs[1], divs3[1]); + assert.strictEqual(divs[2], divs3[2]); + + assert.equal(divs[0].foo, 1); + assert.equal(divs[1].foo, 1); + assert.equal(divs[2].foo, 1); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/main.html b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/main.html index 111f081d9..89282dafe 100644 --- a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/main.html +++ b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/main.html @@ -1,18 +1,16 @@ -{#each things as thing (thing.name)} -
    {thing.name}
    -{/each} - \ No newline at end of file + }; + } + + +{#each things as thing (thing.name)} +
    {thing.name}
    +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js index dc61ac5ea..5886cc5c6 100644 --- a/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js +++ b/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { things: [ { name: 'a' }, { name: 'b' }, @@ -7,43 +7,41 @@ export default { ] }, - test ( assert, component, target, window, raf ) { - let divs = target.querySelectorAll( 'div' ); - assert.equal( divs[0].foo, 0 ); - assert.equal( divs[1].foo, 0 ); - assert.equal( divs[2].foo, 0 ); + intro: true, - raf.tick( 50 ); - assert.equal( divs[0].foo, 0.5 ); - assert.equal( divs[1].foo, 0.5 ); - assert.equal( divs[2].foo, 0.5 ); + test({ assert, component, target, window, raf }) { + let divs = target.querySelectorAll('div'); + assert.equal(divs[0].foo, 0); + assert.equal(divs[1].foo, 0); + assert.equal(divs[2].foo, 0); - component.set({ - things: [ - { name: 'a' }, - { name: 'woo!' }, - { name: 'b' }, - { name: 'c' } - ] - }); - assert.htmlEqual( target.innerHTML, ` + raf.tick(50); + assert.equal(divs[0].foo, 0.5); + assert.equal(divs[1].foo, 0.5); + assert.equal(divs[2].foo, 0.5); + + component.things = [ + { name: 'a' }, + { name: 'woo!' }, + { name: 'b' }, + { name: 'c' } + ]; + assert.htmlEqual(target.innerHTML, `
    a
    woo!
    b
    c
    - ` ); - divs = target.querySelectorAll( 'div' ); - assert.equal( divs[0].foo, 0.5 ); - assert.equal( divs[1].foo, 0 ); - assert.equal( divs[2].foo, 0.5 ); - assert.equal( divs[3].foo, 0.5 ); - - raf.tick( 75 ); - assert.equal( divs[0].foo, 0.75 ); - assert.equal( divs[1].foo, 0.25 ); - assert.equal( divs[2].foo, 0.75 ); - assert.equal( divs[3].foo, 0.75 ); + `); + divs = target.querySelectorAll('div'); + assert.equal(divs[0].foo, 0.5); + assert.equal(divs[1].foo, 0); + assert.equal(divs[2].foo, 0.5); + assert.equal(divs[3].foo, 0.5); - component.destroy(); + raf.tick(75); + assert.equal(divs[0].foo, 0.75); + assert.equal(divs[1].foo, 0.25); + assert.equal(divs[2].foo, 0.75); + assert.equal(divs[3].foo, 0.75); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro/main.html b/test/runtime/samples/transition-js-each-block-keyed-intro/main.html index f6a89b5b0..69697b444 100644 --- a/test/runtime/samples/transition-js-each-block-keyed-intro/main.html +++ b/test/runtime/samples/transition-js-each-block-keyed-intro/main.html @@ -1,18 +1,16 @@ -{#each things as thing (thing.name)} -
    {thing.name}
    -{/each} - \ No newline at end of file + }; + } + + +{#each things as thing (thing.name)} +
    {thing.name}
    +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js index 567a671d2..03e8c147c 100644 --- a/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js +++ b/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { things: [ { name: 'a' }, { name: 'b' }, @@ -7,15 +7,13 @@ export default { ] }, - test ( assert, component, target, window, raf ) { + test({ assert, component, target, window, raf }) { const divs = target.querySelectorAll( 'div' ); - component.set({ - things: [ - { name: 'a' }, - { name: 'c' } - ] - }); + component.things = [ + { name: 'a' }, + { name: 'c' } + ]; const divs2 = target.querySelectorAll( 'div' ); assert.strictEqual( divs[0], divs2[0] ); diff --git a/test/runtime/samples/transition-js-each-block-keyed-outro/main.html b/test/runtime/samples/transition-js-each-block-keyed-outro/main.html index e0d9722cf..58d425d13 100644 --- a/test/runtime/samples/transition-js-each-block-keyed-outro/main.html +++ b/test/runtime/samples/transition-js-each-block-keyed-outro/main.html @@ -1,18 +1,16 @@ -{#each things as thing (thing.name)} -
    {thing.name}
    -{/each} - \ No newline at end of file + }; + } + + +{#each things as thing (thing.name)} +
    {thing.name}
    +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-each-block-outro/_config.js b/test/runtime/samples/transition-js-each-block-outro/_config.js index 0ce657308..f8d4410e9 100644 --- a/test/runtime/samples/transition-js-each-block-outro/_config.js +++ b/test/runtime/samples/transition-js-each-block-outro/_config.js @@ -1,12 +1,12 @@ export default { - data: { + props: { things: [ 'a', 'b', 'c' ] }, - test ( assert, component, target, window, raf ) { + test({ assert, component, target, window, raf }) { const divs = target.querySelectorAll( 'div' ); - component.set({ things: [ 'a' ] }); + component.things = [ 'a' ]; raf.tick( 50 ); assert.equal( divs[0].foo, undefined ); diff --git a/test/runtime/samples/transition-js-each-block-outro/main.html b/test/runtime/samples/transition-js-each-block-outro/main.html index dc8c2dce6..77301a25f 100644 --- a/test/runtime/samples/transition-js-each-block-outro/main.html +++ b/test/runtime/samples/transition-js-each-block-outro/main.html @@ -1,18 +1,16 @@ -{#each things as thing} -
    {thing}
    -{/each} - \ No newline at end of file + }; + } + + +{#each things as thing} +
    {thing}
    +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-events/_config.js b/test/runtime/samples/transition-js-events/_config.js index 71e9ccd39..05f4a0c88 100644 --- a/test/runtime/samples/transition-js-events/_config.js +++ b/test/runtime/samples/transition-js-events/_config.js @@ -1,35 +1,35 @@ export default { - data: { + props: { visible: true, things: ['a', 'b', 'c', 'd'] }, - test (assert, component, target, window, raf) { + intro: true, + + test({ assert, component, target, window, raf }) { raf.tick(50); assert.deepEqual(component.intros.sort(), ['a', 'b', 'c', 'd']); - assert.equal(component.introCount, 4); + assert.equal(component.intro_count, 4); raf.tick(100); - assert.equal(component.introCount, 0); + assert.equal(component.intro_count, 0); - component.set({ visible: false }); + component.visible = false; raf.tick(150); assert.deepEqual(component.outros.sort(), ['a', 'b', 'c', 'd']); - assert.equal(component.outroCount, 4); + assert.equal(component.outro_count, 4); raf.tick(200); - assert.equal(component.outroCount, 0); + assert.equal(component.outro_count, 0); - component.set({ visible: true }); - component.on('intro.start', () => { + component.visible = true; + component.$on('intro.start', () => { throw new Error(`intro.start should fire during set(), not after`); }); raf.tick(250); assert.deepEqual(component.intros.sort(), ['a', 'a', 'b', 'b', 'c', 'c', 'd', 'd']); - assert.equal(component.introCount, 4); - - component.destroy(); + assert.equal(component.intro_count, 4); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-events/main.html b/test/runtime/samples/transition-js-events/main.html index 93ab47a8a..909cfe981 100644 --- a/test/runtime/samples/transition-js-events/main.html +++ b/test/runtime/samples/transition-js-events/main.html @@ -1,45 +1,50 @@ + + {#each things as thing} {#if visible} -

    {thing}

    +

    {thing}

    {/if} -{/each} - - \ No newline at end of file +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-bidi/_config.js b/test/runtime/samples/transition-js-if-block-bidi/_config.js index 8a6db1007..a070f978e 100644 --- a/test/runtime/samples/transition-js-if-block-bidi/_config.js +++ b/test/runtime/samples/transition-js-if-block-bidi/_config.js @@ -1,30 +1,28 @@ export default { - test ( assert, component, target, window, raf ) { + test({ assert, component, target, window, raf }) { global.count = 0; - component.set({ visible: true }); - assert.equal( global.count, 1 ); - const div = target.querySelector( 'div' ); - assert.equal( div.foo, 0 ); + component.visible = true; + assert.equal(global.count, 1); + const div = target.querySelector('div'); + assert.equal(div.foo, 0); - raf.tick( 300 ); - assert.equal( div.foo, 0.75 ); + raf.tick(300); + assert.equal(div.foo, 0.75); - component.set({ visible: false }); - assert.equal( global.count, 1 ); + component.visible = false; + assert.equal(global.count, 1); - raf.tick( 500 ); - assert.equal( div.foo, 0.25 ); + raf.tick(500); + assert.equal(div.foo, 0.25); - component.set({ visible: true }); - raf.tick( 700 ); - assert.equal( div.foo, 0.75 ); + component.visible = true; + raf.tick(700); + assert.equal(div.foo, 0.75); - raf.tick( 800 ); - assert.equal( div.foo, 1 ); + raf.tick(800); + assert.equal(div.foo, 1); - raf.tick( 900 ); - - component.destroy(); + raf.tick(900); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-bidi/main.html b/test/runtime/samples/transition-js-if-block-bidi/main.html index 379acc128..1a34ef51b 100644 --- a/test/runtime/samples/transition-js-if-block-bidi/main.html +++ b/test/runtime/samples/transition-js-if-block-bidi/main.html @@ -1,19 +1,17 @@ -{#if visible} -
    foo bidi
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    foo bidi
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js index 60115a035..338586636 100644 --- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js +++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js @@ -1,6 +1,6 @@ export default { - data: { - foo: false, + props: { + visible: false, threshold: 5 }, @@ -12,21 +12,17 @@ export default {
    5
    `, - test ( assert, component, target, window, raf ) { - const divs = target.querySelectorAll('div'); - + test({ assert, component, target, window, raf }) { raf.tick(100); - component.set({ threshold: 4 }); + component.threshold = 4; - raf.tick( 200 ); + raf.tick(200); assert.htmlEqual(target.innerHTML, `
    1
    2
    3
    4
    `); - - component.destroy(); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/main.html b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/main.html index 97a2cb5a0..cffb940f3 100644 --- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/main.html +++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/main.html @@ -1,5 +1,19 @@ + + {#each [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as number} - {#if foo} + {#if visible} {#if threshold >= number}
    {number}
    {/if} @@ -8,19 +22,4 @@
    {number}
    {/if} {/if} -{/each} - - \ No newline at end of file +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/_config.js index bcb5a9e05..261731c70 100644 --- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/_config.js +++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/_config.js @@ -1,6 +1,6 @@ export default { - data: { - foo: false, + props: { + visible: false, threshold: 5 }, @@ -12,17 +12,17 @@ export default {
    5
    `, - test ( assert, component, target, window, raf ) { + test({ assert, component, target, window, raf }) { const divs = target.querySelectorAll('div'); raf.tick(100); - component.set({ threshold: 4 }); + component.threshold = 4; raf.tick(150); - component.set({ threshold: 5 }); + component.threshold = 5; raf.tick(200); - component.set({ threshold: 5.5 }); + component.threshold = 5.5; assert.htmlEqual(target.innerHTML, `
    1
    @@ -31,7 +31,5 @@ export default {
    4
    5
    `); - - component.destroy(); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/main.html b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/main.html index 97a2cb5a0..cffb940f3 100644 --- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/main.html +++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/main.html @@ -1,5 +1,19 @@ + + {#each [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as number} - {#if foo} + {#if visible} {#if threshold >= number}
    {number}
    {/if} @@ -8,19 +22,4 @@
    {number}
    {/if} {/if} -{/each} - - \ No newline at end of file +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js index f7ce77805..4c75e3ef0 100644 --- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js +++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { threshold: 5 }, @@ -11,7 +11,9 @@ export default {
    5
    `, - test ( assert, component, target, window, raf ) { + intro: true, + + test({ assert, component, target, window, raf }) { const divs = target.querySelectorAll('div'); assert.equal(divs[0].foo, 0); @@ -19,10 +21,10 @@ export default { raf.tick(100); assert.equal(divs[0].foo, 1); - component.set({ threshold: 4 }); - assert.equal( divs[4].foo, 1 ); + component.threshold = 4; + assert.equal(divs[4].foo, 1); - raf.tick( 200 ); + raf.tick(200); assert.htmlEqual(target.innerHTML, `
    1
    2
    @@ -30,16 +32,14 @@ export default {
    4
    `); - component.set({ threshold: 3 }); - assert.equal( divs[3].foo, 1 ); + component.threshold = 3; + assert.equal(divs[3].foo, 1); - raf.tick( 300 ); + raf.tick(300); assert.htmlEqual(target.innerHTML, `
    1
    2
    3
    `); - - component.destroy(); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/main.html b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/main.html index ac9ce0a18..5d85e51c7 100644 --- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/main.html +++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/main.html @@ -1,20 +1,18 @@ + + {#each [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as number} {#if threshold >= number}
    {number}
    {/if} -{/each} - - \ No newline at end of file +{/each} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-intro-outro/_config.js b/test/runtime/samples/transition-js-if-block-intro-outro/_config.js index 146ac082d..e6512c93e 100644 --- a/test/runtime/samples/transition-js-if-block-intro-outro/_config.js +++ b/test/runtime/samples/transition-js-if-block-intro-outro/_config.js @@ -1,46 +1,44 @@ export default { - test ( assert, component, target, window, raf ) { - component.set({ visible: true }); - let div = target.querySelector( 'div' ); - assert.equal( div.foo, 0 ); + test({ assert, component, target, window, raf }) { + component.visible = true; + let div = target.querySelector('div'); + assert.equal(div.foo, 0); - raf.tick( 200 ); - assert.equal( div.foo, 0.5 ); + raf.tick(200); + assert.equal(div.foo, 0.5); - raf.tick( 400 ); - assert.equal( div.foo, 1 ); + raf.tick(400); + assert.equal(div.foo, 1); - raf.tick( 500 ); - assert.equal( div.foo, 1 ); + raf.tick(500); + assert.equal(div.foo, 1); - component.set({ visible: false }); - raf.tick( 600 ); - assert.equal( div.foo, 1 ); - assert.equal( div.bar, 0.75 ); + component.visible = false; + raf.tick(600); + assert.equal(div.foo, 1); + assert.equal(div.bar, 0.75); - raf.tick( 900 ); - assert.equal( div.foo, 1 ); - assert.equal( div.bar, 0 ); + raf.tick(900); + assert.equal(div.foo, 1); + assert.equal(div.bar, 0); // test outro before intro complete - raf.tick( 1000 ); - component.set({ visible: true }); - div = target.querySelector( 'div' ); + raf.tick(1000); + component.visible = true; + div = target.querySelector('div'); - raf.tick( 1200 ); - assert.equal( div.foo, 0.5 ); + raf.tick(1200); + assert.equal(div.foo, 0.5); - component.set({ visible: false }); - raf.tick( 1300 ); - assert.equal( div.foo, 0.75 ); - assert.equal( div.bar, 0.75 ); + component.visible = false; + raf.tick(1300); + assert.equal(div.foo, 0.75); + assert.equal(div.bar, 0.75); - raf.tick( 1400 ); - assert.equal( div.foo, 1 ); - assert.equal( div.bar, 0.5 ); + raf.tick(1400); + assert.equal(div.foo, 1); + assert.equal(div.bar, 0.5); - raf.tick( 2000 ); - - component.destroy(); + raf.tick(2000); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-intro-outro/main.html b/test/runtime/samples/transition-js-if-block-intro-outro/main.html index f9b8cb445..812356106 100644 --- a/test/runtime/samples/transition-js-if-block-intro-outro/main.html +++ b/test/runtime/samples/transition-js-if-block-intro-outro/main.html @@ -1,27 +1,25 @@ -{#if visible} -
    foo then bar
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    foo then bar
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-intro/_config.js b/test/runtime/samples/transition-js-if-block-intro/_config.js index 04d3c6245..93ef8391f 100644 --- a/test/runtime/samples/transition-js-if-block-intro/_config.js +++ b/test/runtime/samples/transition-js-if-block-intro/_config.js @@ -1,17 +1,15 @@ export default { - test ( assert, component, target, window, raf ) { - component.set({ visible: true }); - const div = target.querySelector( 'div' ); - assert.equal( window.getComputedStyle( div ).opacity, 0 ); + test({ assert, component, target, window, raf }) { + component.visible = true; + const div = target.querySelector('div'); + assert.equal(window.getComputedStyle(div).opacity, 0); - raf.tick( 200 ); - assert.equal( window.getComputedStyle( div ).opacity, 0.5 ); + raf.tick(200); + assert.equal(window.getComputedStyle(div).opacity, 0.5); - raf.tick( 400 ); - assert.equal( window.getComputedStyle( div ).opacity, 1 ); + raf.tick(400); + assert.equal(window.getComputedStyle(div).opacity, 1); - raf.tick( 500 ); - - component.destroy(); + raf.tick(500); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-intro/main.html b/test/runtime/samples/transition-js-if-block-intro/main.html index fb089a6c8..3be2daa56 100644 --- a/test/runtime/samples/transition-js-if-block-intro/main.html +++ b/test/runtime/samples/transition-js-if-block-intro/main.html @@ -1,18 +1,16 @@ -{#if visible} -
    fades in
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    fades in
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-outro-timeout/_config.js b/test/runtime/samples/transition-js-if-block-outro-timeout/_config.js index cacc88669..5c5d33ff2 100644 --- a/test/runtime/samples/transition-js-if-block-outro-timeout/_config.js +++ b/test/runtime/samples/transition-js-if-block-outro-timeout/_config.js @@ -1,22 +1,20 @@ export default { - test ( assert, component, target, window, raf ) { - component.set({ visible: true }); + test({ assert, component, target, window, raf }) { + component.visible = true; const div = target.querySelector('div'); - component.set({ visible: false }); + component.visible = false; assert.equal(window.getComputedStyle(div).opacity, 1); raf.tick(200); assert.equal(window.getComputedStyle(div).opacity, 0.5); - component.set({ blabla: false }); + component.blabla = false; raf.tick(400); assert.equal(window.getComputedStyle(div).opacity, 0); raf.tick(600); - assert.equal(component.refs.div, undefined); + assert.equal(component.div, undefined); assert.equal(target.querySelector('div'), undefined); - - component.destroy(); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-outro-timeout/main.html b/test/runtime/samples/transition-js-if-block-outro-timeout/main.html index 7b627a9f7..2e819c79a 100644 --- a/test/runtime/samples/transition-js-if-block-outro-timeout/main.html +++ b/test/runtime/samples/transition-js-if-block-outro-timeout/main.html @@ -1,18 +1,17 @@ -{#if visible} -
    yes
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    yes
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js index 3ea707983..c15b3ac9c 100644 --- a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js +++ b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js @@ -1,22 +1,21 @@ export default { - data: { + props: { z: 'z' }, - test ( assert, component, target, window, raf ) { - assert.equal( target.querySelector( 'div' ), component.refs.no ); + test({ assert, component, target, window, raf }) { + assert.equal(target.querySelector('div'), component.no); - component.set({ x: true }); + component.x = true; - raf.tick( 25 ); - assert.equal( component.refs.yes.foo, undefined ); - assert.equal( component.refs.no.foo, 0.75 ); + raf.tick(25); + assert.equal(component.yes.foo, undefined); + assert.equal(component.no.foo, 0.75); - raf.tick( 75 ); - assert.equal( component.refs.yes.foo, undefined ); - assert.equal( component.refs.no.foo, 0.25 ); + raf.tick(75); + assert.equal(component.yes.foo, undefined); + assert.equal(component.no.foo, 0.25); - raf.tick( 100 ); - component.destroy(); + raf.tick(100); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/main.html b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/main.html index 495bfe1d3..41809bd66 100644 --- a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/main.html +++ b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/main.html @@ -1,20 +1,22 @@ + + {#if x}
    {z}
    {:else}
    {z}
    -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-else-block-intro/_config.js b/test/runtime/samples/transition-js-if-else-block-intro/_config.js index 768b16567..2bf1483da 100644 --- a/test/runtime/samples/transition-js-if-else-block-intro/_config.js +++ b/test/runtime/samples/transition-js-if-else-block-intro/_config.js @@ -1,21 +1,21 @@ export default { - test ( assert, component, target, window, raf ) { - assert.equal( target.querySelector( 'div' ), component.refs.no ); - assert.equal( component.refs.no.foo, 0 ); + intro: true, - raf.tick( 200 ); - assert.equal( component.refs.no.foo, 0.5 ); + test({ assert, component, target, window, raf }) { + assert.equal(target.querySelector('div'), component.no); + assert.equal(component.no.foo, 0); - raf.tick( 500 ); - component.set({ x: true }); - assert.equal( component.refs.no, undefined ); - assert.equal( component.refs.yes.foo, 0 ); + raf.tick(200); + assert.equal(component.no.foo, 0.5); - raf.tick( 700 ); - assert.equal( component.refs.yes.foo, 0.5 ); + raf.tick(500); + component.x = true; + assert.equal(component.no, undefined); + assert.equal(component.yes.foo, 0); - raf.tick( 1000 ); + raf.tick(700); + assert.equal(component.yes.foo, 0.5); - component.destroy(); + raf.tick(1000); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-else-block-intro/main.html b/test/runtime/samples/transition-js-if-else-block-intro/main.html index 0ff96c13e..117f2ba8e 100644 --- a/test/runtime/samples/transition-js-if-else-block-intro/main.html +++ b/test/runtime/samples/transition-js-if-else-block-intro/main.html @@ -1,20 +1,21 @@ + + {#if x}
    yes
    {:else}
    no
    -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-else-block-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-outro/_config.js index 98053c817..4332ce82a 100644 --- a/test/runtime/samples/transition-js-if-else-block-outro/_config.js +++ b/test/runtime/samples/transition-js-if-else-block-outro/_config.js @@ -1,18 +1,17 @@ export default { - test ( assert, component, target, window, raf ) { - assert.equal( target.querySelector( 'div' ), component.refs.no ); + test({ assert, component, target, window, raf }) { + assert.equal(target.querySelector('div'), component.no); - component.set({ x: true }); + component.x = true; - raf.tick( 25 ); - assert.equal( component.refs.yes.foo, undefined ); - assert.equal( component.refs.no.foo, 0.75 ); + raf.tick(25); + assert.equal(component.yes.foo, undefined); + assert.equal(component.no.foo, 0.75); - raf.tick( 75 ); - assert.equal( component.refs.yes.foo, undefined ); - assert.equal( component.refs.no.foo, 0.25 ); + raf.tick(75); + assert.equal(component.yes.foo, undefined); + assert.equal(component.no.foo, 0.25); - raf.tick( 100 ); - component.destroy(); + raf.tick(100); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-else-block-outro/main.html b/test/runtime/samples/transition-js-if-else-block-outro/main.html index 29b42fac5..ba5c76214 100644 --- a/test/runtime/samples/transition-js-if-else-block-outro/main.html +++ b/test/runtime/samples/transition-js-if-else-block-outro/main.html @@ -1,20 +1,21 @@ + + {#if x}
    yes
    {:else}
    no
    -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js b/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js index fad2d41e3..f8886f889 100644 --- a/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js +++ b/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js @@ -1,23 +1,23 @@ export default { - data: { + props: { x: false, y: true }, - test ( assert, component, target, window, raf ) { - assert.equal( target.querySelector( 'div' ), component.refs.no ); + test({ assert, component, target, window, raf }) { + assert.equal(target.querySelector('div'), component.no); - component.set({ x: true, y: false }); + component.x = true; + component.y = false; - raf.tick( 25 ); - assert.equal( component.refs.yes.foo, undefined ); - assert.equal( component.refs.no.foo, 0.75 ); + raf.tick(25); + assert.equal(component.yes.foo, undefined); + assert.equal(component.no.foo, 0.75); - raf.tick( 75 ); - assert.equal( component.refs.yes.foo, undefined ); - assert.equal( component.refs.no.foo, 0.25 ); + raf.tick(75); + assert.equal(component.yes.foo, undefined); + assert.equal(component.no.foo, 0.25); - raf.tick( 100 ); - component.destroy(); + raf.tick(100); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-elseif-block-outro/main.html b/test/runtime/samples/transition-js-if-elseif-block-outro/main.html index 007273688..ca4e4301d 100644 --- a/test/runtime/samples/transition-js-if-elseif-block-outro/main.html +++ b/test/runtime/samples/transition-js-if-elseif-block-outro/main.html @@ -1,20 +1,22 @@ + + {#if x}
    yes
    {:elseif y}
    no
    -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-initial/_config.js b/test/runtime/samples/transition-js-initial/_config.js index 752780d6f..3760a1cbf 100644 --- a/test/runtime/samples/transition-js-initial/_config.js +++ b/test/runtime/samples/transition-js-initial/_config.js @@ -1,5 +1,7 @@ export default { - test(assert, component, target, window, raf) { + test({ assert, component, target, window, raf }) { + component.visible = true; + const div = target.querySelector('div'); assert.equal(div.foo, 0); diff --git a/test/runtime/samples/transition-js-initial/main.html b/test/runtime/samples/transition-js-initial/main.html index 16ced20bc..848055f66 100644 --- a/test/runtime/samples/transition-js-initial/main.html +++ b/test/runtime/samples/transition-js-initial/main.html @@ -1,16 +1,16 @@ -
    - \ No newline at end of file + }; + } + + +{#if visible} +
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js index f3124450d..4b5f1cf98 100644 --- a/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js +++ b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js @@ -1,8 +1,9 @@ export default { - skipIntroByDefault: true, intro: true, - test(assert, component, target, window, raf) { + skip_if_hydrate: true, + + test({ assert, component, target, window, raf }) { const div = target.querySelector('div'); assert.equal(div.foo, 0); diff --git a/test/runtime/samples/transition-js-intro-enabled-by-option/main.html b/test/runtime/samples/transition-js-intro-enabled-by-option/main.html index 16ced20bc..64d17e0db 100644 --- a/test/runtime/samples/transition-js-intro-enabled-by-option/main.html +++ b/test/runtime/samples/transition-js-intro-enabled-by-option/main.html @@ -1,16 +1,12 @@ -
    - \ No newline at end of file + }; + } + + +
    \ No newline at end of file diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/Widget.html b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/Widget.html index 16ced20bc..64d17e0db 100644 --- a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/Widget.html +++ b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/Widget.html @@ -1,16 +1,12 @@ -
    - \ No newline at end of file + }; + } + + +
    \ No newline at end of file diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js index 9e63e6c8f..26bf248d5 100644 --- a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js +++ b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js @@ -1,7 +1,5 @@ export default { - skipIntroByDefault: true, - - test(assert, component, target, window, raf) { + test({ assert, component, target, window, raf }) { const div = target.querySelector('div'); assert.equal(div.foo, undefined); diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/main.html b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/main.html index fca2ea760..cbcde3f1e 100644 --- a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/main.html +++ b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/main.html @@ -1,9 +1,5 @@ - - \ No newline at end of file + import Widget from './Widget.html'; + + + \ No newline at end of file diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js index 9e63e6c8f..26bf248d5 100644 --- a/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js +++ b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js @@ -1,7 +1,5 @@ export default { - skipIntroByDefault: true, - - test(assert, component, target, window, raf) { + test({ assert, component, target, window, raf }) { const div = target.querySelector('div'); assert.equal(div.foo, undefined); diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default/main.html b/test/runtime/samples/transition-js-intro-skipped-by-default/main.html index 16ced20bc..64d17e0db 100644 --- a/test/runtime/samples/transition-js-intro-skipped-by-default/main.html +++ b/test/runtime/samples/transition-js-intro-skipped-by-default/main.html @@ -1,16 +1,12 @@ -
    - \ No newline at end of file + }; + } + + +
    \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-await/_config.js b/test/runtime/samples/transition-js-nested-await/_config.js index d688c55cf..78dbe5ae4 100644 --- a/test/runtime/samples/transition-js-nested-await/_config.js +++ b/test/runtime/samples/transition-js-nested-await/_config.js @@ -5,16 +5,13 @@ const promise = new Promise(f => { }); export default { - skipIntroByDefault: true, - nestedTransitions: true, - - data: { + props: { x: false, promise }, - test(assert, component, target, window, raf) { - component.set({ x: true }); + test({ assert, component, target, window, raf }) { + component.x = true; fulfil(); return promise.then(() => { @@ -24,7 +21,7 @@ export default { raf.tick(100); assert.equal(div.foo, 1); - component.set({ x: false }); + component.x = false; assert.htmlEqual(target.innerHTML, '
    '); raf.tick(150); diff --git a/test/runtime/samples/transition-js-nested-await/main.html b/test/runtime/samples/transition-js-nested-await/main.html index 039051a8b..bcd531c44 100644 --- a/test/runtime/samples/transition-js-nested-await/main.html +++ b/test/runtime/samples/transition-js-nested-await/main.html @@ -1,20 +1,19 @@ + + {#if x} {#await promise then value}
    {/await} -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-component/Widget.html b/test/runtime/samples/transition-js-nested-component/Widget.html index 16ced20bc..64d17e0db 100644 --- a/test/runtime/samples/transition-js-nested-component/Widget.html +++ b/test/runtime/samples/transition-js-nested-component/Widget.html @@ -1,16 +1,12 @@ -
    - \ No newline at end of file + }; + } + + +
    \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-component/_config.js b/test/runtime/samples/transition-js-nested-component/_config.js index 6f2c039a4..f1ca81c52 100644 --- a/test/runtime/samples/transition-js-nested-component/_config.js +++ b/test/runtime/samples/transition-js-nested-component/_config.js @@ -1,13 +1,10 @@ export default { - skipIntroByDefault: true, - nestedTransitions: true, - - data: { + props: { x: false }, - test(assert, component, target, window, raf) { - component.set({ x: true }); + test({ assert, component, target, window, raf }) { + component.x = true; const div = target.querySelector('div'); assert.equal(div.foo, 0); @@ -15,7 +12,7 @@ export default { raf.tick(100); assert.equal(div.foo, 1); - component.set({ x: false }); + component.x = false; assert.htmlEqual(target.innerHTML, '
    '); raf.tick(150); diff --git a/test/runtime/samples/transition-js-nested-component/main.html b/test/runtime/samples/transition-js-nested-component/main.html index 2930f4dc1..b4b3beccd 100644 --- a/test/runtime/samples/transition-js-nested-component/main.html +++ b/test/runtime/samples/transition-js-nested-component/main.html @@ -1,13 +1,9 @@ -{#if x} - -{/if} - \ No newline at end of file + export let x; + + +{#if x} + +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-each-delete/_config.js b/test/runtime/samples/transition-js-nested-each-delete/_config.js index 870f90efc..c2a886db9 100644 --- a/test/runtime/samples/transition-js-nested-each-delete/_config.js +++ b/test/runtime/samples/transition-js-nested-each-delete/_config.js @@ -1,29 +1,26 @@ export default { - nestedTransitions: true, - skipIntroByDefault: true, - - data: { + props: { visible: true, - things: [ 'a', 'b', 'c' ] + things: ['a', 'b', 'c'] }, - test ( assert, component, target, window, raf ) { + test({ assert, component, target, window, raf }) { assert.htmlEqual(target.innerHTML, `
    a
    b
    c
    `); - component.set({ things: [ 'a' ] }); + component.things = ['a']; - raf.tick( 100 ); + raf.tick(100); assert.htmlEqual(target.innerHTML, `
    a
    `); - component.set({ visible: false }); + component.visible = false; - raf.tick( 200 ); + raf.tick(200); assert.htmlEqual(target.innerHTML, ''); } }; diff --git a/test/runtime/samples/transition-js-nested-each-delete/main.html b/test/runtime/samples/transition-js-nested-each-delete/main.html index e12370703..e2cf13add 100644 --- a/test/runtime/samples/transition-js-nested-each-delete/main.html +++ b/test/runtime/samples/transition-js-nested-each-delete/main.html @@ -1,20 +1,19 @@ + + {#if visible} {#each things as thing}
    {thing}
    {/each} {/if} - - diff --git a/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js b/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js index fda0786b3..d6566ba61 100644 --- a/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js +++ b/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js @@ -1,13 +1,11 @@ export default { - nestedTransitions: true, - - data: { + props: { x: true, things: ['a', 'b'] }, - test(assert, component, target, window, raf) { - component.set({ x: false }); + test({ assert, component, target, window, raf }) { + component.x = false; assert.htmlEqual(target.innerHTML, ''); }, }; diff --git a/test/runtime/samples/transition-js-nested-each-keyed-2/main.html b/test/runtime/samples/transition-js-nested-each-keyed-2/main.html index d931f220a..11096498c 100644 --- a/test/runtime/samples/transition-js-nested-each-keyed-2/main.html +++ b/test/runtime/samples/transition-js-nested-each-keyed-2/main.html @@ -1,9 +1,10 @@ -{#if x} - -{/if} - \ No newline at end of file + export let x; + export let things; + + import Widget from './Widget.html'; + + +{#if x} + +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-each-keyed/_config.js b/test/runtime/samples/transition-js-nested-each-keyed/_config.js index 7011ada5a..3d2fe3c32 100644 --- a/test/runtime/samples/transition-js-nested-each-keyed/_config.js +++ b/test/runtime/samples/transition-js-nested-each-keyed/_config.js @@ -1,14 +1,11 @@ export default { - skipIntroByDefault: true, - nestedTransitions: true, - - data: { + props: { x: false, things: ['a'] }, - test(assert, component, target, window, raf) { - component.set({ x: true }); + test({ assert, component, target, window, raf }) { + component.x = true; const div = target.querySelector('div'); assert.equal(div.foo, 0); @@ -16,7 +13,7 @@ export default { raf.tick(100); assert.equal(div.foo, 1); - component.set({ x: false }); + component.x = false; assert.htmlEqual(target.innerHTML, '
    '); raf.tick(150); diff --git a/test/runtime/samples/transition-js-nested-each-keyed/main.html b/test/runtime/samples/transition-js-nested-each-keyed/main.html index 335380695..5f86eebf7 100644 --- a/test/runtime/samples/transition-js-nested-each-keyed/main.html +++ b/test/runtime/samples/transition-js-nested-each-keyed/main.html @@ -1,20 +1,19 @@ + + {#if x} {#each things as thing (thing)}
    {/each} -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-each/_config.js b/test/runtime/samples/transition-js-nested-each/_config.js index 7011ada5a..3d2fe3c32 100644 --- a/test/runtime/samples/transition-js-nested-each/_config.js +++ b/test/runtime/samples/transition-js-nested-each/_config.js @@ -1,14 +1,11 @@ export default { - skipIntroByDefault: true, - nestedTransitions: true, - - data: { + props: { x: false, things: ['a'] }, - test(assert, component, target, window, raf) { - component.set({ x: true }); + test({ assert, component, target, window, raf }) { + component.x = true; const div = target.querySelector('div'); assert.equal(div.foo, 0); @@ -16,7 +13,7 @@ export default { raf.tick(100); assert.equal(div.foo, 1); - component.set({ x: false }); + component.x = false; assert.htmlEqual(target.innerHTML, '
    '); raf.tick(150); diff --git a/test/runtime/samples/transition-js-nested-each/main.html b/test/runtime/samples/transition-js-nested-each/main.html index c47940c1c..f9be834a0 100644 --- a/test/runtime/samples/transition-js-nested-each/main.html +++ b/test/runtime/samples/transition-js-nested-each/main.html @@ -1,20 +1,19 @@ + + {#if x} {#each things as thing}
    {/each} -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-if/_config.js b/test/runtime/samples/transition-js-nested-if/_config.js index c8f624b2c..2fdd17da9 100644 --- a/test/runtime/samples/transition-js-nested-if/_config.js +++ b/test/runtime/samples/transition-js-nested-if/_config.js @@ -1,14 +1,11 @@ export default { - skipIntroByDefault: true, - nestedTransitions: true, - - data: { + props: { x: false, y: true }, - test(assert, component, target, window, raf) { - component.set({ x: true }); + test({ assert, component, target, window, raf }) { + component.x = true; const div = target.querySelector('div'); assert.equal(div.foo, 0); @@ -16,7 +13,7 @@ export default { raf.tick(100); assert.equal(div.foo, 1); - component.set({ x: false }); + component.x = false; assert.htmlEqual(target.innerHTML, '
    '); raf.tick(150); diff --git a/test/runtime/samples/transition-js-nested-if/main.html b/test/runtime/samples/transition-js-nested-if/main.html index cd10c9118..fac9e062f 100644 --- a/test/runtime/samples/transition-js-nested-if/main.html +++ b/test/runtime/samples/transition-js-nested-if/main.html @@ -1,20 +1,19 @@ + + {#if x} {#if y}
    {/if} -{/if} - - \ No newline at end of file +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-intro/Child.html b/test/runtime/samples/transition-js-nested-intro/Child.html index 32a4b8115..341a0822e 100644 --- a/test/runtime/samples/transition-js-nested-intro/Child.html +++ b/test/runtime/samples/transition-js-nested-intro/Child.html @@ -1,17 +1,13 @@ -
    - \ No newline at end of file + }; + } + + +
    \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-intro/_config.js b/test/runtime/samples/transition-js-nested-intro/_config.js index 9906be26d..9072e885f 100644 --- a/test/runtime/samples/transition-js-nested-intro/_config.js +++ b/test/runtime/samples/transition-js-nested-intro/_config.js @@ -1,21 +1,19 @@ export default { - test ( assert, component, target, window, raf ) { - component.set({ visible: true }); - const div = target.querySelector( 'div' ); - assert.equal( div.foo, 0 ); + test({ assert, component, target, window, raf }) { + component.visible = true; + const div = target.querySelector('div'); + assert.equal(div.foo, 0); - raf.tick( 50 ); - assert.equal( div.foo, 0 ); + raf.tick(50); + assert.equal(div.foo, 0); - raf.tick( 100 ); - assert.equal( div.foo, 0.5 ); + raf.tick(100); + assert.equal(div.foo, 0.5); - raf.tick( 125 ); - assert.equal( div.foo, 0.75 ); + raf.tick(125); + assert.equal(div.foo, 0.75); - raf.tick( 150 ); - assert.equal( div.foo, 1 ); - - component.destroy(); + raf.tick(150); + assert.equal(div.foo, 1); } }; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-intro/main.html b/test/runtime/samples/transition-js-nested-intro/main.html index c06e004c8..f222940ad 100644 --- a/test/runtime/samples/transition-js-nested-intro/main.html +++ b/test/runtime/samples/transition-js-nested-intro/main.html @@ -1,10 +1,8 @@ -{#if visible} - delayed -{/if} - \ No newline at end of file + export let visible; + + +{#if visible} + delayed +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-parameterised-with-state/_config.js b/test/runtime/samples/transition-js-parameterised-with-state/_config.js index b656b7779..64e40dc63 100644 --- a/test/runtime/samples/transition-js-parameterised-with-state/_config.js +++ b/test/runtime/samples/transition-js-parameterised-with-state/_config.js @@ -1,10 +1,10 @@ export default { - data: { + props: { duration: 200 }, - test(assert, component, target, window, raf) { - component.set({ visible: true }); + test({ assert, component, target, window, raf }) { + component.visible = true; const div = target.querySelector('div'); assert.equal(div.foo, 0); @@ -15,7 +15,5 @@ export default { assert.equal(div.foo, 200); raf.tick(101); - - component.destroy(); }, }; diff --git a/test/runtime/samples/transition-js-parameterised-with-state/main.html b/test/runtime/samples/transition-js-parameterised-with-state/main.html index 68d036e4d..d5512f007 100644 --- a/test/runtime/samples/transition-js-parameterised-with-state/main.html +++ b/test/runtime/samples/transition-js-parameterised-with-state/main.html @@ -1,18 +1,17 @@ -{#if visible} -
    fades in
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    fades in
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/transition-js-parameterised/_config.js b/test/runtime/samples/transition-js-parameterised/_config.js index d12aa06b8..137090554 100644 --- a/test/runtime/samples/transition-js-parameterised/_config.js +++ b/test/runtime/samples/transition-js-parameterised/_config.js @@ -1,6 +1,6 @@ export default { - test(assert, component, target, window, raf) { - component.set({ visible: true }); + test({ assert, component, target, window, raf }) { + component.visible = true; const div = target.querySelector('div'); assert.equal(div.foo, 0); @@ -11,7 +11,5 @@ export default { assert.equal(div.foo, 200); raf.tick(101); - - component.destroy(); }, }; diff --git a/test/runtime/samples/transition-js-parameterised/main.html b/test/runtime/samples/transition-js-parameterised/main.html index 5d9a59f7a..7e022ae26 100644 --- a/test/runtime/samples/transition-js-parameterised/main.html +++ b/test/runtime/samples/transition-js-parameterised/main.html @@ -1,18 +1,16 @@ -{#if visible} -
    fades in
    -{/if} - \ No newline at end of file + }; + } + + +{#if visible} +
    fades in
    +{/if} \ No newline at end of file diff --git a/test/runtime/samples/whitespace-each-block/_config.js b/test/runtime/samples/whitespace-each-block/_config.js index 98849ce14..5913ec41c 100644 --- a/test/runtime/samples/whitespace-each-block/_config.js +++ b/test/runtime/samples/whitespace-each-block/_config.js @@ -1,9 +1,9 @@ export default { - data: { + props: { characters: ['a', 'b', 'c'] }, - test ( assert, component, target ) { + test({ assert, component, target }) { assert.equal( target.textContent, `a b c ` diff --git a/test/runtime/samples/whitespace-list/_config.js b/test/runtime/samples/whitespace-list/_config.js index fd58453e5..0b9650350 100644 --- a/test/runtime/samples/whitespace-list/_config.js +++ b/test/runtime/samples/whitespace-list/_config.js @@ -1,5 +1,5 @@ export default { - data: { + props: { // so it doesn't use innerHTML one: 'one', two: 'two', @@ -14,7 +14,7 @@ export default { `, - test(assert, component, target) { + test({ assert, component, target }) { const ul = target.querySelector('ul'); assert.equal(ul.childNodes.length, 5); diff --git a/test/runtime/samples/whitespace-normal/_config.js b/test/runtime/samples/whitespace-normal/_config.js index a196aa223..e6716b46a 100644 --- a/test/runtime/samples/whitespace-normal/_config.js +++ b/test/runtime/samples/whitespace-normal/_config.js @@ -1,9 +1,9 @@ export default { - data: { + props: { name: 'world' }, - test ( assert, component, target ) { + test({ assert, component, target }) { assert.equal( target.textContent, `Hello world! How are you?` diff --git a/test/runtime/samples/window-bind-scroll-update/_config.js b/test/runtime/samples/window-bind-scroll-update/_config.js index 71a880e43..b9b620d1c 100644 --- a/test/runtime/samples/window-bind-scroll-update/_config.js +++ b/test/runtime/samples/window-bind-scroll-update/_config.js @@ -1,12 +1,10 @@ export default { skip: true, // JSDOM - test ( assert, component, target, window ) { - assert.equal( window.pageYOffset, 0 ); + test({ assert, component, target, window }) { + assert.equal(window.pageYOffset, 0); - component.set({ scrollY: 100 }); - assert.equal( window.pageYOffset, 100 ); - - component.destroy(); + component.scrollY = 100; + assert.equal(window.pageYOffset, 100); } }; \ No newline at end of file diff --git a/test/runtime/samples/window-binding-resize/_config.js b/test/runtime/samples/window-binding-resize/_config.js index 247fe59fd..d8fbe69f7 100644 --- a/test/runtime/samples/window-binding-resize/_config.js +++ b/test/runtime/samples/window-binding-resize/_config.js @@ -2,15 +2,15 @@ export default { html: `
    1024x768
    `, skip: true, // some weird stuff happening with JSDOM 11 - // skip: /^v4/.test( process.version ), // node 4 apparently does some dumb stuff - 'skip-ssr': true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason + // skip: /^v4/.test(process.version), // node 4 apparently does some dumb stuff + skip_if_ssr: true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason - test ( assert, component, target, window ) { - const event = new window.Event( 'resize' ); + async test({ assert, component, target, window }) { + const event = new window.Event('resize'); // JSDOM executes window event listeners with `global` rather than // `window` (bug?) so we need to do this - Object.defineProperties( global, { + Object.defineProperties(global, { innerWidth: { value: 567, configurable: true @@ -21,9 +21,9 @@ export default { } }); - window.dispatchEvent( event ); + await window.dispatchEvent(event); - assert.htmlEqual( target.innerHTML, ` + assert.htmlEqual(target.innerHTML, `
    567x456
    `); } diff --git a/test/runtime/samples/window-binding-resize/main.html b/test/runtime/samples/window-binding-resize/main.html index 54a1762eb..e156772be 100644 --- a/test/runtime/samples/window-binding-resize/main.html +++ b/test/runtime/samples/window-binding-resize/main.html @@ -1,3 +1,3 @@ - +
    {width}x{height}
    \ No newline at end of file diff --git a/test/runtime/samples/window-event-context/_config.js b/test/runtime/samples/window-event-context/_config.js index f9e562aef..458a15719 100644 --- a/test/runtime/samples/window-event-context/_config.js +++ b/test/runtime/samples/window-event-context/_config.js @@ -1,24 +1,22 @@ export default { - data: { + props: { foo: true }, html: `true`, - skip: /^v4/.test( process.version ), // node 4 apparently does some dumb stuff - 'skip-ssr': true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason + skip: /^v4/.test(process.version), // node 4 apparently does some dumb stuff + skip_if_ssr: true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason - test ( assert, component, target, window ) { - const event = new window.Event( 'click' ); + async test({ assert, component, target, window }) { + const event = new window.Event('click'); - window.dispatchEvent( event ); - assert.equal( component.get().foo, false ); - assert.htmlEqual( target.innerHTML, `false` ); + await window.dispatchEvent(event); + assert.equal(component.foo, false); + assert.htmlEqual(target.innerHTML, `false`); - window.dispatchEvent( event ); - assert.equal( component.get().foo, true ); - assert.htmlEqual( target.innerHTML, `true` ); - - component.destroy(); + await window.dispatchEvent(event); + assert.equal(component.foo, true); + assert.htmlEqual(target.innerHTML, `true`); } }; \ No newline at end of file diff --git a/test/runtime/samples/window-event-context/main.html b/test/runtime/samples/window-event-context/main.html index af60672a2..f0e37fd09 100644 --- a/test/runtime/samples/window-event-context/main.html +++ b/test/runtime/samples/window-event-context/main.html @@ -1,3 +1,3 @@ - + {foo} \ No newline at end of file diff --git a/test/runtime/samples/window-event-custom/_config.js b/test/runtime/samples/window-event-custom/_config.js index a615482f9..207fad1b0 100644 --- a/test/runtime/samples/window-event-custom/_config.js +++ b/test/runtime/samples/window-event-custom/_config.js @@ -1,12 +1,12 @@ export default { html: `

    escaped: false

    `, - test(assert, component, target, window) { + async test({ assert, component, target, window }) { const event = new window.KeyboardEvent('keydown', { which: 27 }); - window.dispatchEvent(event); + await window.dispatchEvent(event); assert.htmlEqual(target.innerHTML, `

    escaped: true

    diff --git a/test/runtime/samples/window-event-custom/main.html b/test/runtime/samples/window-event-custom/main.html index 515d5bc4c..ce453d933 100644 --- a/test/runtime/samples/window-event-custom/main.html +++ b/test/runtime/samples/window-event-custom/main.html @@ -1,25 +1,19 @@ - - -

    escaped: {escaped}

    - \ No newline at end of file + node.addEventListener('keydown', onKeyDown); + return { + destroy() { + node.removeEventListener('keydown', onKeyDown); + } + }; + } + + + + +

    escaped: {escaped}

    \ No newline at end of file diff --git a/test/runtime/samples/window-event/_config.js b/test/runtime/samples/window-event/_config.js index f8596defb..16e0f870e 100644 --- a/test/runtime/samples/window-event/_config.js +++ b/test/runtime/samples/window-event/_config.js @@ -2,15 +2,15 @@ export default { html: `
    undefinedxundefined
    `, skip: true, // some weird stuff happening with JSDOM 11 - // skip: /^v4/.test( process.version ), // node 4 apparently does some dumb stuff - 'skip-ssr': true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason + // skip: /^v4/.test(process.version), // node 4 apparently does some dumb stuff + skip_if_ssr: true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason - test ( assert, component, target, window ) { - const event = new window.Event( 'resize' ); + async test({ assert, component, target, window }) { + const event = new window.Event('resize'); // JSDOM executes window event listeners with `global` rather than // `window` (bug?) so we need to do this - Object.defineProperties( global, { + Object.defineProperties(global, { innerWidth: { value: 567, configurable: true @@ -21,9 +21,9 @@ export default { } }); - window.dispatchEvent( event ); + await window.dispatchEvent(event); - assert.htmlEqual( target.innerHTML, ` + assert.htmlEqual(target.innerHTML, `
    567x456
    `); } diff --git a/test/runtime/samples/window-event/main.html b/test/runtime/samples/window-event/main.html index 76f5c0208..4bf0eee52 100644 --- a/test/runtime/samples/window-event/main.html +++ b/test/runtime/samples/window-event/main.html @@ -1,3 +1,3 @@ - +
    {width}x{height}
    \ No newline at end of file diff --git a/test/server-side-rendering/index.js b/test/server-side-rendering/index.js index 5cd51488c..9d35b208a 100644 --- a/test/server-side-rendering/index.js +++ b/test/server-side-rendering/index.js @@ -1,7 +1,7 @@ -import assert from "assert"; +import * as assert from "assert"; import * as fs from "fs"; import * as path from "path"; -import glob from 'tiny-glob/sync.js'; +import * as glob from 'tiny-glob/sync.js'; import { showOutput, @@ -19,11 +19,13 @@ function tryToReadFile(file) { } } +const sveltePath = process.cwd().split('\\').join('/'); + describe("ssr", () => { before(() => { - require("../../ssr/register")({ + require("../../register")({ extensions: ['.svelte', '.html'], - store: true + sveltePath }); return setupHtmlEqual(); @@ -44,27 +46,24 @@ describe("ssr", () => { (solo ? it.only : it)(dir, () => { dir = path.resolve("test/server-side-rendering/samples", dir); try { - let component; + let Component; const mainHtmlFile = `${dir}/main.html`; const mainSvelteFile = `${dir}/main.svelte`; if (fs.existsSync(mainHtmlFile)) { - component = require(mainHtmlFile); + Component = require(mainHtmlFile).default; } else if (fs.existsSync(mainSvelteFile)) { - component = require(mainSvelteFile); + Component = require(mainSvelteFile).default; } const expectedHtml = tryToReadFile(`${dir}/_expected.html`); const expectedCss = tryToReadFile(`${dir}/_expected.css`) || ""; - const data = tryToLoadJson(`${dir}/data.json`); + const props = tryToLoadJson(`${dir}/data.json`) || undefined; - const rendered = component.render(data); + const rendered = Component.render(props); const { html, css, head } = rendered; - // rendered.toString() === rendered.html - assert.equal(rendered, html); - fs.writeFileSync(`${dir}/_actual.html`, html); if (css.code) fs.writeFileSync(`${dir}/_actual.css`, css.code); @@ -100,7 +99,7 @@ describe("ssr", () => { throw new Error("Forgot to remove `solo: true` from test"); } - if (config["skip-ssr"]) return; + if (config.skip_if_ssr) return; (config.skip ? it.skip : config.solo ? it.only : it)(dir, () => { const cwd = path.resolve("test/runtime/samples", dir); @@ -110,13 +109,13 @@ describe("ssr", () => { delete require.cache[resolved]; }); - const compileOptions = config.compileOptions || {}; + const compileOptions = Object.assign({ sveltePath }, config.compileOptions); - require("../../ssr/register")(compileOptions); + require("../../register")(compileOptions); try { - const component = require(`../runtime/samples/${dir}/main.html`); - const { html } = component.render(config.data, { + const Component = require(`../runtime/samples/${dir}/main.html`).default; + const { html } = Component.render(config.props, { store: (config.store !== true) && config.store }); diff --git a/test/server-side-rendering/samples/attribute-boolean/_actual.html b/test/server-side-rendering/samples/attribute-boolean/_actual.html deleted file mode 100644 index 1536f3e1e..000000000 --- a/test/server-side-rendering/samples/attribute-boolean/_actual.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/server-side-rendering/samples/attribute-dynamic/_actual.html b/test/server-side-rendering/samples/attribute-dynamic/_actual.html deleted file mode 100644 index 896038291..000000000 --- a/test/server-side-rendering/samples/attribute-dynamic/_actual.html +++ /dev/null @@ -1 +0,0 @@ -
    aquamarine sans-serif
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.html b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.html index 669d7664a..ff6c15981 100644 --- a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.html +++ b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.html @@ -1,16 +1,9 @@ -
    - \ No newline at end of file + + +
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/attribute-escaped-quotes/main.html b/test/server-side-rendering/samples/attribute-escaped-quotes/main.html index 47e3466ab..ed34f4d12 100644 --- a/test/server-side-rendering/samples/attribute-escaped-quotes/main.html +++ b/test/server-side-rendering/samples/attribute-escaped-quotes/main.html @@ -1,12 +1,5 @@ -
    - - export default { - data() { - return { - foo: '">
    \ No newline at end of file +
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/attribute-static/_actual.html b/test/server-side-rendering/samples/attribute-static/_actual.html deleted file mode 100644 index 99ed594ea..000000000 --- a/test/server-side-rendering/samples/attribute-static/_actual.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/bindings/main.html b/test/server-side-rendering/samples/bindings/main.html index 6a08ab570..c1ba2ed02 100644 --- a/test/server-side-rendering/samples/bindings/main.html +++ b/test/server-side-rendering/samples/bindings/main.html @@ -1,8 +1,5 @@ - - \ No newline at end of file + + + \ No newline at end of file diff --git a/test/server-side-rendering/samples/comment/_actual.html b/test/server-side-rendering/samples/comment/_actual.html deleted file mode 100644 index 0dfdacc02..000000000 --- a/test/server-side-rendering/samples/comment/_actual.html +++ /dev/null @@ -1,3 +0,0 @@ -

    before

    - -

    after

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/component-binding-renamed/Foo.html b/test/server-side-rendering/samples/component-binding-renamed/Foo.html index b0f08ce1d..fd78630d3 100644 --- a/test/server-side-rendering/samples/component-binding-renamed/Foo.html +++ b/test/server-side-rendering/samples/component-binding-renamed/Foo.html @@ -1,11 +1,5 @@ -:foo: - + +:foo: diff --git a/test/server-side-rendering/samples/component-binding-renamed/_actual.html b/test/server-side-rendering/samples/component-binding-renamed/_actual.html deleted file mode 100644 index 8009a9607..000000000 --- a/test/server-side-rendering/samples/component-binding-renamed/_actual.html +++ /dev/null @@ -1 +0,0 @@ -1:foo:1 \ No newline at end of file diff --git a/test/server-side-rendering/samples/component-binding-renamed/main.html b/test/server-side-rendering/samples/component-binding-renamed/main.html index 7f5e58853..5c8af5f2e 100644 --- a/test/server-side-rendering/samples/component-binding-renamed/main.html +++ b/test/server-side-rendering/samples/component-binding-renamed/main.html @@ -1,11 +1,8 @@ -{y}{y} - + +{y}{y} diff --git a/test/server-side-rendering/samples/component-binding/Foo.html b/test/server-side-rendering/samples/component-binding/Foo.html index b0f08ce1d..fd78630d3 100644 --- a/test/server-side-rendering/samples/component-binding/Foo.html +++ b/test/server-side-rendering/samples/component-binding/Foo.html @@ -1,11 +1,5 @@ -:foo: - + +:foo: diff --git a/test/server-side-rendering/samples/component-binding/_actual.html b/test/server-side-rendering/samples/component-binding/_actual.html deleted file mode 100644 index 8009a9607..000000000 --- a/test/server-side-rendering/samples/component-binding/_actual.html +++ /dev/null @@ -1 +0,0 @@ -1:foo:1 \ No newline at end of file diff --git a/test/server-side-rendering/samples/component-binding/main.html b/test/server-side-rendering/samples/component-binding/main.html index e4ded9107..c8742a584 100644 --- a/test/server-side-rendering/samples/component-binding/main.html +++ b/test/server-side-rendering/samples/component-binding/main.html @@ -1,11 +1,7 @@ -{x}{x} - + +{x}{x} diff --git a/test/server-side-rendering/samples/component-data-dynamic/_actual.html b/test/server-side-rendering/samples/component-data-dynamic/_actual.html deleted file mode 100644 index e8984936d..000000000 --- a/test/server-side-rendering/samples/component-data-dynamic/_actual.html +++ /dev/null @@ -1,6 +0,0 @@ -
    -

    foo: lol

    -

    baz: 42 (number)

    -

    qux: this is a piece of string

    -

    quux: core

    -
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/component-data-dynamic/main.html b/test/server-side-rendering/samples/component-data-dynamic/main.html index 554d4980a..74998f474 100644 --- a/test/server-side-rendering/samples/component-data-dynamic/main.html +++ b/test/server-side-rendering/samples/component-data-dynamic/main.html @@ -1,11 +1,12 @@ -
    - -
    - + +
    + +
    diff --git a/test/server-side-rendering/samples/component-data-empty/_actual.html b/test/server-side-rendering/samples/component-data-empty/_actual.html deleted file mode 100644 index 85fe1fe73..000000000 --- a/test/server-side-rendering/samples/component-data-empty/_actual.html +++ /dev/null @@ -1,3 +0,0 @@ -
    -

    foo: ''

    -
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/component-data-empty/main.html b/test/server-side-rendering/samples/component-data-empty/main.html index 8b797c8a6..478bcff0a 100644 --- a/test/server-side-rendering/samples/component-data-empty/main.html +++ b/test/server-side-rendering/samples/component-data-empty/main.html @@ -1,11 +1,7 @@ -
    - -
    - + +
    + +
    diff --git a/test/server-side-rendering/samples/component-refs-and-attributes/_actual.html b/test/server-side-rendering/samples/component-refs-and-attributes/_actual.html deleted file mode 100644 index bc50561da..000000000 --- a/test/server-side-rendering/samples/component-refs-and-attributes/_actual.html +++ /dev/null @@ -1 +0,0 @@ -

    42

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/component-refs-and-attributes/main.html b/test/server-side-rendering/samples/component-refs-and-attributes/main.html index d0e56efa3..86b3ddf1a 100644 --- a/test/server-side-rendering/samples/component-refs-and-attributes/main.html +++ b/test/server-side-rendering/samples/component-refs-and-attributes/main.html @@ -1,13 +1,9 @@ -
    - + +
    diff --git a/test/server-side-rendering/samples/component-refs/_actual.html b/test/server-side-rendering/samples/component-refs/_actual.html deleted file mode 100644 index d355c1968..000000000 --- a/test/server-side-rendering/samples/component-refs/_actual.html +++ /dev/null @@ -1 +0,0 @@ -

    widget

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/component-refs/main.html b/test/server-side-rendering/samples/component-refs/main.html index 14919b51c..55d2abc4c 100644 --- a/test/server-side-rendering/samples/component-refs/main.html +++ b/test/server-side-rendering/samples/component-refs/main.html @@ -1,9 +1,7 @@ -
    - + +
    diff --git a/test/server-side-rendering/samples/component-with-different-extension/main.svelte b/test/server-side-rendering/samples/component-with-different-extension/main.svelte index 4f02f2f94..ac0b42916 100644 --- a/test/server-side-rendering/samples/component-with-different-extension/main.svelte +++ b/test/server-side-rendering/samples/component-with-different-extension/main.svelte @@ -1,11 +1,7 @@ -
    - -
    - + +
    + +
    diff --git a/test/server-side-rendering/samples/component-yield/Widget.html b/test/server-side-rendering/samples/component-yield/Widget.html index 34efb735b..d7159b179 100644 --- a/test/server-side-rendering/samples/component-yield/Widget.html +++ b/test/server-side-rendering/samples/component-yield/Widget.html @@ -1,11 +1,5 @@ -

    - + +

    diff --git a/test/server-side-rendering/samples/component-yield/_actual.html b/test/server-side-rendering/samples/component-yield/_actual.html deleted file mode 100644 index 49139417a..000000000 --- a/test/server-side-rendering/samples/component-yield/_actual.html +++ /dev/null @@ -1,3 +0,0 @@ -
    -

    Hello

    -
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/component-yield/main.html b/test/server-side-rendering/samples/component-yield/main.html index 1e4cef578..9c2f573c9 100644 --- a/test/server-side-rendering/samples/component-yield/main.html +++ b/test/server-side-rendering/samples/component-yield/main.html @@ -1,17 +1,9 @@ -
    - {data} -
    - + +
    + {data} +
    diff --git a/test/server-side-rendering/samples/component/_actual.html b/test/server-side-rendering/samples/component/_actual.html deleted file mode 100644 index 88145945c..000000000 --- a/test/server-side-rendering/samples/component/_actual.html +++ /dev/null @@ -1,3 +0,0 @@ -
    -

    i am a widget

    -
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/component/main.html b/test/server-side-rendering/samples/component/main.html index 5b119b552..ecb4297a4 100644 --- a/test/server-side-rendering/samples/component/main.html +++ b/test/server-side-rendering/samples/component/main.html @@ -1,11 +1,7 @@ -
    - -
    - + +
    + +
    diff --git a/test/server-side-rendering/samples/computed/_actual.html b/test/server-side-rendering/samples/computed/_actual.html deleted file mode 100644 index 6386593ee..000000000 --- a/test/server-side-rendering/samples/computed/_actual.html +++ /dev/null @@ -1,2 +0,0 @@ -

    1 + 2 = 3

    -

    3 * 3 = 9

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/computed/main.html b/test/server-side-rendering/samples/computed/main.html index d718fd052..4143af2e0 100644 --- a/test/server-side-rendering/samples/computed/main.html +++ b/test/server-side-rendering/samples/computed/main.html @@ -1,11 +1,15 @@ -

    {a} + {b} = {c}

    -

    {c} * {c} = {cSquared}

    - + +

    {a} + {b} = {c()}

    +

    {c()} * {c()} = {cSquared()}

    diff --git a/test/server-side-rendering/samples/default-data-override/_actual.html b/test/server-side-rendering/samples/default-data-override/_actual.html deleted file mode 100644 index cfe6edcec..000000000 --- a/test/server-side-rendering/samples/default-data-override/_actual.html +++ /dev/null @@ -1 +0,0 @@ -

    2

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/default-data-override/main.html b/test/server-side-rendering/samples/default-data-override/main.html index 1014c2df0..3e42f1d4e 100644 --- a/test/server-side-rendering/samples/default-data-override/main.html +++ b/test/server-side-rendering/samples/default-data-override/main.html @@ -1,11 +1,5 @@ -

    {foo}

    - + +

    {foo}

    diff --git a/test/server-side-rendering/samples/default-data/_actual.html b/test/server-side-rendering/samples/default-data/_actual.html deleted file mode 100644 index 40001b681..000000000 --- a/test/server-side-rendering/samples/default-data/_actual.html +++ /dev/null @@ -1 +0,0 @@ -

    1

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/default-data/main.html b/test/server-side-rendering/samples/default-data/main.html index 1014c2df0..3e42f1d4e 100644 --- a/test/server-side-rendering/samples/default-data/main.html +++ b/test/server-side-rendering/samples/default-data/main.html @@ -1,11 +1,5 @@ -

    {foo}

    - + +

    {foo}

    diff --git a/test/server-side-rendering/samples/directives/_actual.html b/test/server-side-rendering/samples/directives/_actual.html deleted file mode 100644 index 13cd34a99..000000000 --- a/test/server-side-rendering/samples/directives/_actual.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/server-side-rendering/samples/directives/main.html b/test/server-side-rendering/samples/directives/main.html index a960ff707..d8842a867 100644 --- a/test/server-side-rendering/samples/directives/main.html +++ b/test/server-side-rendering/samples/directives/main.html @@ -1 +1 @@ - + diff --git a/test/server-side-rendering/samples/dynamic-text-escaped/_actual.html b/test/server-side-rendering/samples/dynamic-text-escaped/_actual.html deleted file mode 100644 index cd875b439..000000000 --- a/test/server-side-rendering/samples/dynamic-text-escaped/_actual.html +++ /dev/null @@ -1 +0,0 @@ -<p>this should be <em>escaped</em> & so should 'this'</p> \ No newline at end of file diff --git a/test/server-side-rendering/samples/dynamic-text/_actual.html b/test/server-side-rendering/samples/dynamic-text/_actual.html deleted file mode 100644 index 85c882939..000000000 --- a/test/server-side-rendering/samples/dynamic-text/_actual.html +++ /dev/null @@ -1 +0,0 @@ -it works \ No newline at end of file diff --git a/test/server-side-rendering/samples/each-block/_actual.html b/test/server-side-rendering/samples/each-block/_actual.html deleted file mode 100644 index 9f0c3c2b5..000000000 --- a/test/server-side-rendering/samples/each-block/_actual.html +++ /dev/null @@ -1 +0,0 @@ -

    1: alligator

    2: beetle

    3: cuckoo

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/empty-elements-closed/_actual.html b/test/server-side-rendering/samples/empty-elements-closed/_actual.html deleted file mode 100644 index cb9b2cdca..000000000 --- a/test/server-side-rendering/samples/empty-elements-closed/_actual.html +++ /dev/null @@ -1,2 +0,0 @@ - -

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/entities/_actual.html b/test/server-side-rendering/samples/entities/_actual.html deleted file mode 100644 index a7d44dafd..000000000 --- a/test/server-side-rendering/samples/entities/_actual.html +++ /dev/null @@ -1 +0,0 @@ -it's working \ No newline at end of file diff --git a/test/server-side-rendering/samples/helpers/_actual.html b/test/server-side-rendering/samples/helpers/_actual.html deleted file mode 100644 index 4b5c34ffb..000000000 --- a/test/server-side-rendering/samples/helpers/_actual.html +++ /dev/null @@ -1 +0,0 @@ -

    3

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/helpers/main.html b/test/server-side-rendering/samples/helpers/main.html index 03598e706..600105790 100644 --- a/test/server-side-rendering/samples/helpers/main.html +++ b/test/server-side-rendering/samples/helpers/main.html @@ -1,15 +1,7 @@ -

    {thrice(foo)}

    - + +

    {thrice(foo)}

    diff --git a/test/server-side-rendering/samples/if-block-false/_actual.html b/test/server-side-rendering/samples/if-block-false/_actual.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/server-side-rendering/samples/if-block-true/_actual.html b/test/server-side-rendering/samples/if-block-true/_actual.html deleted file mode 100644 index df979b8d5..000000000 --- a/test/server-side-rendering/samples/if-block-true/_actual.html +++ /dev/null @@ -1 +0,0 @@ -

    foo is true

    \ No newline at end of file diff --git a/test/server-side-rendering/samples/import-non-component/_actual.html b/test/server-side-rendering/samples/import-non-component/_actual.html deleted file mode 100644 index 25e562b3d..000000000 --- a/test/server-side-rendering/samples/import-non-component/_actual.html +++ /dev/null @@ -1,2 +0,0 @@ -
    i got 99 problems
    -
    the answer is 42
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/import-non-component/answer.js b/test/server-side-rendering/samples/import-non-component/answer.js index 888cae37a..7a4e8a723 100644 --- a/test/server-side-rendering/samples/import-non-component/answer.js +++ b/test/server-side-rendering/samples/import-non-component/answer.js @@ -1 +1 @@ -module.exports = 42; +export default 42; diff --git a/test/server-side-rendering/samples/import-non-component/main.html b/test/server-side-rendering/samples/import-non-component/main.html index 80e2413dd..1a2814bbd 100644 --- a/test/server-side-rendering/samples/import-non-component/main.html +++ b/test/server-side-rendering/samples/import-non-component/main.html @@ -1,13 +1,7 @@ -
    i got {problems} problems
    -
    the answer is {answer}
    - + +
    i got {problems} problems
    +
    the answer is {answer}
    diff --git a/test/server-side-rendering/samples/import-non-component/problems.js b/test/server-side-rendering/samples/import-non-component/problems.js index 0a7ac9921..4a45ec622 100644 --- a/test/server-side-rendering/samples/import-non-component/problems.js +++ b/test/server-side-rendering/samples/import-non-component/problems.js @@ -1 +1 @@ -module.exports = 99; +export default 99; diff --git a/test/server-side-rendering/samples/raw-mustaches/_actual.html b/test/server-side-rendering/samples/raw-mustaches/_actual.html deleted file mode 100644 index c44897a0c..000000000 --- a/test/server-side-rendering/samples/raw-mustaches/_actual.html +++ /dev/null @@ -1 +0,0 @@ -beforeraw html!!!\o/after \ No newline at end of file diff --git a/test/server-side-rendering/samples/sanitize-name/main.html b/test/server-side-rendering/samples/sanitize-name/main.html index 04071bf3c..6d7986da2 100644 --- a/test/server-side-rendering/samples/sanitize-name/main.html +++ b/test/server-side-rendering/samples/sanitize-name/main.html @@ -1,9 +1,5 @@ - - - export default { - components: { Foo } - }; - \ No newline at end of file + \ No newline at end of file diff --git a/test/server-side-rendering/samples/static-div/_actual.html b/test/server-side-rendering/samples/static-div/_actual.html deleted file mode 100644 index 281c6866c..000000000 --- a/test/server-side-rendering/samples/static-div/_actual.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/static-text/_actual.html b/test/server-side-rendering/samples/static-text/_actual.html deleted file mode 100644 index b649a9bf8..000000000 --- a/test/server-side-rendering/samples/static-text/_actual.html +++ /dev/null @@ -1 +0,0 @@ -some text \ No newline at end of file diff --git a/test/server-side-rendering/samples/styles-nested/One.html b/test/server-side-rendering/samples/styles-nested/One.html index 0e68dd3c2..df5512b91 100644 --- a/test/server-side-rendering/samples/styles-nested/One.html +++ b/test/server-side-rendering/samples/styles-nested/One.html @@ -1,3 +1,9 @@ + +
    green: {message}
    @@ -8,11 +14,3 @@ color: green; } - - diff --git a/test/server-side-rendering/samples/styles-nested/_actual.html b/test/server-side-rendering/samples/styles-nested/_actual.html deleted file mode 100644 index 2227662e2..000000000 --- a/test/server-side-rendering/samples/styles-nested/_actual.html +++ /dev/null @@ -1,8 +0,0 @@ -
    red
    -
    green: foo
    - - - -
    green: bar
    - - diff --git a/test/server-side-rendering/samples/styles-nested/main.html b/test/server-side-rendering/samples/styles-nested/main.html index b87d4f32d..11775475b 100644 --- a/test/server-side-rendering/samples/styles-nested/main.html +++ b/test/server-side-rendering/samples/styles-nested/main.html @@ -1,3 +1,7 @@ + +
    red
    @@ -7,11 +11,3 @@ color: red; } - - diff --git a/test/server-side-rendering/samples/styles/_actual.html b/test/server-side-rendering/samples/styles/_actual.html deleted file mode 100644 index 4c164bd84..000000000 --- a/test/server-side-rendering/samples/styles/_actual.html +++ /dev/null @@ -1 +0,0 @@ -
    red
    \ No newline at end of file diff --git a/test/server-side-rendering/samples/textarea-children/main.html b/test/server-side-rendering/samples/textarea-children/main.html index 0dbb39727..5f37f40d5 100644 --- a/test/server-side-rendering/samples/textarea-children/main.html +++ b/test/server-side-rendering/samples/textarea-children/main.html @@ -1,11 +1,7 @@ + + - - \ No newline at end of file + \ No newline at end of file diff --git a/test/server-side-rendering/samples/textarea-value/main.html b/test/server-side-rendering/samples/textarea-value/main.html index 8413572a7..28f7f372b 100644 --- a/test/server-side-rendering/samples/textarea-value/main.html +++ b/test/server-side-rendering/samples/textarea-value/main.html @@ -1,9 +1,5 @@ -