From 133dd49e9fdf3d4cf9bf0de72ce787fddf196a0a Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 4 Aug 2020 13:56:41 -0500 Subject: [PATCH] feat(attr): remove deprecated prop attr/reflectToAttr --- .../decorators-to-static/prop-decorator.ts | 11 ++--------- src/declarations/stencil-public-runtime.ts | 5 ----- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/compiler/transformers/decorators-to-static/prop-decorator.ts b/src/compiler/transformers/decorators-to-static/prop-decorator.ts index 367dbcfb096..5b8ca7b0fb9 100644 --- a/src/compiler/transformers/decorators-to-static/prop-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/prop-decorator.ts @@ -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); } @@ -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; } @@ -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); }; diff --git a/src/declarations/stencil-public-runtime.ts b/src/declarations/stencil-public-runtime.ts index e1c55f56363..47a7886a867 100644 --- a/src/declarations/stencil-public-runtime.ts +++ b/src/declarations/stencil-public-runtime.ts @@ -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 {