Deconflict dev mode block function names again (#3907)

Fixes #3900
pull/3917/head
Conduitry 6 years ago committed by GitHub
parent afe5ad430a
commit 6774e336ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
package-lock.json generated

@ -500,9 +500,9 @@
"dev": true "dev": true
}, },
"code-red": { "code-red": {
"version": "0.0.20", "version": "0.0.21",
"resolved": "https://registry.npmjs.org/code-red/-/code-red-0.0.20.tgz", "resolved": "https://registry.npmjs.org/code-red/-/code-red-0.0.21.tgz",
"integrity": "sha512-nEh0GdiKVQ1zFyTImD+Z93kqVG0UPXSn9W5YCafOiOHBlVEhlVQkuVmerCg1CPmm1xka/3cvhS+EI/Ozeke6bQ==", "integrity": "sha512-luUVxyGNwTU/lG+lY+pitXHJzgDvFa0WfxA4Nsd7uk/S366mHY8B86pwAcyRcKY9BE/HvryVNXCR691Q5ry+Ww==",
"dev": true, "dev": true,
"requires": { "requires": {
"acorn": "^7.1.0", "acorn": "^7.1.0",

@ -64,7 +64,7 @@
"acorn": "^7.1.0", "acorn": "^7.1.0",
"agadoo": "^1.1.0", "agadoo": "^1.1.0",
"c8": "^5.0.1", "c8": "^5.0.1",
"code-red": "0.0.20", "code-red": "0.0.21",
"codecov": "^3.5.0", "codecov": "^3.5.0",
"css-tree": "1.0.0-alpha22", "css-tree": "1.0.0-alpha22",
"eslint": "^6.3.0", "eslint": "^6.3.0",

@ -266,7 +266,7 @@ export default class Block {
: this.chunks.hydrate : this.chunks.hydrate
); );
properties.create = x`function create() { properties.create = x`function #create() {
${this.chunks.create} ${this.chunks.create}
${hydrate} ${hydrate}
}`; }`;
@ -276,7 +276,7 @@ export default class Block {
if (this.chunks.claim.length === 0 && this.chunks.hydrate.length === 0) { if (this.chunks.claim.length === 0 && this.chunks.hydrate.length === 0) {
properties.claim = noop; properties.claim = noop;
} else { } else {
properties.claim = x`function claim(#nodes) { properties.claim = x`function #claim(#nodes) {
${this.chunks.claim} ${this.chunks.claim}
${this.renderer.options.hydratable && this.chunks.hydrate.length > 0 && b`this.h();`} ${this.renderer.options.hydratable && this.chunks.hydrate.length > 0 && b`this.h();`}
}`; }`;
@ -284,7 +284,7 @@ export default class Block {
} }
if (this.renderer.options.hydratable && this.chunks.hydrate.length > 0) { if (this.renderer.options.hydratable && this.chunks.hydrate.length > 0) {
properties.hydrate = x`function hydrate() { properties.hydrate = x`function #hydrate() {
${this.chunks.hydrate} ${this.chunks.hydrate}
}`; }`;
} }
@ -292,7 +292,7 @@ export default class Block {
if (this.chunks.mount.length === 0) { if (this.chunks.mount.length === 0) {
properties.mount = noop; properties.mount = noop;
} else { } else {
properties.mount = x`function mount(#target, anchor) { properties.mount = x`function #mount(#target, anchor) {
${this.chunks.mount} ${this.chunks.mount}
}`; }`;
} }
@ -302,7 +302,7 @@ export default class Block {
properties.update = noop; properties.update = noop;
} else { } else {
const ctx = this.maintain_context ? x`#new_ctx` : x`#ctx`; const ctx = this.maintain_context ? x`#new_ctx` : x`#ctx`;
properties.update = x`function update(#changed, ${ctx}) { properties.update = x`function #update(#changed, ${ctx}) {
${this.maintain_context && b`#ctx = ${ctx};`} ${this.maintain_context && b`#ctx = ${ctx};`}
${this.chunks.update} ${this.chunks.update}
}`; }`;
@ -310,15 +310,15 @@ export default class Block {
} }
if (this.has_animation) { if (this.has_animation) {
properties.measure = x`function measure() { properties.measure = x`function #measure() {
${this.chunks.measure} ${this.chunks.measure}
}`; }`;
properties.fix = x`function fix() { properties.fix = x`function #fix() {
${this.chunks.fix} ${this.chunks.fix}
}`; }`;
properties.animate = x`function animate() { properties.animate = x`function #animate() {
${this.chunks.animate} ${this.chunks.animate}
}`; }`;
} }
@ -327,7 +327,7 @@ export default class Block {
if (this.chunks.intro.length === 0) { if (this.chunks.intro.length === 0) {
properties.intro = noop; properties.intro = noop;
} else { } else {
properties.intro = x`function intro(#local) { properties.intro = x`function #intro(#local) {
${this.has_outros && b`if (#current) return;`} ${this.has_outros && b`if (#current) return;`}
${this.chunks.intro} ${this.chunks.intro}
}`; }`;
@ -336,7 +336,7 @@ export default class Block {
if (this.chunks.outro.length === 0) { if (this.chunks.outro.length === 0) {
properties.outro = noop; properties.outro = noop;
} else { } else {
properties.outro = x`function outro(#local) { properties.outro = x`function #outro(#local) {
${this.chunks.outro} ${this.chunks.outro}
}`; }`;
} }
@ -345,7 +345,7 @@ export default class Block {
if (this.chunks.destroy.length === 0) { if (this.chunks.destroy.length === 0) {
properties.destroy = noop; properties.destroy = noop;
} else { } else {
properties.destroy = x`function destroy(detaching) { properties.destroy = x`function #destroy(detaching) {
${this.chunks.destroy} ${this.chunks.destroy}
}`; }`;
} }

@ -0,0 +1,6 @@
export default {
compileOptions: {
dev: true
},
html: `<div>deconflicted</div>`
};

@ -0,0 +1,5 @@
<script>
const create = 'deconflicted';
</script>
<div>{create}</div>
Loading…
Cancel
Save