Skip to content

Commit 33b496c

Browse files
authored
Merge branch 'glimmerjs:main' into add-previous-element-to-in-element
2 parents e6ba8a7 + 72bd97c commit 33b496c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1173
-1115
lines changed

CHANGELOG.md

+70
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,76 @@
1818

1919

2020

21+
22+
23+
24+
25+
26+
27+
## v0.92.0 (2024-04-08)
28+
29+
#### :rocket: Enhancement
30+
* `@glimmer-workspace/integration-tests`, `@glimmer/compiler`, `@glimmer/interfaces`, `@glimmer/syntax`
31+
* [#1585](https://github.com/glimmerjs/glimmer-vm/pull/1585) Introduce `keywords` option for `precompile` ([@chancancode](https://github.com/chancancode))
32+
33+
#### Committers: 1
34+
- Godfrey Chan ([@chancancode](https://github.com/chancancode))
35+
36+
## v0.91.2 (2024-04-05)
37+
38+
#### :bug: Bug Fix
39+
* `@glimmer/syntax`
40+
* [#1577](https://github.com/glimmerjs/glimmer-vm/pull/1577) fix extra spaces in block params ([@patricklx](https://github.com/patricklx))
41+
42+
#### Committers: 1
43+
- Patrick Pircher ([@patricklx](https://github.com/patricklx))
44+
45+
## v0.91.1 (2024-03-28)
46+
47+
#### :bug: Bug Fix
48+
* `@glimmer/syntax`
49+
* [#1583](https://github.com/glimmerjs/glimmer-vm/pull/1583) [BUGFIX] Ensure legacy path.parts matches existing semantics ([@chancancode](https://github.com/chancancode))
50+
51+
#### Committers: 1
52+
- Godfrey Chan ([@chancancode](https://github.com/chancancode))
53+
54+
## v0.91.0 (2024-03-25)
55+
56+
#### :rocket: Enhancement
57+
* `@glimmer/syntax`
58+
* [#1582](https://github.com/glimmerjs/glimmer-vm/pull/1582) Prevent use of ...attributes in invalid places ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
59+
60+
#### Committers: 1
61+
- [@NullVoxPopuli](https://github.com/NullVoxPopuli)
62+
63+
## v0.90.1 (2024-03-22)
64+
65+
#### :bug: Bug Fix
66+
* `@glimmer/compiler`, `@glimmer/syntax`
67+
* [#1581](https://github.com/glimmerjs/glimmer-vm/pull/1581) Remove index imports as they are not defined by package.json#exports ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
68+
69+
#### Committers: 1
70+
- [@NullVoxPopuli](https://github.com/NullVoxPopuli)
71+
72+
## v0.90.0 (2024-03-22)
73+
74+
#### :boom: Breaking Change
75+
* `@glimmer-workspace/integration-tests`, `@glimmer/runtime`
76+
* [#1580](https://github.com/glimmerjs/glimmer-vm/pull/1580) Remove deprecation for setting hash properties (from years ago) ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
77+
78+
#### :rocket: Enhancement
79+
* `@glimmer-workspace/integration-tests`, `@glimmer/runtime`
80+
* [#1580](https://github.com/glimmerjs/glimmer-vm/pull/1580) Remove deprecation for setting hash properties (from years ago) ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
81+
82+
#### :bug: Bug Fix
83+
* `@glimmer/compiler`, `@glimmer/debug`, `@glimmer/encoder`, `@glimmer/global-context`, `@glimmer/interfaces`, `@glimmer/local-debug-flags`, `@glimmer/manager`, `@glimmer/node`, `@glimmer/opcode-compiler`, `@glimmer/program`, `@glimmer/syntax`, `@glimmer/vm`
84+
* [#1579](https://github.com/glimmerjs/glimmer-vm/pull/1579) Add missing licenses ([@andreyfel](https://github.com/andreyfel))
85+
86+
#### Committers: 3
87+
- Andrey Fel ([@andreyfel](https://github.com/andreyfel))
88+
- Godfrey Chan ([@chancancode](https://github.com/chancancode))
89+
- [@NullVoxPopuli](https://github.com/NullVoxPopuli)
90+
2191
## v0.89.0 (2024-03-09)
2292

2393
#### :rocket: Enhancement

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "glimmer-engine",
3-
"version": "0.89.0",
3+
"version": "0.92.0",
44
"private": true,
55
"license": "MIT",
66
"description": "Glimmer compiles Handlebars templates into document fragments rather than string buffers",

packages/@glimmer-workspace/integration-tests/lib/modes/jit/compilation-context.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default class JitCompileTimeLookup implements CompileTimeResolver {
2323
return this.resolver.lookupComponent(name, owner);
2424
}
2525

26-
lookupBuiltInHelper(_name: string): Nullable<HelperDefinitionState> {
27-
return null;
26+
lookupBuiltInHelper(name: string): Nullable<HelperDefinitionState> {
27+
return this.resolver.lookupHelper(`$keyword.${name}`);
2828
}
2929

3030
lookupBuiltInModifier(_name: string): Nullable<ModifierDefinitionState> {

packages/@glimmer-workspace/integration-tests/lib/test-helpers/define.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ export interface DefineComponentOptions {
9696

9797
// defaults to true when some scopeValues are passed and false otherwise
9898
strictMode?: boolean;
99+
100+
// additional strict-mode keywords
101+
keywords?: string[];
99102
}
100103

101104
export function defineComponent(
@@ -110,8 +113,10 @@ export function defineComponent(
110113
strictMode = scopeValues !== null;
111114
}
112115

116+
let keywords = options.keywords ?? [];
117+
113118
let definition = options.definition ?? templateOnlyComponent();
114-
let templateFactory = createTemplate(templateSource, { strictMode }, scopeValues ?? {});
119+
let templateFactory = createTemplate(templateSource, { strictMode, keywords }, scopeValues ?? {});
115120
setComponentTemplate(templateFactory, definition);
116121
return definition;
117122
}

packages/@glimmer-workspace/integration-tests/test/helpers/hash-test.ts

-87
Original file line numberDiff line numberDiff line change
@@ -185,93 +185,6 @@ class HashTest extends RenderTest {
185185
this.assertHTML('Godfrey');
186186
this.assertStableRerender();
187187
}
188-
189-
@test
190-
'defined hash keys can be updated'(assert: Assert) {
191-
class FooBar extends GlimmerishComponent {
192-
constructor(owner: object, args: { hash: Record<string, unknown> }) {
193-
super(owner, args);
194-
args.hash['firstName'] = 'Chad';
195-
196-
assert.strictEqual(args.hash['firstName'], 'Chad', 'Name updated in JS');
197-
}
198-
}
199-
200-
this.registerComponent('Glimmer', 'FooBar', `{{yield @hash}}`, FooBar);
201-
202-
this.render(
203-
`<FooBar @hash={{hash firstName="Godfrey" lastName="Hietala"}} as |values|>{{values.firstName}} {{values.lastName}}</FooBar>`
204-
);
205-
206-
// Name will not be updated in templates because templates access the child
207-
// reference on hashes directly
208-
this.assertHTML('Godfrey Hietala');
209-
this.assertStableRerender();
210-
211-
assert.validateDeprecations(
212-
/You set the 'firstName' property on a \{\{hash\}\} object. Setting properties on objects generated by \{\{hash\}\} is deprecated. Please update to use an object created with a tracked property or getter, or with a custom helper./u
213-
);
214-
}
215-
216-
@test
217-
'defined hash keys are reset whenever the upstream changes'(assert: Assert) {
218-
class FooBar extends GlimmerishComponent {
219-
constructor(owner: object, args: { hash: Record<string, unknown> }) {
220-
super(owner, args);
221-
args.hash['name'] = 'Chad';
222-
}
223-
224-
get alias() {
225-
return (this.args['hash'] as Record<string, unknown>)['name'];
226-
}
227-
}
228-
229-
this.registerComponent('Glimmer', 'FooBar', `{{yield @hash this.alias}}`, FooBar);
230-
231-
this.render(
232-
`<FooBar @hash={{hash name=this.name}} as |values alias|>{{values.name}} {{alias}}</FooBar>`,
233-
{
234-
name: 'Godfrey',
235-
}
236-
);
237-
238-
// JS alias will be updated, version accessed lazily in templates will not
239-
this.assertHTML('Godfrey Chad');
240-
this.assertStableRerender();
241-
242-
this.rerender({ name: 'Tom' });
243-
244-
// Both will be updated to match the new value
245-
this.assertHTML('Tom Tom');
246-
this.assertStableRerender();
247-
248-
assert.validateDeprecations(
249-
/You set the 'name' property on a \{\{hash\}\} object. Setting properties on objects generated by \{\{hash\}\} is deprecated. Please update to use an object created with a tracked property or getter, or with a custom helper./u
250-
);
251-
}
252-
253-
@test
254-
'undefined hash keys can be updated'(assert: Assert) {
255-
class FooBar extends GlimmerishComponent {
256-
constructor(owner: object, args: { hash: Record<string, unknown> }) {
257-
super(owner, args);
258-
args.hash['lastName'] = 'Chan';
259-
}
260-
}
261-
262-
this.registerComponent('Glimmer', 'FooBar', `{{yield @hash}}`, FooBar);
263-
264-
this.render(
265-
`<FooBar @hash={{hash firstName="Godfrey"}} as |values|>{{values.firstName}} {{values.lastName}}</FooBar>`
266-
);
267-
268-
this.assertHTML('Godfrey Chan');
269-
this.assertStableRerender();
270-
271-
assert.validateDeprecations(
272-
/You set the 'lastName' property on a \{\{hash\}\} object. Setting properties on objects generated by \{\{hash\}\} is deprecated. Please update to use an object created with a tracked property or getter, or with a custom helper./u
273-
);
274-
}
275188
}
276189

277190
jitSuite(HashTest);

packages/@glimmer-workspace/integration-tests/test/modifiers/dynamic-modifiers-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class DynamicModifiersResolutionModeTest extends RenderTest {
156156
this.registerComponent('TemplateOnly', 'Bar', '<div {{x.foo}}></div>');
157157
},
158158
syntaxErrorFor(
159-
'You attempted to invoke a path (`{{#x.foo}}`) as a modifier, but x was not in scope. Try adding `this` to the beginning of the path',
159+
'You attempted to invoke a path (`{{x.foo}}`) as a modifier, but x was not in scope',
160160
'{{x.foo}}',
161161
'an unknown module',
162162
1,

0 commit comments

Comments
 (0)