Skip to content

Commit

Permalink
removes transaction renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Garrett committed Nov 16, 2019
1 parent c48ed67 commit d610c63
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 236 deletions.
6 changes: 2 additions & 4 deletions packages/@ember/-internals/glimmer/lib/renderer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ENV } from '@ember/-internals/environment';
import { runInAutotrackingTransaction, runInTransaction } from '@ember/-internals/metal';
import { runInAutotrackingTransaction } from '@ember/-internals/metal';
import { getViewElement, getViewId } from '@ember/-internals/views';
import { assert } from '@ember/debug';
import { backburner, getCurrentRunLoop } from '@ember/runloop';
Expand Down Expand Up @@ -432,9 +432,7 @@ export abstract class Renderer {
root.options.alwaysRevalidate = shouldReflush;
// track shouldReflush based on this roots render result
if (DEBUG) {
runInAutotrackingTransaction(() => {
shouldReflush = root.shouldReflush = runInTransaction(root, 'render');
});
runInAutotrackingTransaction(() => root.render());
} else {
root.render();
}
Expand Down
49 changes: 2 additions & 47 deletions packages/@ember/-internals/glimmer/lib/utils/references.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
consume,
didRender,
get,
set,
tagFor,
Expand All @@ -16,7 +15,6 @@ import { DEBUG } from '@glimmer/env';
import { Dict, Opaque } from '@glimmer/interfaces';
import {
combine,
COMPUTE,
ConstReference,
createTag,
createUpdatableTag,
Expand Down Expand Up @@ -105,32 +103,6 @@ export class RootReference<T extends object> extends ConstReference<T>
}
}

let TwoWayFlushDetectionTag: {
create(tag: Tag, key: string, ref: VersionedPathReference<Opaque>): Tag;
};

if (DEBUG) {
TwoWayFlushDetectionTag = class TwoWayFlushDetectionTag {
static create(tag: Tag, key: string, ref: VersionedPathReference<Opaque>): Tag {
return (new TwoWayFlushDetectionTag(tag, key, ref) as unknown) as Tag;
}

constructor(
private tag: Tag,
private key: string,
private ref: VersionedPathReference<Opaque>
) {}

[COMPUTE](): Revision {
return this.tag[COMPUTE]();
}

didCompute(parent: Opaque): void {
didRender(parent, this.key, this.ref);
}
};
}

export abstract class PropertyReference extends CachedReference {
abstract tag: Tag;

Expand Down Expand Up @@ -162,11 +134,7 @@ export class RootPropertyReference extends PropertyReference
update(tag, tagForProperty(parentValue, propertyKey));
}

if (DEBUG) {
this.tag = TwoWayFlushDetectionTag.create(this.propertyTag, propertyKey, this);
} else {
this.tag = this.propertyTag;
}
this.tag = this.propertyTag;

if (DEBUG && !EMBER_METAL_TRACKED_PROPERTIES) {
watchKey(parentValue, propertyKey);
Expand All @@ -176,10 +144,6 @@ export class RootPropertyReference extends PropertyReference
compute(): Opaque {
let { parentValue, propertyKey } = this;

if (DEBUG) {
(this.tag as any).didCompute(parentValue);
}

let ret;

if (EMBER_METAL_TRACKED_PROPERTIES) {
Expand Down Expand Up @@ -220,12 +184,7 @@ export class NestedPropertyReference extends PropertyReference {
let parentReferenceTag = parentReference.tag;
let propertyTag = (this.propertyTag = createUpdatableTag());

if (DEBUG) {
let tag = combine([parentReferenceTag, propertyTag]);
this.tag = TwoWayFlushDetectionTag.create(tag, propertyKey, this);
} else {
this.tag = combine([parentReferenceTag, propertyTag]);
}
this.tag = combine([parentReferenceTag, propertyTag]);
}

compute(): Opaque {
Expand All @@ -245,10 +204,6 @@ export class NestedPropertyReference extends PropertyReference {
watchKey(parentValue, propertyKey);
}

if (DEBUG) {
(this.tag as any).didCompute(parentValue);
}

let ret;

if (EMBER_METAL_TRACKED_PROPERTIES) {
Expand Down
1 change: 0 additions & 1 deletion packages/@ember/-internals/metal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export { addObserver, activateObserver, removeObserver, flushAsyncObservers } fr
export { Mixin, aliasMethod, mixin, observer, applyMixin } from './lib/mixin';
export { default as inject, DEBUG_INJECTION_FUNCTIONS } from './lib/injected_property';
export { tagForProperty, tagFor, markObjectAsDirty, UNKNOWN_PROPERTY_TAG } from './lib/tags';
export { default as runInTransaction, didRender, assertNotRendered } from './lib/transaction';
export {
consume,
Tracker,
Expand Down
6 changes: 0 additions & 6 deletions packages/@ember/-internals/metal/lib/property_events.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { Meta, peekMeta } from '@ember/-internals/meta';
import { symbol } from '@ember/-internals/utils';
import { EMBER_METAL_TRACKED_PROPERTIES } from '@ember/canary-features';
import { DEBUG } from '@glimmer/env';
import changeEvent from './change_event';
import { descriptorForProperty } from './descriptor_map';
import { sendEvent } from './events';
import { flushSyncObservers } from './observer';
import ObserverSet from './observer_set';
import { markObjectAsDirty } from './tags';
import { assertNotRendered } from './transaction';

/**
@module ember
Expand Down Expand Up @@ -69,10 +67,6 @@ function notifyPropertyChange(obj: object, keyName: string, _meta?: Meta | null)
if (PROPERTY_DID_CHANGE in obj) {
obj[PROPERTY_DID_CHANGE](keyName);
}

if (DEBUG) {
assertNotRendered(obj, keyName);
}
}

const SEEN_MAP = new Map<object, Set<string>>();
Expand Down
1 change: 1 addition & 0 deletions packages/@ember/-internals/metal/lib/tracked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ if (DEBUG) {
// this when the value is minified.
if (
name.match(/<.*:ember\d+>/) &&
className &&
!className.startsWith('_') &&
className.length > 2 &&
className !== 'Class'
Expand Down
178 changes: 0 additions & 178 deletions packages/@ember/-internals/metal/lib/transaction.ts

This file was deleted.

0 comments on commit d610c63

Please sign in to comment.