Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(template-compiler): remove lwc-depracated:is #1237

Merged
merged 1 commit into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
<svg class="cubano" focusable="true">
<use xlink:href="xx"></use>
</svg>
<div lwc-deprecated:is="ns-buzz" bgcolor="x" aria-hidden="hidden" ></div>
<table bgcolor="x"></table>
<table bgcolor="x" lwc-deprecated:is="ns-table" tabindex="0" bar="test" min="3"></table>
<input minlength="3" maxlength="10" lwc-deprecated:is="ns-input" />
<div class={foo} aria-hidden="hidden"></div>
</template>
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import _nsFoo from "ns/foo";
import _nsBar from "ns/bar";
import _nsBuzz from "ns/buzz";
import _nsTable from "ns/table";
import _nsInput from "ns/input";
import { registerTemplate, sanitizeAttribute } from "lwc";

function tmpl($api, $cmp, $slotset, $ctx) {
Expand Down Expand Up @@ -77,68 +74,26 @@ function tmpl($api, $cmp, $slotset, $ctx) {
"use",
{
attrs: {
"xlink:href": sanitizeAttribute("use", "http://www.w3.org/2000/svg", "xlink:href", "xx")
"xlink:href": sanitizeAttribute(
"use",
"http://www.w3.org/2000/svg",
"xlink:href",
"xx"
)
},
key: 6
},
[]
)
]
),
api_custom_element(
"div",
_nsBuzz,
{
attrs: {
is: "ns-buzz"
},
props: {
bgColor: "x",
ariaHidden: "hidden"
},
key: 7
},
[]
),
api_element(
"table",
{
attrs: {
bgcolor: "x"
},
key: 8
},
[]
),
api_custom_element(
"table",
_nsTable,
{
attrs: {
is: "ns-table"
},
props: {
bgColor: "x",
tabIndex: "0",
bar: "test",
min: "3"
},
key: 9
},
[]
),
api_custom_element(
"input",
_nsInput,
{
attrs: {
is: "ns-input"
},
props: {
minLength: "3",
maxLength: "10"
},
key: 10
key: 7
},
[]
),
Expand All @@ -149,7 +104,7 @@ function tmpl($api, $cmp, $slotset, $ctx) {
attrs: {
"aria-hidden": "hidden"
},
key: 11
key: 8
},
[]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,56 +54,6 @@
"value": "blue"
}
}
},
{
"moduleName": "ns/buzz",
"tagName": "div",
"properties": {
"bgColor": {
"type": "literal",
"value": "x"
},
"ariaHidden": {
"type": "literal",
"value": "hidden"
}
}
},
{
"moduleName": "ns/table",
"tagName": "table",
"properties": {
"bgColor": {
"type": "literal",
"value": "x"
},
"tabIndex": {
"type": "literal",
"value": "0"
},
"bar": {
"type": "literal",
"value": "test"
},
"min": {
"type": "literal",
"value": "3"
}
}
},
{
"moduleName": "ns/input",
"tagName": "input",
"properties": {
"minLength": {
"type": "literal",
"value": "3"
},
"maxLength": {
"type": "literal",
"value": "10"
}
}
}
]
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions packages/@lwc/template-compiler/src/__tests__/parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,21 +546,6 @@ describe('props and attributes', () => {
'data-xx': { value: 'foo' },
});
});

it('custom element using is with attribute / prop mix', () => {
const { root } = parseTemplate(`<template>
<table bgcolor="x" lwc-deprecated:is="x-table" tabindex="2" bar="test" min="3"></table>
</template>`);
expect(root.children[0].props).toMatchObject({
bar: { value: 'test' },
min: { value: '3' },
bgColor: { value: 'x' },
tabIndex: { value: '2' },
});
expect(root.children[0].attrs).toMatchObject({
is: { value: 'x-table' },
});
});
});

describe('metadata', () => {
Expand All @@ -582,15 +567,6 @@ describe('metadata', () => {
expect(Array.from(state.ids)).toEqual(['state', 'componentProp']);
});

it('dependent component', () => {
const { state } = parseTemplate(`<template>
<x-menu></x-menu>
<button lwc-deprecated:is="x-button"></button>
</template>`);

expect(Array.from(state.dependencies)).toEqual(['x-menu', 'x-button']);
});

it('slots', () => {
const { state } = parseTemplate(`<template>
<slot></slot>
Expand Down
Loading