remove unused refs stuff

pull/1878/head
Rich Harris 7 years ago
parent 9dd08d8f11
commit be2e41b558

@ -80,7 +80,6 @@ export default class Component {
indirectDependencies: Map<string, Set<string>> = new Map();
template_references: Set<string> = new Set();
refs: Set<string> = new Set();
file: string;
locate: (c: number) => { line: number, column: number };

@ -55,8 +55,6 @@ export default function dom(
builder.addBlock(block.toString());
});
const refs = Array.from(component.refs);
if (options.dev && !options.hydratable) {
block.builders.claim.addLine(
'throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");'
@ -87,14 +85,6 @@ export default function dom(
`
: null;
const inject_refs = refs.length > 0
? deindent`
$$refs => {
${refs.map(name => `${name} = $$refs.${name};`)}
}
`
: null;
const body = [];
const not_equal = component.options.immutable ? `@not_equal` : `@safe_not_equal`;
@ -307,8 +297,6 @@ export default function dom(
if (${Array.from(d.dependencies).map(n => `$$dirty.${n}`).join(' || ')}) ${d.snippet}`)}
};
`}
${inject_refs && `$$self.$$.inject_refs = ${inject_refs};`}
}
`);
}

@ -10,12 +10,10 @@ export function bind(component, name, callback) {
}
export function mount_component(component, target, anchor) {
const { fragment, refs, inject_refs, on_mount, on_destroy, after_render } = component.$$;
const { fragment, on_mount, on_destroy, after_render } = component.$$;
fragment[fragment.i ? 'i' : 'm'](target, anchor);
inject_refs(refs);
// onMount happens after the initial afterUpdate. Because
// afterUpdate callbacks happen in reverse order (inner first)
// we schedule onMount callbacks before afterUpdate callbacks
@ -69,7 +67,6 @@ export function init(component, options, define, create_fragment, not_equal) {
get: empty,
set: noop,
update: noop,
inject_refs: noop,
not_equal,
bound: blankObject(),
@ -82,7 +79,6 @@ export function init(component, options, define, create_fragment, not_equal) {
// everything else
callbacks: blankObject(),
slotted: options.slots || {},
refs: {},
dirty: null,
binding_groups: []
};

@ -32,7 +32,6 @@ export function handlePromise(promise, info) {
block[block.i ? 'i' : 'm'](info.mount(), info.anchor);
// TODO is some of this redundant?
info.component.$$.inject_refs(info.component.$$.refs);
run_all(info.component.$$.after_render);
flush();
}

@ -58,7 +58,6 @@ function update($$) {
$$.update($$.dirty);
run_all($$.before_render);
$$.fragment.p($$.dirty, $$.get());
$$.inject_refs($$.refs);
$$.dirty = null;
$$.after_render.forEach(add_render_callback);

Loading…
Cancel
Save