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).
* Review #19669 and ensure all
  `disabledWhen` is removed.
* Review #19662 and ensure all
  `@tagName` support is removed
* Review all `ember.built-in-components.*` deprecations and ensure their
  functionality is removed.
* Remove code supporting `ember-glimmer.link-to.positional-arguments`,
  basically
  https://github.com/emberjs/ember.js/blob/master/packages/ember-template-compiler/lib/plugins/transform-link-to.ts

(cherry picked from commit 5d24ae7)
  • Loading branch information
mixonic authored and kategengler committed Nov 10, 2021
1 parent bb95620 commit 3e6c348
Show file tree
Hide file tree
Showing 57 changed files with 564 additions and 7,891 deletions.
5 changes: 1 addition & 4 deletions packages/@ember/-internals/glimmer/index.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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 @@ -1044,71 +1043,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: '3.27.0',
},
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-component-reopen',
until: '4.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/v3.x#toc_ember-component-reopen',
since: {
enabled: '3.27.0',
},
until: '4.0.0',
}
);

Component._wasReopened = true;
}

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

export default Component;
Loading

0 comments on commit 3e6c348

Please sign in to comment.