Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap all existing deprecated features for svelting. #16685

Merged
merged 16 commits into from
May 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ module.exports = function() {
'@ember/canary-features/**',
'@ember/debug/index.js',
'@ember/debug/lib/**',
'@ember/deprecated-features/**',
'@ember/error/index.js',
'@ember/polyfills/index.js',
'@ember/polyfills/lib/**',
Expand Down
47 changes: 0 additions & 47 deletions features.json

This file was deleted.

20 changes: 18 additions & 2 deletions packages/@ember/debug/lib/deprecate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import {
DEPRECATE_ID_MISSING,
DEPRECATE_OPTIONS_MISSING,
DEPRECATE_UNTIL_MISSING,
} from '@ember/deprecated-features';
import { DEBUG } from '@glimmer/env';
import { ENV } from 'ember-environment';

Expand Down Expand Up @@ -190,6 +195,7 @@ if (DEBUG) {
}

if (
DEPRECATE_OPTIONS_MISSING &&
(!options || (!options.id && !options.until)) &&
ENV._ENABLE_DEPRECATION_OPTIONS_SUPPORT === true
) {
Expand All @@ -200,15 +206,25 @@ if (DEBUG) {
});
}

if (options && !options.id && ENV._ENABLE_DEPRECATION_OPTIONS_SUPPORT === true) {
if (
DEPRECATE_ID_MISSING &&
options &&
!options.id &&
ENV._ENABLE_DEPRECATION_OPTIONS_SUPPORT === true
) {
deprecate(missingOptionsIdDeprecation, false, {
id: 'ember-debug.deprecate-id-missing',
until: '3.0.0',
url: 'https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options',
});
}

if (options && !options.until && ENV._ENABLE_DEPRECATION_OPTIONS_SUPPORT === true) {
if (
DEPRECATE_UNTIL_MISSING &&
options &&
!options.until &&
ENV._ENABLE_DEPRECATION_OPTIONS_SUPPORT === true
) {
deprecate(missingOptionsUntilDeprecation, !!(options && options.until), {
id: 'ember-debug.deprecate-until-missing',
until: '3.0.0',
Expand Down
17 changes: 17 additions & 0 deletions packages/@ember/deprecated-features/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
export const PROPERTY_BASED_DESCRIPTORS = !!'3.2.0';
export const EMBER_EXTEND_PROTOTYPES = !!'3.2.0-beta.5';
export const DEPRECATE_OPTIONS_MISSING = !!'2.1.0-beta.1';
export const DEPRECATE_ID_MISSING = !!'2.1.0-beta.1';
export const DEPRECATE_UNTIL_MISSING = !!'2.1.0-beta.1';
export const RUN_SYNC = !!'3.0.0-beta.4';
export const REGISTRY_RESOLVER_AS_FUNCTION = !!'2.3.0-beta.3';
export const LOGGER = !!'3.2.0-beta.1';
export const POSITIONAL_PARAM_CONFLICT = !!'3.1.0-beta.1';
export const DID_INIT_ATTRS = !!'2.6.0-beta.1';
export const PROPERTY_WILL_CHANGE = !!'3.1.0-beta.1';
export const PROPERTY_DID_CHANGE = !!'3.1.0-beta.1';
export const ROUTER_ROUTER = !!'3.2.0-beta.1';
export const ORPHAN_OUTLET_RENDER = !!'2.11.0-beta.1';
export const ARRAY_AT_EACH = !!'3.1.0-beta.1';
export const TARGET_OBJECT = !!'2.18.0-beta.1';
export const RENDER_HELPER = !!'2.11.0-beta.1';
export const BINDING_SUPPORT = !!'2.7.0-beta.1';
21 changes: 14 additions & 7 deletions packages/@ember/runloop/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { assert, deprecate, isTesting } from '@ember/debug';
import { onErrorTarget } from 'ember-error-handling';
import { beginPropertyChanges, endPropertyChanges } from 'ember-metal';
import Backburner from 'backburner';
import { RUN_SYNC } from '@ember/deprecated-features';

let currentRunLoop = null;
export function getCurrentRunLoop() {
Expand Down Expand Up @@ -30,7 +31,6 @@ export const _rsvpErrorQueue = `${Math.random()}${Date.now()}`.replace('.', '');
@private
*/
export const queues = [
'sync',
'actions',

// used in router transitions to prevent unnecessary loading state entry
Expand All @@ -46,17 +46,24 @@ export const queues = [
_rsvpErrorQueue,
];

export const backburner = new Backburner(queues, {
sync: {
before: beginPropertyChanges,
after: endPropertyChanges,
},
let backburnerOptions = {
defaultQueue: 'actions',
onBegin,
onEnd,
onErrorTarget,
onErrorMethod: 'onerror',
});
};

if (RUN_SYNC) {
queues.unshift('sync');

backburnerOptions.sync = {
before: beginPropertyChanges,
after: endPropertyChanges,
};
}

export const backburner = new Backburner(queues, backburnerOptions);

/**
@module @ember/runloop
Expand Down
23 changes: 12 additions & 11 deletions packages/container/lib/registry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { assert, deprecate } from '@ember/debug';
import { REGISTRY_RESOLVER_AS_FUNCTION } from '@ember/deprecated-features';
import { assign } from '@ember/polyfills';
import { DEBUG } from '@glimmer/env';
import { ENV } from 'ember-environment';
Expand Down Expand Up @@ -118,8 +119,17 @@ export default class Registry implements IRegistry {
assert(missingResolverFunctionsDeprecation, typeof this.resolver !== 'function');
}

if (typeof this.resolver === 'function' && ENV._ENABLE_RESOLVER_FUNCTION_SUPPORT === true) {
deprecateResolverFunction(this);
if (
REGISTRY_RESOLVER_AS_FUNCTION &&
typeof this.resolver === 'function' &&
ENV._ENABLE_RESOLVER_FUNCTION_SUPPORT === true
) {
deprecate(missingResolverFunctionsDeprecation, false, {
id: 'ember-application.registry-resolver-as-function',
until: '3.0.0',
url: 'https://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function',
});
this.resolver = { resolve: this.resolver as Resolve };
}

this.registrations = dictionary(options.registrations || null);
Expand Down Expand Up @@ -710,15 +720,6 @@ export default class Registry implements IRegistry {
}
}

function deprecateResolverFunction(registry: Registry): void {
deprecate(missingResolverFunctionsDeprecation, false, {
id: 'ember-application.registry-resolver-as-function',
until: '3.0.0',
url: 'https://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function',
});
registry.resolver = { resolve: registry.resolver as Resolve };
}

export declare class DebugRegistry extends Registry {
normalizeInjectionsHash(hash: { [key: string]: LazyInjection }): Injection[];
validateInjections(injections: Injection[]): void;
Expand Down
Loading