Skip to content
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,4 @@
}
},
"packageManager": "[email protected]"
}
}
24 changes: 13 additions & 11 deletions packages/@ember/-internals/glimmer/lib/component-managers/curly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getOwner,
setOwner,
} from '@ember/-internals/owner';
import { enumerableSymbol, guidFor } from '@ember/-internals/utils';
import { guidFor } from '@ember/-internals/utils';
import { addChildView, setElementView, setViewElement } from '@ember/-internals/views';
import type { Nullable } from '@ember/-internals/utility-types';
import { assert, debugFreeze } from '@ember/debug';
Expand Down Expand Up @@ -53,8 +53,13 @@ import {
import ComponentStateBucket from '../utils/curly-component-state-bucket';
import { processComponentArgs } from '../utils/process-args';

export const ARGS = enumerableSymbol('ARGS');
export const HAS_BLOCK = enumerableSymbol('HAS_BLOCK');
const COMPONENT_ARGS_MAP = new WeakMap<object, CapturedArguments['named']>();

export function getComponentCapturedArgs(
component: object
): CapturedArguments['named'] | undefined {
return COMPONENT_ARGS_MAP.get(component);
}

export const DIRTY_TAG = Symbol('DIRTY_TAG');
export const IS_DISPATCHING_ATTRS = Symbol('IS_DISPATCHING_ATTRS');
Expand Down Expand Up @@ -248,8 +253,7 @@ export default class CurlyComponentManager
args: VMArguments,
{ isInteractive }: Environment,
dynamicScope: DynamicScope,
callerSelfRef: Reference,
hasBlock: boolean
callerSelfRef: Reference
): ComponentStateBucket {
// Get the nearest concrete component instance from the scope. "Virtual"
// components will be skipped.
Expand All @@ -261,7 +265,6 @@ export default class CurlyComponentManager

beginTrackFrame();
let props = processComponentArgs(capturedArgs);
props[ARGS] = capturedArgs;
let argsTag = endTrackFrame();

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

// Set whether this component was invoked with a block
// (`{{#my-component}}{{/my-component}}`) or without one
// (`{{my-component}}`).
props[HAS_BLOCK] = hasBlock;
Comment thread
NullVoxPopuli marked this conversation as resolved.

// Save the current `this` context of the template as the component's
// `_target`, so bubbled actions are routed to the right place.
props._target = valueForRef(callerSelfRef);
Expand All @@ -293,6 +291,10 @@ export default class CurlyComponentManager
beginUntrackFrame();
let component = ComponentClass.create(props);

// Store capturedArgs in a WeakMap keyed by the component instance so that
// PROPERTY_DID_CHANGE can look them up
COMPONENT_ARGS_MAP.set(component, capturedArgs);

let finalizer = _instrumentStart('render.component', initialRenderInstrumentDetails, component);

// We become the new parentView for downstream components, so save our
Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/-internals/glimmer/lib/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import type { DirtyableTag } from '@glimmer/validator';
import { createTag, dirtyTag } from '@glimmer/validator';
import type { SimpleElement } from '@simple-dom/interface';
import {
ARGS,
BOUNDS,
CURLY_COMPONENT_MANAGER,
DIRTY_TAG,
IS_DISPATCHING_ATTRS,
getComponentCapturedArgs,
} from './component-managers/curly';
import { hasDOM } from '@ember/-internals/browser-environment';

Expand Down Expand Up @@ -1038,7 +1038,7 @@ class Component<S = unknown>
return;
}

let args = (this as any)[ARGS];
let args = getComponentCapturedArgs(this);
let reference = args !== undefined ? args[key] : undefined;

if (reference !== undefined && isUpdatableRef(reference)) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/-internals/meta/lib/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ComputedProperty } from '@ember/-internals/metal';
import { symbol, toString } from '@ember/-internals/utils';
import { toString } from '@ember/-internals/utils';
import { assert } from '@ember/debug';
import { isDestroyed } from '@glimmer/destroyable';
import { DEBUG } from '@glimmer/env';
Expand Down Expand Up @@ -58,7 +58,7 @@ if (DEBUG) {
@module ember
*/

export const UNDEFINED = symbol('undefined');
export const UNDEFINED = Symbol('undefined');

const enum ListenerKind {
ADD = 0,
Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/-internals/metal/lib/property_get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
@module @ember/object
*/
import type { _ProxyMixin as ProxyMixin } from '@ember/-internals/runtime';
import { setProxy, symbol } from '@ember/-internals/utils';
import { setProxy } from '@ember/-internals/utils';
import { isEmberArray } from '@ember/array/-internals';
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';
import { consumeTag, isTracking, tagFor, track } from '@glimmer/validator';
import { isPath } from './path_cache';

export const PROXY_CONTENT = symbol('PROXY_CONTENT');
export const PROXY_CONTENT = Symbol('PROXY_CONTENT');

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

Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/-internals/metal/lib/tags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isObject, setupMandatorySetter, symbol, toString } from '@ember/-internals/utils';
import { isObject, setupMandatorySetter, toString } from '@ember/-internals/utils';
import { assert } from '@ember/debug';
import { isDestroyed } from '@glimmer/destroyable';
import { DEBUG } from '@glimmer/env';
Expand All @@ -15,7 +15,7 @@ type CustomTagFnWithMandatorySetter = (
) => Tag;

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

export function tagForProperty(
obj: object,
Expand Down
1 change: 0 additions & 1 deletion packages/@ember/-internals/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
Utility methods that are needed in < 80% of cases should be placed
elsewhere (so they can be lazily evaluated / parsed).
*/
export { symbol, enumerableSymbol, isInternalSymbol } from './lib/symbol';
export { default as dictionary } from './lib/dictionary';
export { default as getDebugName } from './lib/get-debug-name';
export { uuid, GUID_KEY, generateGuid, guidFor } from './lib/guid';
Expand Down
28 changes: 0 additions & 28 deletions packages/@ember/-internals/utils/lib/symbol.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/@ember/controller/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { DecoratorPropertyDescriptor, ElementDescriptor } from '@ember/-int
import Mixin from '@ember/object/mixin';
import type { RouteArgs } from '@ember/routing/-internals';
import { ActionHandler } from '@ember/-internals/runtime';
import { symbol } from '@ember/-internals/utils';
import type { Transition } from 'router_js';

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

const MODEL = symbol('MODEL');
const MODEL = Symbol('MODEL');

/**
@module @ember/controller
Expand Down
3 changes: 1 addition & 2 deletions packages/@ember/object/-internals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export { guidFor } from '@ember/-internals/utils';

import { addListener } from '@ember/-internals/metal';
import { assert } from '@ember/debug';
import { symbol } from '@ember/-internals/utils';
import { DEBUG } from '@glimmer/env';
import EmberObject from '.';

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

if (DEBUG) {
const INIT_WAS_CALLED = Symbol('INIT_WAS_CALLED');
let ASSERT_INIT_WAS_CALLED = symbol('ASSERT_INIT_WAS_CALLED');
let ASSERT_INIT_WAS_CALLED = Symbol('ASSERT_INIT_WAS_CALLED');

FrameworkObject = class DebugFrameworkObject extends EmberObject {
[INIT_WAS_CALLED] = false;
Expand Down
3 changes: 1 addition & 2 deletions packages/@ember/object/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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