Commit bbd7bd8
Address review: drop cache, simplify pluralize, collapse setup-resolver
Feedback from the review of PR #21303:
- "how much do we care about keeping this cache around?" (it's from
ember-string) — drop the Cache helper and its test file. dasherize
is now a plain `replace.toLowerCase().replace` in strict-resolver/
string.js. For the workloads the resolver sees (module lookups
during boot) the cache is noise.
- "we don't need to specify this list -- the class that has
`modules = ` assignable on it should be able to specify their
inflection rules" — drop the built-in IRREGULAR_PLURALS table and
the -s/-es / consonant-y suffix rules. Pluralization is back to
naive `type + 's'`, matching ember-resolver's behavior. Consumers
that want children / people / buses register them up-front via the
`plurals` constructor option, same as they already do for `config`.
- "is this true? does ember-resolver do this?" — the regex-based
rules weren't in ember-resolver either; they're gone alongside
the irregulars.
- "let's remove this function, I think" — delete the setupResolver
helper and its file; basic-test.js now instantiates StrictResolver
directly in beforeEach.
- "can we also add a strict application to the v2 app scenarios? I
thiiiiiink we just need to overwrite the app.js in that scenario"
— yes: add `strictResolver` as a variant of v2AppScenarios (in
addition to embroiderVite). basic-test.ts now runs against both
v2 configurations.
Tests updated to match: the suffix/irregular/y→ies cases are removed;
one test left behind proves that registering a custom plural still
lets you do `child: 'children'` explicitly.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent c557ce6 commit bbd7bd8
6 files changed
Lines changed: 44 additions & 133 deletions
File tree
- packages/@ember/engine
- lib
- strict-resolver
- tests/resolver
- smoke-tests/scenarios
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 131 | | |
162 | 132 | | |
163 | 133 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 4 | | |
15 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
16 | 9 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
402 | 367 | | |
403 | 368 | | |
404 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
24 | 52 | | |
25 | 53 | | |
26 | 54 | | |
| |||
34 | 62 | | |
35 | 63 | | |
36 | 64 | | |
| 65 | + | |
37 | 66 | | |
38 | 67 | | |
39 | | - | |
40 | | - | |
41 | 68 | | |
42 | 69 | | |
43 | 70 | | |
| |||
0 commit comments