Skip to content

Commit d610c63

Browse files
author
Chris Garrett
committed
removes transaction renderer
1 parent c48ed67 commit d610c63

File tree

6 files changed

+5
-236
lines changed

6 files changed

+5
-236
lines changed

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ENV } from '@ember/-internals/environment';
2-
import { runInAutotrackingTransaction, runInTransaction } from '@ember/-internals/metal';
2+
import { runInAutotrackingTransaction } from '@ember/-internals/metal';
33
import { getViewElement, getViewId } from '@ember/-internals/views';
44
import { assert } from '@ember/debug';
55
import { backburner, getCurrentRunLoop } from '@ember/runloop';
@@ -432,9 +432,7 @@ export abstract class Renderer {
432432
root.options.alwaysRevalidate = shouldReflush;
433433
// track shouldReflush based on this roots render result
434434
if (DEBUG) {
435-
runInAutotrackingTransaction(() => {
436-
shouldReflush = root.shouldReflush = runInTransaction(root, 'render');
437-
});
435+
runInAutotrackingTransaction(() => root.render());
438436
} else {
439437
root.render();
440438
}

packages/@ember/-internals/glimmer/lib/utils/references.ts

+2-47
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
consume,
3-
didRender,
43
get,
54
set,
65
tagFor,
@@ -16,7 +15,6 @@ import { DEBUG } from '@glimmer/env';
1615
import { Dict, Opaque } from '@glimmer/interfaces';
1716
import {
1817
combine,
19-
COMPUTE,
2018
ConstReference,
2119
createTag,
2220
createUpdatableTag,
@@ -105,32 +103,6 @@ export class RootReference<T extends object> extends ConstReference<T>
105103
}
106104
}
107105

108-
let TwoWayFlushDetectionTag: {
109-
create(tag: Tag, key: string, ref: VersionedPathReference<Opaque>): Tag;
110-
};
111-
112-
if (DEBUG) {
113-
TwoWayFlushDetectionTag = class TwoWayFlushDetectionTag {
114-
static create(tag: Tag, key: string, ref: VersionedPathReference<Opaque>): Tag {
115-
return (new TwoWayFlushDetectionTag(tag, key, ref) as unknown) as Tag;
116-
}
117-
118-
constructor(
119-
private tag: Tag,
120-
private key: string,
121-
private ref: VersionedPathReference<Opaque>
122-
) {}
123-
124-
[COMPUTE](): Revision {
125-
return this.tag[COMPUTE]();
126-
}
127-
128-
didCompute(parent: Opaque): void {
129-
didRender(parent, this.key, this.ref);
130-
}
131-
};
132-
}
133-
134106
export abstract class PropertyReference extends CachedReference {
135107
abstract tag: Tag;
136108

@@ -162,11 +134,7 @@ export class RootPropertyReference extends PropertyReference
162134
update(tag, tagForProperty(parentValue, propertyKey));
163135
}
164136

165-
if (DEBUG) {
166-
this.tag = TwoWayFlushDetectionTag.create(this.propertyTag, propertyKey, this);
167-
} else {
168-
this.tag = this.propertyTag;
169-
}
137+
this.tag = this.propertyTag;
170138

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

179-
if (DEBUG) {
180-
(this.tag as any).didCompute(parentValue);
181-
}
182-
183147
let ret;
184148

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

223-
if (DEBUG) {
224-
let tag = combine([parentReferenceTag, propertyTag]);
225-
this.tag = TwoWayFlushDetectionTag.create(tag, propertyKey, this);
226-
} else {
227-
this.tag = combine([parentReferenceTag, propertyTag]);
228-
}
187+
this.tag = combine([parentReferenceTag, propertyTag]);
229188
}
230189

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

248-
if (DEBUG) {
249-
(this.tag as any).didCompute(parentValue);
250-
}
251-
252207
let ret;
253208

254209
if (EMBER_METAL_TRACKED_PROPERTIES) {

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

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export { addObserver, activateObserver, removeObserver, flushAsyncObservers } fr
6060
export { Mixin, aliasMethod, mixin, observer, applyMixin } from './lib/mixin';
6161
export { default as inject, DEBUG_INJECTION_FUNCTIONS } from './lib/injected_property';
6262
export { tagForProperty, tagFor, markObjectAsDirty, UNKNOWN_PROPERTY_TAG } from './lib/tags';
63-
export { default as runInTransaction, didRender, assertNotRendered } from './lib/transaction';
6463
export {
6564
consume,
6665
Tracker,

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

-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { Meta, peekMeta } from '@ember/-internals/meta';
22
import { symbol } from '@ember/-internals/utils';
33
import { EMBER_METAL_TRACKED_PROPERTIES } from '@ember/canary-features';
4-
import { DEBUG } from '@glimmer/env';
54
import changeEvent from './change_event';
65
import { descriptorForProperty } from './descriptor_map';
76
import { sendEvent } from './events';
87
import { flushSyncObservers } from './observer';
98
import ObserverSet from './observer_set';
109
import { markObjectAsDirty } from './tags';
11-
import { assertNotRendered } from './transaction';
1210

1311
/**
1412
@module ember
@@ -69,10 +67,6 @@ function notifyPropertyChange(obj: object, keyName: string, _meta?: Meta | null)
6967
if (PROPERTY_DID_CHANGE in obj) {
7068
obj[PROPERTY_DID_CHANGE](keyName);
7169
}
72-
73-
if (DEBUG) {
74-
assertNotRendered(obj, keyName);
75-
}
7670
}
7771

7872
const SEEN_MAP = new Map<object, Set<string>>();

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

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ if (DEBUG) {
5959
// this when the value is minified.
6060
if (
6161
name.match(/<.*:ember\d+>/) &&
62+
className &&
6263
!className.startsWith('_') &&
6364
className.length > 2 &&
6465
className !== 'Class'

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

-178
This file was deleted.

0 commit comments

Comments
 (0)