Skip to content

Commit 827f34b

Browse files
authored
Merge pull request #21079 from emberjs/nvp/remove-some-ie11-support
Remove some IE11 support (Symbols)
2 parents f2c4d0a + ab00acc commit 827f34b

10 files changed

Lines changed: 24 additions & 54 deletions

File tree

packages/@ember/-internals/glimmer/lib/component-managers/curly.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
getOwner,
55
setOwner,
66
} from '@ember/-internals/owner';
7-
import { enumerableSymbol, guidFor } from '@ember/-internals/utils';
7+
import { guidFor } from '@ember/-internals/utils';
88
import { addChildView, setElementView, setViewElement } from '@ember/-internals/views';
99
import type { Nullable } from '@ember/-internals/utility-types';
1010
import { assert, debugFreeze } from '@ember/debug';
@@ -53,8 +53,13 @@ import {
5353
import ComponentStateBucket from '../utils/curly-component-state-bucket';
5454
import { processComponentArgs } from '../utils/process-args';
5555

56-
export const ARGS = enumerableSymbol('ARGS');
57-
export const HAS_BLOCK = enumerableSymbol('HAS_BLOCK');
56+
const COMPONENT_ARGS_MAP = new WeakMap<object, CapturedArguments['named']>();
57+
58+
export function getComponentCapturedArgs(
59+
component: object
60+
): CapturedArguments['named'] | undefined {
61+
return COMPONENT_ARGS_MAP.get(component);
62+
}
5863

5964
export const DIRTY_TAG = Symbol('DIRTY_TAG');
6065
export const IS_DISPATCHING_ATTRS = Symbol('IS_DISPATCHING_ATTRS');
@@ -248,8 +253,7 @@ export default class CurlyComponentManager
248253
args: VMArguments,
249254
{ isInteractive }: Environment,
250255
dynamicScope: DynamicScope,
251-
callerSelfRef: Reference,
252-
hasBlock: boolean
256+
callerSelfRef: Reference
253257
): ComponentStateBucket {
254258
// Get the nearest concrete component instance from the scope. "Virtual"
255259
// components will be skipped.
@@ -261,7 +265,6 @@ export default class CurlyComponentManager
261265

262266
beginTrackFrame();
263267
let props = processComponentArgs(capturedArgs);
264-
props[ARGS] = capturedArgs;
265268
let argsTag = endTrackFrame();
266269

267270
// Alias `id` argument to `elementId` property on the component instance.
@@ -271,11 +274,6 @@ export default class CurlyComponentManager
271274
// component.
272275
props.parentView = parentView;
273276

274-
// Set whether this component was invoked with a block
275-
// (`{{#my-component}}{{/my-component}}`) or without one
276-
// (`{{my-component}}`).
277-
props[HAS_BLOCK] = hasBlock;
278-
279277
// Save the current `this` context of the template as the component's
280278
// `_target`, so bubbled actions are routed to the right place.
281279
props._target = valueForRef(callerSelfRef);
@@ -293,6 +291,10 @@ export default class CurlyComponentManager
293291
beginUntrackFrame();
294292
let component = ComponentClass.create(props);
295293

294+
// Store capturedArgs in a WeakMap keyed by the component instance so that
295+
// PROPERTY_DID_CHANGE can look them up
296+
COMPONENT_ARGS_MAP.set(component, capturedArgs);
297+
296298
let finalizer = _instrumentStart('render.component', initialRenderInstrumentDetails, component);
297299

298300
// We become the new parentView for downstream components, so save our

packages/@ember/-internals/glimmer/lib/component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ import type { DirtyableTag } from '@glimmer/validator';
2828
import { createTag, dirtyTag } from '@glimmer/validator';
2929
import type { SimpleElement } from '@simple-dom/interface';
3030
import {
31-
ARGS,
3231
BOUNDS,
3332
CURLY_COMPONENT_MANAGER,
3433
DIRTY_TAG,
3534
IS_DISPATCHING_ATTRS,
35+
getComponentCapturedArgs,
3636
} from './component-managers/curly';
3737
import { hasDOM } from '@ember/-internals/browser-environment';
3838

@@ -1038,7 +1038,7 @@ class Component<S = unknown>
10381038
return;
10391039
}
10401040

1041-
let args = (this as any)[ARGS];
1041+
let args = getComponentCapturedArgs(this);
10421042
let reference = args !== undefined ? args[key] : undefined;
10431043

