From 6948f9f60e7705a1d0a1af9632b2f66d056dc813 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 17 Nov 2018 12:18:22 -0500 Subject: [PATCH] more unused stuff --- src/compile/Component.ts | 10 +++++----- src/compile/index.ts | 2 +- src/internal/SvelteComponent.js | 2 +- src/internal/await-block.js | 2 +- src/internal/utils.js | 4 ++++ test/store/{index.js => index.js.UNUSED} | 0 6 files changed, 12 insertions(+), 8 deletions(-) rename test/store/{index.js => index.js.UNUSED} (100%) diff --git a/src/compile/Component.ts b/src/compile/Component.ts index 6d149401b9..4a3cbeb4a6 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -15,7 +15,7 @@ import getName from '../utils/getName'; import Stylesheet from './css/Stylesheet'; import { test } from '../config'; import Fragment from './nodes/Fragment'; -import shared from './shared'; +import * as internal from '../internal/index'; import { Node, ShorthandImport, Ast, CompileOptions, CustomElementOptions } from '../interfaces'; import error from '../utils/error'; import getCodeFrame from '../utils/getCodeFrame'; @@ -223,8 +223,8 @@ export default class Component { 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'`; + // allow compiler to deconflict user's `import { flush } from 'whatever'` and + // Svelte's builtin `import { flush, ... } from 'svelte/internal.ts'`; this.userVars = new Set(); this.templateVars = new Map(); this.aliases = new Map(); @@ -298,8 +298,8 @@ export default class Component { // TODO use same regex for both result = result.replace(options.generate === 'ssr' ? /(@+|#+|%+)(\w*(?:-\w*)?)/g : /(%+|@+)(\w*(?:-\w*)?)/g, (match: string, sigil: string, name: string) => { if (sigil === '@') { - if (name in shared) { - if (options.dev && `${name}Dev` in shared) name = `${name}Dev`; + if (name in internal) { + if (options.dev && `${name}Dev` in internal) name = `${name}Dev`; helpers.add(name); } diff --git a/src/compile/index.ts b/src/compile/index.ts index e5a78379ea..c24465af06 100644 --- a/src/compile/index.ts +++ b/src/compile/index.ts @@ -1,4 +1,4 @@ -import { assign } from '../shared'; +import { assign } from '../internal'; import Stats from '../Stats'; import parse from '../parse/index'; import renderDOM from './render-dom/index'; diff --git a/src/internal/SvelteComponent.js b/src/internal/SvelteComponent.js index cbf0a39602..9a73110896 100644 --- a/src/internal/SvelteComponent.js +++ b/src/internal/SvelteComponent.js @@ -1,6 +1,6 @@ import { schedule_update, flush } from './scheduler.js'; import { set_current_component } from './lifecycle.js' -import { run_all } from '../shared/utils.js'; +import { run_all } from './utils.js'; import { blankObject } from './utils.js'; export class SvelteComponent { diff --git a/src/internal/await-block.js b/src/internal/await-block.js index c796be9ded..7f0bc5154f 100644 --- a/src/internal/await-block.js +++ b/src/internal/await-block.js @@ -1,4 +1,4 @@ -import { assign, isPromise } from './utils.js'; +import { assign, run_all, isPromise } from './utils.js'; import { groupOutros } from './transitions.js'; import { flush } from '../internal/scheduler.js'; diff --git a/src/internal/utils.js b/src/internal/utils.js index cf20832c31..b74e71eb95 100644 --- a/src/internal/utils.js +++ b/src/internal/utils.js @@ -39,4 +39,8 @@ export function run(fn) { export function blankObject() { return Object.create(null); +} + +export function run_all(fns) { + fns.forEach(run); } \ No newline at end of file diff --git a/test/store/index.js b/test/store/index.js.UNUSED similarity index 100% rename from test/store/index.js rename to test/store/index.js.UNUSED