Skip to content

Commit e27cc92

Browse files
authoredJun 9, 2021
Merge pull request #19594 from emberjs/revert-stable-hash
2 parents 886bc51 + bc9feb7 commit e27cc92

File tree

5 files changed

+141
-296
lines changed

5 files changed

+141
-296
lines changed
 

‎package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@babel/plugin-transform-block-scoping": "^7.8.3",
5252
"@babel/plugin-transform-object-assign": "^7.8.3",
5353
"@ember/edition-utils": "^1.2.0",
54-
"@glimmer/vm-babel-plugins": "0.79.3",
54+
"@glimmer/vm-babel-plugins": "0.78.2",
5555
"babel-plugin-debug-macros": "^0.3.3",
5656
"babel-plugin-filter-imports": "^4.0.0",
5757
"broccoli-concat": "^4.2.4",
@@ -76,19 +76,19 @@
7676
},
7777
"devDependencies": {
7878
"@babel/preset-env": "^7.9.5",
79-
"@glimmer/compiler": "0.79.3",
80-
"@glimmer/destroyable": "0.79.3",
79+
"@glimmer/compiler": "0.78.2",
80+
"@glimmer/destroyable": "0.78.2",
8181
"@glimmer/env": "^0.1.7",
82-
"@glimmer/global-context": "0.79.3",
83-
"@glimmer/interfaces": "0.79.3",
84-
"@glimmer/manager": "0.79.3",
85-
"@glimmer/node": "0.79.3",
86-
"@glimmer/opcode-compiler": "0.79.3",
87-
"@glimmer/owner": "0.79.3",
88-
"@glimmer/program": "0.79.3",
89-
"@glimmer/reference": "0.79.3",
90-
"@glimmer/runtime": "0.79.3",
91-
"@glimmer/validator": "0.79.3",
82+
"@glimmer/global-context": "0.78.2",
83+
"@glimmer/interfaces": "0.78.2",
84+
"@glimmer/manager": "0.78.2",
85+
"@glimmer/node": "0.78.2",
86+
"@glimmer/opcode-compiler": "0.78.2",
87+
"@glimmer/owner": "0.78.2",
88+
"@glimmer/program": "0.78.2",
89+
"@glimmer/reference": "0.78.2",
90+
"@glimmer/runtime": "0.78.2",
91+
"@glimmer/validator": "0.78.2",
9292
"@simple-dom/document": "^1.4.0",
9393
"@types/qunit": "^2.9.1",
9494
"@types/rsvp": "^4.0.3",

‎packages/@ember/-internals/glimmer/lib/environment.ts

-8
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,6 @@ const VM_DEPRECATION_OVERRIDES: (DeprecationOptions & {
125125
enabled: '3.27.0',
126126
},
127127
},
128-
{
129-
id: 'setting-on-hash',
130-
until: '4.4.0',
131-
for: 'ember-source',
132-
since: {
133-
enabled: '3.28.0',
134-
},
135-
},
136128
];
137129

138130
const VM_ASSERTION_OVERRIDES: { id: string; message: string }[] = [];

‎packages/@ember/-internals/glimmer/lib/syntax/outlet.ts

