Skip to content

Commit 09666fd

Browse files
committed
Fix rebase
1 parent 9dc7427 commit 09666fd

File tree

2 files changed

+2
-45
lines changed

2 files changed

+2
-45
lines changed

lib/transform.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ function transform(source, template, options = {}) {
7373
} else if (type === 'native') {
7474
result = transformNativeComponent(root, options);
7575
} else {
76-
throw new SilentError(
77-
`Unsupported component type. Only classic components (\`Component.extend({ ... }\`) are supported currently.`
78-
);
76+
throw new SilentError(`Unsupported component type.`);
7977
}
8078

8179
if (result) {

lib/transform/native.js

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -149,46 +149,5 @@ module.exports = function transformNativeComponent(root, options) {
149149

150150
let newSource = root.toSource();
151151

152-
// wrap existing template with root element
153-
let classNodes = [];
154-
if (options.hasComponentCSS) {
155-
classNodes.push(b.mustache('styleNamespace'));
156-
}
157-
158-
for (let className of classNames) {
159-
classNodes.push(b.text(className));
160-
}
161-
classNameBindings.forEach(([truthy, falsy], property) => {
162-
if (!truthy) {
163-
classNodes.push(b.mustache(`unless this.${property} "${falsy}"`));
164-
} else {
165-
classNodes.push(b.mustache(`if this.${property} "${truthy}"${falsy ? ` "${falsy}"` : ''}`));
166-
}
167-
});
168-
169-
let attrs = [];
170-
171-
if (elementId) {
172-
attrs.push(b.attr('id', b.text(elementId)));
173-
}
174-
175-
attributeBindings.forEach((value, key) => {
176-
attrs.push(b.attr(key, b.mustache(`this.${value}`)));
177-
});
178-
179-
if (classNodes.length === 1) {
180-
attrs.push(b.attr('class', classNodes[0]));
181-
} else if (classNodes.length !== 0) {
182-
let parts = [];
183-
classNodes.forEach((node, i) => {
184-
if (i !== 0) parts.push(b.text(' '));
185-
parts.push(node);
186-
});
187-
188-
attrs.push(b.attr('class', b.concat(parts)));
189-
}
190-
191-
attrs.push(b.attr('...attributes', b.text('')));
192-
193-
return { newSource, attrs, tagName };
152+
return { newSource, tagName, elementId, classNames, classNameBindings, attributeBindings };
194153
};

0 commit comments

Comments
 (0)