10441044
if (reference !== undefined && isUpdatableRef(reference)) {

packages/@ember/-internals/meta/lib/meta.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ComputedProperty } from '@ember/-internals/metal';
2-
import { symbol, toString } from '@ember/-internals/utils';
2+
import { toString } from '@ember/-internals/utils';
33
import { assert } from '@ember/debug';
44
import { isDestroyed } from '@glimmer/destroyable';
55
import { DEBUG } from '@glimmer/env';
@@ -58,7 +58,7 @@ if (DEBUG) {
5858
@module ember
5959
*/
6060

61-
export const UNDEFINED = symbol('undefined');
61+
export const UNDEFINED = Symbol('undefined');
6262

6363
const enum ListenerKind {
6464
ADD = 0,

packages/@ember/-internals/metal/lib/property_get.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
@module @ember/object
33
*/
44
import type { _ProxyMixin as ProxyMixin } from '@ember/-internals/runtime';
5-
import { setProxy, symbol } from '@ember/-internals/utils';
5+
import { setProxy } from '@ember/-internals/utils';
66
import { isEmberArray } from '@ember/array/-internals';
77
import { assert } from '@ember/debug';
88
import { DEBUG } from '@glimmer/env';
99
import { consumeTag, isTracking, tagFor, track } from '@glimmer/validator';
1010
import { isPath } from './path_cache';
1111

12-
export const PROXY_CONTENT = symbol('PROXY_CONTENT');
12+
export const PROXY_CONTENT = Symbol('PROXY_CONTENT');
1313

1414
export let getPossibleMandatoryProxyValue: (obj: object, keyName: string) => any;
1515

packages/@ember/-internals/metal/lib/tags.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isObject, setupMandatorySetter, symbol, toString } from '@ember/-internals/utils';
1+
import { isObject, setupMandatorySetter, toString } from '@ember/-internals/utils';
22
import { assert } from '@ember/debug';
33
import { isDestroyed } from '@glimmer/destroyable';
44
import { DEBUG } from '@glimmer/env';
@@ -15,7 +15,7 @@ type CustomTagFnWithMandatorySetter = (
1515
) => Tag;
1616

1717
// This is exported for `@tracked`, but should otherwise be avoided. Use `tagForObject`.
18-
export const SELF_TAG: string | symbol = symbol('SELF_TAG');
18+
export const SELF_TAG: string | symbol = Symbol('SELF_TAG');
1919

2020
export function tagForProperty(
2121
obj: object,

packages/@ember/-internals/utils/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Utility methods that are needed in < 80% of cases should be placed
99
elsewhere (so they can be lazily evaluated / parsed).
1010
*/
11-
export { symbol, enumerableSymbol, isInternalSymbol } from './lib/symbol';
1211
export { default as dictionary } from './lib/dictionary';
1312
export { default as getDebugName } from './lib/get-debug-name';
1413
export { uuid, GUID_KEY, generateGuid, guidFor } from './lib/guid';

packages/@ember/-internals/utils/lib/symbol.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/@ember/controller/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import type { DecoratorPropertyDescriptor, ElementDescriptor } from '@ember/-int
66
import Mixin from '@ember/object/mixin';
77
import type { RouteArgs } from '@ember/routing/-internals';
88
import { ActionHandler } from '@ember/-internals/runtime';
9-
import { symbol } from '@ember/-internals/utils';
109
import type { Transition } from 'router_js';
1110

1211
export type ControllerQueryParamType = 'boolean' | 'number' | 'array' | 'string';
@@ -15,7 +14,7 @@ export type ControllerQueryParam =
1514
| Record<string, { type: ControllerQueryParamType }>
1615
| Record<string, string>;
1716

18-
const MODEL = symbol('MODEL');
17+
const MODEL = Symbol('MODEL');
1918

2019
/**
2120
@module @ember/controller

packages/@ember/object/-internals.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export { guidFor } from '@ember/-internals/utils';
33

44
import { addListener } from '@ember/-internals/metal';
55
import { assert } from '@ember/debug';
6-
import { symbol } from '@ember/-internals/utils';
76
import { DEBUG } from '@glimmer/env';
87
import EmberObject from '.';
98

@@ -27,7 +26,7 @@ let FrameworkObject: typeof EmberObject = class FrameworkObject extends EmberObj
2726

2827
if (DEBUG) {
2928
const INIT_WAS_CALLED = Symbol('INIT_WAS_CALLED');
30-
let ASSERT_INIT_WAS_CALLED = symbol('ASSERT_INIT_WAS_CALLED');
29+
let ASSERT_INIT_WAS_CALLED = Symbol('ASSERT_INIT_WAS_CALLED');
3130

3231
FrameworkObject = class DebugFrameworkObject extends EmberObject {
3332
[INIT_WAS_CALLED] = false;

packages/@ember/object/core.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import { getFactoryFor, setFactoryFor } from '@ember/-internals/container';
66
import { type default as Owner, getOwner } from '@ember/-internals/owner';
7-
import { guidFor, isInternalSymbol } from '@ember/-internals/utils';
7+
import { guidFor } from '@ember/-internals/utils';
88
import { meta } from '@ember/-internals/meta';
99
import type { ComputedProperty, HasUnknownProperty } from '@ember/-internals/metal';
1010
import {
@@ -271,7 +271,6 @@ class CoreObject {
271271
// init called will be set on the proxy, not the target, so get with the receiver
272272
!initCalled!.has(receiver) ||
273273
typeof property === 'symbol' ||
274-
isInternalSymbol(property) ||
275274
property === 'toJSON' ||
276275
property === 'toString' ||
277276
property === 'toStringExtension' ||

0 commit comments

Comments
 (0)