Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(attr): remove deprecated prop attr/reflectToAttr
  • Loading branch information
adamdbradley committed Aug 4, 2020
1 parent a87b738 commit 133dd49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
11 changes: 2 additions & 9 deletions src/compiler/transformers/decorators-to-static/prop-decorator.ts
Expand Up @@ -70,7 +70,7 @@ const parsePropDecorator = (diagnostics: d.Diagnostic[], typeChecker: ts.TypeChe

// prop can have an attribute if type is NOT "unknown"
if (typeStr !== 'unknown') {
propMeta.attribute = getAttributeName(diagnostics, propName, propOptions, propDecorator);
propMeta.attribute = getAttributeName(propName, propOptions);
propMeta.reflect = getReflect(diagnostics, propOptions);
}

Expand All @@ -85,7 +85,7 @@ const parsePropDecorator = (diagnostics: d.Diagnostic[], typeChecker: ts.TypeChe
return staticProp;
};

const getAttributeName = (diagnostics: d.Diagnostic[], propName: string, propOptions: d.PropOptions, node: ts.Node) => {
const getAttributeName = (propName: string, propOptions: d.PropOptions) => {
if (propOptions.attribute === null) {
return undefined;
}
Expand All @@ -94,13 +94,6 @@ const getAttributeName = (diagnostics: d.Diagnostic[], propName: string, propOpt
return propOptions.attribute.trim().toLowerCase();
}

if (typeof propOptions.attr === 'string' && propOptions.attr.trim().length > 0) {
const diagnostic = buildWarn(diagnostics);
diagnostic.messageText = `@Prop option "attr" has been deprecated. Please use "attribute" instead.`;
augmentDiagnosticWithNode(diagnostic, node);
return propOptions.attr.trim().toLowerCase();
}

return toDashCase(propName);
};

Expand Down
5 changes: 0 additions & 5 deletions src/declarations/stencil-public-runtime.ts
Expand Up @@ -92,11 +92,6 @@ export interface PropOptions {
* In this case you can set the `reflect` option to `true`, since it defaults to `false`:
*/
reflect?: boolean;

/** @deprecated: "attr" has been deprecated, please use "attribute" instead. */
attr?: string;
/** @deprecated "reflectToAttr" has been deprecated, please use "reflect" instead. */
reflectToAttr?: boolean;
}

export interface MethodDecorator {
Expand Down

0 comments on commit 133dd49

Please sign in to comment.