Skip to content

Commit

Permalink
Merge pull request #20284 from emberjs/nonsense-application-deprecati…
Browse files Browse the repository at this point in the history
…on-type

[BUGFIX stable] remove nonsense deprecation functions
  • Loading branch information
chriskrycho authored Nov 29, 2022
2 parents d3e3552 + 02a334f commit dee4039
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 62 deletions.
17 changes: 0 additions & 17 deletions type-tests/preview/@ember/application-test/deprecations.ts

This file was deleted.

2 changes: 2 additions & 0 deletions type-tests/preview/ember/ember-module-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Ember.debug('some info for developers');
Ember.deprecate("you shouldn't use this anymore", 3 === 3, {
id: 'no-longer-allowed',
until: '99.0.0',
for: 'Ember',
since: { available: '4.0.0', enabled: '4.1.1' },
});
// get
expectTypeOf(Ember.get({ z: 23 }, 'z')).toEqualTypeOf<number>();
Expand Down
14 changes: 0 additions & 14 deletions type-tests/preview/ember/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,6 @@ function testOnError() {
};
}

function testDeprecateFunc() {
function newMethod(first: string, second: number): string {
return '';
}

const oldMethod = Ember.deprecateFunc(
'Please use the new method',
{ id: 'deprecated.id', until: '6.0' },
newMethod
);
expectTypeOf(newMethod('first', 123)).toEqualTypeOf<string>();
expectTypeOf(oldMethod('first', 123)).toEqualTypeOf<string>();
}

function testDefineProperty() {
type Contact = { firstName?: string; lastName?: string };
const contact: Contact = {};
Expand Down
24 changes: 0 additions & 24 deletions types/preview/@ember/application/deprecations.d.ts

This file was deleted.

12 changes: 6 additions & 6 deletions types/preview/ember/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ declare module 'ember' {
import EmberCoreObject from '@ember/object/core';
import * as EmberApplicationNs from '@ember/application';
import * as EmberApplicationInstanceNs from '@ember/application/instance';
import type * as EmberApplicationDeprecateNs from '@ember/application/deprecations';
import type * as EmberTestNs from '@ember/test';
import * as EmberControllerNs from '@ember/controller';
import EmberMixin from '@ember/object/mixin';
Expand Down Expand Up @@ -84,8 +83,7 @@ declare module 'ember' {
export class HashLocation extends EmberRoutingHashLocation {}
export class NoneLocation extends EmberRoutingNoneLocation {}
export class HistoryLocation extends EmberRoutingHistoryLocation {}
export const deprecateFunc: typeof EmberApplicationDeprecateNs.deprecateFunc;
export const deprecate: typeof EmberApplicationDeprecateNs.deprecate;
export const deprecate: typeof EmberDebugNs.deprecate;
export const getOwner: typeof EmberApplicationNs.getOwner;
export const setOwner: typeof EmberApplicationNs.setOwner;
export class EventDispatcher extends EmberEventDispatcher {}
Expand Down Expand Up @@ -238,9 +236,11 @@ declare module 'ember' {
const service: typeof EmberServiceNs.inject;
}
namespace ENV {
const EXTEND_PROTOTYPES: boolean | {
Array: boolean;
};
const EXTEND_PROTOTYPES:
| boolean
| {
Array: boolean;
};
const LOG_BINDINGS: boolean;
const LOG_STACKTRACE_ON_DEPRECATION: boolean;
const LOG_VERSION: boolean;
Expand Down
1 change: 0 additions & 1 deletion types/preview/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import './ember/-private/type-utils';
import './@ember/application';
import './@ember/application/-private/event-dispatcher';
import './@ember/application/-private/registry';
import './@ember/application/deprecations';
import './@ember/application/instance';
import './@ember/application/types';

Expand Down

0 comments on commit dee4039

Please sign in to comment.