diff --git a/packages/@ember/-internals/glimmer/lib/component-managers/curly.ts b/packages/@ember/-internals/glimmer/lib/component-managers/curly.ts index 21da0ed0509..c520884b8ed 100644 --- a/packages/@ember/-internals/glimmer/lib/component-managers/curly.ts +++ b/packages/@ember/-internals/glimmer/lib/component-managers/curly.ts @@ -2,7 +2,6 @@ import { Factory, getOwner, Owner, setOwner } from '@ember/-internals/owner'; import { enumerableSymbol, guidFor, symbol } from '@ember/-internals/utils'; import { addChildView, setElementView, setViewElement } from '@ember/-internals/views'; import { assert, debugFreeze } from '@ember/debug'; -import { EMBER_COMPONENT_IS_VISIBLE } from '@ember/deprecated-features'; import { _instrumentStart } from '@ember/instrumentation'; import { DEBUG } from '@glimmer/env'; import { @@ -47,7 +46,6 @@ import { createClassNameBindingRef, createSimpleClassNameBindingRef, installAttributeBinding, - installIsVisibleBinding, parseAttributeBinding, } from '../utils/bindings'; @@ -103,14 +101,6 @@ function applyAttributeBindings( let id = component.elementId ? component.elementId : guidFor(component); operations.setAttribute('id', createPrimitiveRef(id), false, null); } - - if ( - EMBER_COMPONENT_IS_VISIBLE && - installIsVisibleBinding !== undefined && - seen.indexOf('style') === -1 - ) { - installIsVisibleBinding(rootRef, operations); - } } const EMPTY_POSITIONAL_ARGS: Reference[] = []; @@ -390,9 +380,6 @@ export default class CurlyComponentManager } else { let id = component.elementId ? component.elementId : guidFor(component); operations.setAttribute('id', createPrimitiveRef(id), false, null); - if (EMBER_COMPONENT_IS_VISIBLE) { - installIsVisibleBinding!(rootRef, operations); - } } if (classRef) { diff --git a/packages/@ember/-internals/glimmer/lib/component.ts b/packages/@ember/-internals/glimmer/lib/component.ts index f6778005b49..ddb0c74f222 100644 --- a/packages/@ember/-internals/glimmer/lib/component.ts +++ b/packages/@ember/-internals/glimmer/lib/component.ts @@ -1091,16 +1091,6 @@ const Component = CoreView.extend( @type String @public */ - - /** - If `false`, the view will appear hidden in DOM. - - @property isVisible - @type Boolean - @default null - @deprecated Use `
foo
`, - }); - - expectDeprecation(() => { - this.render(`{{foo-bar id="foo-bar" isVisible=this.visible}}`, { - visible: false, - }); - }, debugStackMessageFor('The `isVisible` property on classic component classes is deprecated. Was accessed:', { renderTree: ['foo-bar'] })); - - assertStyle('display: none;'); - - this.assertStableRerender(); - - expectDeprecation(() => { - runTask(() => { - set(this.context, 'visible', true); - }); - }, debugStackMessageFor('The `isVisible` property on classic component classes is deprecated. Was accessed:', { renderTree: ['foo-bar'] })); - - assertStyle(''); - - expectDeprecation(() => { - runTask(() => { - set(this.context, 'visible', false); - }); - }, debugStackMessageFor('The `isVisible` property on classic component classes is deprecated. Was accessed:', { renderTree: ['foo-bar'] })); - - assertStyle('display: none;'); - } - - ['@test isVisible does not overwrite component style']() { - this.registerComponent('foo-bar', { - ComponentClass: Component.extend({ - attributeBindings: ['style'], - style: htmlSafe('color: blue;'), - }), - - template: `foo
`, - }); - - expectDeprecation(() => { - this.render(`{{foo-bar id="foo-bar" isVisible=this.visible}}`, { - visible: false, - }); - }, debugStackMessageFor('The `isVisible` property on classic component classes is deprecated. Was accessed:', { renderTree: ['foo-bar'] })); - - this.assertComponentElement(this.firstChild, { - tagName: 'div', - attrs: { id: 'foo-bar', style: styles('color: blue; display: none;') }, - }); - - this.assertStableRerender(); - - expectDeprecation(() => { - runTask(() => { - set(this.context, 'visible', true); - }); - }, debugStackMessageFor('The `isVisible` property on classic component classes is deprecated. Was accessed:', { renderTree: ['foo-bar'] })); - - this.assertComponentElement(this.firstChild, { - tagName: 'div', - attrs: { id: 'foo-bar', style: styles('color: blue;') }, - }); - - expectDeprecation(() => { - runTask(() => { - set(this.context, 'visible', false); - }); - }, debugStackMessageFor('The `isVisible` property on classic component classes is deprecated. Was accessed:', { renderTree: ['foo-bar'] })); - - this.assertComponentElement(this.firstChild, { - tagName: 'div', - attrs: { id: 'foo-bar', style: styles('color: blue; display: none;') }, - }); - } - - ['@test adds isVisible binding when style binding is missing and other bindings exist']( - assert - ) { - let assertStyle = (expected) => { - let matcher = styles(expected); - let actual = this.firstChild.getAttribute('style'); - - assert.pushResult({ - result: matcher.match(actual), - message: matcher.message(), - actual, - expected, - }); - }; - - this.registerComponent('foo-bar', { - ComponentClass: Component.extend({ - attributeBindings: ['foo'], - foo: 'bar', - }), - template: `foo
`, - }); - - expectDeprecation(() => { - this.render(`{{foo-bar id="foo-bar" foo=this.foo isVisible=this.visible}}`, { - visible: false, - foo: 'baz', - }); - }, debugStackMessageFor('The `isVisible` property on classic component classes is deprecated. Was accessed:', { renderTree: ['foo-bar'] })); - - assertStyle('display: none;'); - - this.assertStableRerender(); - - expectDeprecation(() => { - runTask(() => { - set(this.context, 'visible', true); - }); - }, debugStackMessageFor('The `isVisible` property on classic component classes is deprecated. Was accessed:', { renderTree: ['foo-bar'] })); - - assertStyle(''); - - expectDeprecation(() => { - runTask(() => { - set(this.context, 'visible', false); - set(this.context, 'foo', 'woo'); - }); - }, debugStackMessageFor('The `isVisible` property on classic component classes is deprecated. Was accessed:', { renderTree: ['foo-bar'] })); - - assertStyle('display: none;'); - assert.equal(this.firstChild.getAttribute('foo'), 'woo'); - } - ['@test it can use readDOMAttr to read input value']() { let component; let assertElement = (expectedValue) => { diff --git a/packages/@ember/deprecated-features/index.ts b/packages/@ember/deprecated-features/index.ts index d750d8b3876..8d07921c304 100644 --- a/packages/@ember/deprecated-features/index.ts +++ b/packages/@ember/deprecated-features/index.ts @@ -13,6 +13,5 @@ export const ALIAS_METHOD = !!'3.9.0'; export const APP_CTRL_ROUTER_PROPS = !!'3.10.0-beta.1'; export const FUNCTION_PROTOTYPE_EXTENSIONS = !!'3.11.0-beta.1'; export const MOUSE_ENTER_LEAVE_MOVE_EVENTS = !!'3.13.0-beta.1'; -export const EMBER_COMPONENT_IS_VISIBLE = !!'3.15.0-beta.1'; export const PARTIALS = !!'3.15.0-beta.1'; export const GLOBALS_RESOLVER = !!'3.16.0-beta.1'; diff --git a/tests/docs/expected.js b/tests/docs/expected.js index 340eefc7de2..fa3f0d1ea40 100644 --- a/tests/docs/expected.js +++ b/tests/docs/expected.js @@ -332,7 +332,6 @@ module.exports = { 'isPresent', 'isRejected', 'isSettled', - 'isVisible', 'join', 'jQuery', 'keyDown',