+1-20
Original file line numberDiff line numberDiff line change
@@ -98,26 +98,7 @@ export const outletHelper = internalHelper(
9898

9999
if (state !== null) {
100100
let named = dict<Reference>();
101-
102-
// Create a ref for the model
103-
let modelRef = childRefFromParts(outletRef, ['render', 'model']);
104-
105-
// Store the value of the model
106-
let model = valueForRef(modelRef);
107-
108-
// Create a compute ref which we pass in as the `{{@model}}` reference
109-
// for the outlet. This ref will update and return the value of the
110-
// model _until_ the outlet itself changes. Once the outlet changes,
111-
// dynamic scope also changes, and so the original model ref would not
112-
// provide the correct updated value. So we stop updating and return
113-
// the _last_ model value for that outlet.
114-
named.model = createComputeRef(() => {
115-
if (lastState === state) {
116-
model = valueForRef(modelRef);
117-
}
118-
119-
return model;
120-
});
101+
named.model = childRefFromParts(outletRef, ['render', 'model']);
121102

122103
if (DEBUG) {
123104
named.model = createDebugAliasRef!('@model', named.model);

‎packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js

+1-129
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { RenderingTestCase, moduleFor, runTask } from 'internal-test-helpers';
22

33
import { Component } from '../../utils/helpers';
44

5-
import { set, computed } from '@ember/-internals/metal';
6-
import { HAS_NATIVE_PROXY } from '@ember/-internals/utils';
5+
import { set } from '@ember/-internals/metal';
76

87
moduleFor(
98
'Helpers test: {{hash}}',
@@ -187,132 +186,5 @@ moduleFor(
187186

188187
this.assertText('Chad Hietala');
189188
}
190-
191-
['@test works with computeds']() {
192-
let FooBarComponent = Component.extend({
193-
fullName: computed('hash.firstName', 'hash.lastName', function () {
194-
return `${this.hash.firstName} ${this.hash.lastName}`;
195-
}),
196-
});
197-
198-
this.registerComponent('foo-bar', {
199-
ComponentClass: FooBarComponent,
200-
template: `{{this.fullName}}`,
201-
});
202-
203-
this.render(`{{foo-bar hash=(hash firstName=this.firstName lastName=this.lastName)}}`, {
204-
firstName: 'Chad',
205-
lastName: 'Hietala',
206-
});
207-
208-
this.assertText('Chad Hietala');
209-
210-
runTask(() => this.rerender());
211-
212-
this.assertText('Chad Hietala');
213-
214-
runTask(() => {
215-
set(this.context, 'firstName', 'Godfrey');
216-
set(this.context, 'lastName', 'Chan');
217-
});
218-
219-
this.assertText('Godfrey Chan');
220-
}
221-
222-
['@test works with computeds on non-defined properties']() {
223-
let instance;
224-
225-
let FooBarComponent = Component.extend({
226-
init() {
227-
this._super(...arguments);
228-
229-
if (HAS_NATIVE_PROXY) {
230-
expectDeprecation(() => {
231-
set(this.hash, 'lastName', 'Hietala');
232-
}, /You set the '.*' property on a {{hash}} object/);
233-
} else {
234-
set(this.hash, 'lastName', 'Hietala');
235-
}
236-
237-
instance = this;
238-
},
239-
240-
fullName: computed('hash.firstName', 'hash.lastName', function () {
241-
return `${this.hash.firstName} ${this.hash.lastName}`;
242-
}),
243-
});
244-
245-
this.registerComponent('foo-bar', {
246-
ComponentClass: FooBarComponent,
247-
template: `{{this.fullName}}`,
248-
});
249-
250-
this.render(`{{foo-bar hash=(hash firstName=this.firstName)}}`, {
251-
firstName: 'Chad',
252-
lastName: 'Hietala',
253-
});
254-
255-
this.assertText('Chad Hietala');
256-
257-
runTask(() => this.rerender());
258-
259-
this.assertText('Chad Hietala');
260-
261-
runTask(() => {
262-
set(this.context, 'firstName', 'Godfrey');
263-
264-
if (HAS_NATIVE_PROXY) {
265-
expectDeprecation(() => {
266-
set(instance.hash, 'lastName', 'Chan');
267-
}, /You set the '.*' property on a {{hash}} object/);
268-
} else {
269-
set(instance.hash, 'lastName', 'Chan');
270-
}
271-
});
272-
273-
this.assertText('Godfrey Chan');
274-
}
275-
276-
['@test works when properties are set dynamically']() {
277-
let fooBarInstance;
278-
let FooBarComponent = Component.extend({
279-
init() {
280-
this._super();
281-
fooBarInstance = this;
282-
},
283-
});
284-
285-
this.registerComponent('foo-bar', {
286-
ComponentClass: FooBarComponent,
287-
template: `{{this.hash.firstName}} {{this.hash.lastName}}`,
288-
});
289-
290-
this.render(`{{foo-bar hash=(hash firstName=this.firstName)}}`, {
291-
firstName: 'Chad',
292-
});
293-
294-
this.assertText('Chad ');
295-
296-
runTask(() => {
297-
if (HAS_NATIVE_PROXY) {
298-
expectDeprecation(() => {
299-
set(fooBarInstance.hash, 'lastName', 'Hietala');
300-
}, /You set the '.*' property on a {{hash}} object/);
301-
} else {
302-
set(fooBarInstance.hash, 'lastName', 'Hietala');
303-
}
304-
});
305-
306-
this.assertText('Chad Hietala');
307-
308-
runTask(() => {
309-
expectDeprecation(() => {
310-
set(fooBarInstance.hash, 'firstName', 'Godfrey');
311-
set(fooBarInstance.hash, 'lastName', 'Chan');
312-
}, /You set the '.*' property on a {{hash}} object/);
313-
});
314-
315-
this.assertText('Godfrey Chan');
316-
}
317189
}
318190
);

0 commit comments

Comments
 (0)