Skip to content

Commit

Permalink
deprecate <script> with export and template-helpers. fixes #547
Browse files Browse the repository at this point in the history
  • Loading branch information
mlrawlings committed Jan 25, 2017
1 parent bce3836 commit 678d384
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion taglibs/core/core-transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ var coreAttrHandlers = [
this.addError('The "marko-init" attribute should only be used on the <script> tag');
return;
}
this.context.deprecate('The "marko-init" attribute is deprecated. Use "template-helpers" instead.');
this.context.deprecate('The "marko-init" attribute is deprecated. Use the static tag instead. See https://github.com/marko-js/marko/issues/547');
var bodyText = el.bodyText;
el.noOutput = true;
this.context.addStaticCode(bodyText);
Expand All @@ -152,6 +152,7 @@ var coreAttrHandlers = [
this.addError('The "template-helpers" attribute should only be used on the <script> tag');
return;
}
this.context.deprecate('The "template-helpers" attribute is deprecated and will be removed in the next release candidate. Use the static tag instead. See https://github.com/marko-js/marko/issues/547');
var bodyText = el.bodyText;
el.noOutput = true;
this.context.addStaticCode(bodyText);
Expand Down
2 changes: 2 additions & 0 deletions widgets/taglib/TransformHelper/handleRootNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ function handleScriptElement(scriptEl, transformHelper) {
}

if (hasExport) {
transformHelper.context.deprecate('Using <script> with an export to create a single file component will be removed in the next release candidate. Use class instead. \nSee https://github.com/marko-js/marko/issues/547');

let componentVar;

if (needsComponentVar) {
Expand Down

0 comments on commit 678d384

Please sign in to comment.