diff --git a/src/compiler/transformers/decorators-to-static/prop-decorator.ts b/src/compiler/transformers/decorators-to-static/prop-decorator.ts index 092eec18256..367dbcfb096 100644 --- a/src/compiler/transformers/decorators-to-static/prop-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/prop-decorator.ts @@ -21,33 +21,17 @@ export const propDecoratorsToStatic = ( watchable: Set, newMembers: ts.ClassElement[], ) => { - const connect: any[] = []; - const context: any[] = []; const properties = decoratedProps .filter(ts.isPropertyDeclaration) - .map(prop => parsePropDecorator(diagnostics, typeChecker, prop, context, connect, watchable, newMembers)) + .map(prop => parsePropDecorator(diagnostics, typeChecker, prop, watchable)) .filter(prop => prop != null); if (properties.length > 0) { newMembers.push(createStaticGetter('properties', ts.createObjectLiteral(properties, true))); } - if (context.length > 0) { - newMembers.push(createStaticGetter('contextProps', convertValueToLiteral(context))); - } - if (connect.length > 0) { - newMembers.push(createStaticGetter('connectProps', convertValueToLiteral(connect))); - } }; -const parsePropDecorator = ( - diagnostics: d.Diagnostic[], - typeChecker: ts.TypeChecker, - prop: ts.PropertyDeclaration, - context: any[], - connect: any[], - watchable: Set, - newMembers: ts.ClassElement[], -) => { +const parsePropDecorator = (diagnostics: d.Diagnostic[], typeChecker: ts.TypeChecker, prop: ts.PropertyDeclaration, watchable: Set) => { const propDecorator = prop.decorators.find(isDecoratorNamed('Prop')); if (propDecorator == null) { return null; @@ -56,23 +40,6 @@ const parsePropDecorator = ( const propName = prop.name.getText(); const propOptions = getPropOptions(propDecorator, diagnostics); - if (propOptions.context) { - context.push({ - name: propName, - context: propOptions.context, - }); - removeProp(prop, newMembers); - return null; - } - if (propOptions.connect) { - connect.push({ - name: propName, - connect: propOptions.connect, - }); - removeProp(prop, newMembers); - return null; - } - if (isMemberPrivate(prop)) { const err = buildError(diagnostics); err.messageText = 'Properties decorated with the @Prop() decorator cannot be "private" nor "protected". More info: https://stenciljs.com/docs/properties'; @@ -244,10 +211,3 @@ const isAny = (t: ts.Type) => { } return false; }; - -const removeProp = (prop: ts.ClassElement, classElements: ts.ClassElement[]) => { - const index = classElements.findIndex(p => prop === p); - if (index >= 0) { - classElements.splice(index, 1); - } -}; diff --git a/src/compiler/transformers/test/parse-deprecated-props.spec.ts b/src/compiler/transformers/test/parse-deprecated-props.spec.ts deleted file mode 100644 index cb770c70ad6..00000000000 --- a/src/compiler/transformers/test/parse-deprecated-props.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { getStaticGetter, transpileModule } from './transpile'; - -describe('parse deprecated props', () => { - it('should parse connect and context', () => { - const t = transpileModule(` - @Component({ - tag: 'cmp-a' - }) - export class CmpA { - @Prop({ context: 'isServer' }) isServer: boolean; - @Prop({ connect: 'ion-menu-controller' }) menuController: HTMLElement; - } - `); - expect(getStaticGetter(t.outputText, 'contextProps')).toEqual([{ context: 'isServer', name: 'isServer' }]); - expect(getStaticGetter(t.outputText, 'connectProps')).toEqual([{ connect: 'ion-menu-controller', name: 'menuController' }]); - expect(t.legacyContext).toEqual([{ context: 'isServer', name: 'isServer' }]); - expect(t.legacyConnect).toEqual([{ connect: 'ion-menu-controller', name: 'menuController' }]); - }); -}); diff --git a/src/declarations/stencil-public-runtime.ts b/src/declarations/stencil-public-runtime.ts index 7f05c88a197..e1c55f56363 100644 --- a/src/declarations/stencil-public-runtime.ts +++ b/src/declarations/stencil-public-runtime.ts @@ -95,10 +95,6 @@ export interface PropOptions { /** @deprecated: "attr" has been deprecated, please use "attribute" instead. */ attr?: string; - /** @deprecated "context" has been deprecated. */ - context?: string; - /** @deprecated "connect" has been deprecated, please use ES modules and/or dynamic imports instead. */ - connect?: string; /** @deprecated "reflectToAttr" has been deprecated, please use "reflect" instead. */ reflectToAttr?: boolean; }