Skip to content

Commit

Permalink
Drop export of built-ins, remove legacy components
Browse files Browse the repository at this point in the history
* Remove the export of `@ember/component/checkbox`
* Remove the export of `@ember/component/text-field`
* Remove the export of `@ember/component/text-area`
* Remove the export of `@ember/component/link-component`
* Remove the assignment of `Ember.Checkbox`
* Remove the assignment of `Ember.TextField`
* Remove the assignment of `Ember.TextArea`
* Remove the assignment of `Ember.LinkComponent`
* Remove the assignment of `Ember.TextSupport`
* Remove the assignment of `Ember.TargetActionSupport`
* Hard-code `EMBER_MODERNIZED_BUILT_IN_COMPONENTS` to `true` path in
  most places. The remaining are a few spots where there are
deprecations targeting *5.0*.
* Hard-code the built-in components (`<Textarea>`, `<Input>`,
  `<LinkTo>`) for the modernized path
* Remove the `query-params` helper (it is only needed by the legacy
  `LinkComponent` and was deprecated).
  • Loading branch information
mixonic committed Nov 3, 2021
1 parent d52b265 commit ece8f00
Show file tree
Hide file tree
Showing 51 changed files with 515 additions and 7,220 deletions.
5 changes: 1 addition & 4 deletions packages/@ember/-internals/glimmer/index.ts
Expand Up @@ -295,11 +295,8 @@
export { templateFactory as template, templateCacheCounters } from '@glimmer/opcode-compiler';

export { default as RootTemplate } from './lib/templates/root';
export { default as Checkbox } from './lib/components/checkbox';
export { default as TextField } from './lib/components/text-field';
export { default as TextArea } from './lib/components/-textarea';
export { default as LinkComponent } from './lib/components/-link-to';
export { default as Input } from './lib/components/input';
export { default as LinkTo } from './lib/components/link-to';
export { default as Textarea } from './lib/components/textarea';
export { default as Component } from './lib/component';
export { default as Helper, helper } from './lib/helper';
Expand Down
72 changes: 2 additions & 70 deletions packages/@ember/-internals/glimmer/lib/component.ts
@@ -1,6 +1,6 @@
import { get, PROPERTY_DID_CHANGE } from '@ember/-internals/metal';
import { getOwner } from '@ember/-internals/owner';
import { CoreObject, TargetActionSupport } from '@ember/-internals/runtime';
import { TargetActionSupport } from '@ember/-internals/runtime';
import {
ActionSupport,
ChildViewsSupport,
Expand All @@ -11,8 +11,7 @@ import {
ViewMixin,
ViewStateSupport,
} from '@ember/-internals/views';
import { EMBER_MODERNIZED_BUILT_IN_COMPONENTS } from '@ember/canary-features';
import { assert, deprecate } from '@ember/debug';
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';
import { Environment } from '@glimmer/interfaces';
import { setInternalComponentManager } from '@glimmer/manager';
Expand Down Expand Up @@ -1061,71 +1060,4 @@ Component.reopenClass({

setInternalComponentManager(CURLY_COMPONENT_MANAGER, Component);

if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
Object.defineProperty(Component, '_wasReopened', {
configurable: true,
enumerable: false,
writable: true,
value: false,
});

Object.defineProperty(Component, 'reopen', {
configurable: true,
enumerable: false,
writable: true,
value: function reopen(this: typeof Component, ...args: unknown[]): unknown {
if (this === Component) {
deprecate(
'Reopening the Ember.Component super class itself is deprecated. ' +
'Consider alternatives such as installing event listeners on ' +
'the document or add the customizations to specific subclasses.',
false,
{
id: 'ember.component.reopen',
for: 'ember-source',
since: {
enabled: '4.0.0',
},
url: 'https://deprecations.emberjs.com/v4.x#toc_ember-component-reopen',
until: '5.0.0',
}
);

Component._wasReopened = true;
}

return CoreObject.reopen.call(this, ...args);
},
});

Object.defineProperty(Component, 'reopenClass', {
configurable: true,
enumerable: false,
writable: true,
value: function reopenClass(this: typeof Component, ...args: unknown[]): unknown {
if (this === Component) {
deprecate(
'Reopening the Ember.Component super class itself is deprecated. ' +
'Consider alternatives such as installing event listeners on ' +
'the document or add the customizations to specific subclasses.',
false,
{
id: 'ember.component.reopen',
for: 'ember-source',
url: 'https://deprecations.emberjs.com/v4.x#toc_ember-component-reopen',
since: {
enabled: '4.0.0',
},
until: '5.0.0',
}
);

Component._wasReopened = true;
}

return CoreObject.reopenClass.call(this, ...args);
},
});
}

export default Component;

0 comments on commit ece8f00

Please sign in to comment.