Skip to content

Commit

Permalink
Upgrade glimmer-vm to v0.92 (#20658)
Browse files Browse the repository at this point in the history
* T.S. '89

* Handle VM breaking changes (new info for modifiers, updated AST)

* Use non-deprecated AST Nodes

* @babel/plugin-proposal-class-properties is required to build ember

* More plugins updates

* '89 -> '90

* '90 -> '91

* New debug-render-tree-nodes to add to existing tests

* Very wip -- something may have gone wrong with the AST stuff in the VM

* shrug

* Finish updating debug-render-tree tests

* TODO: need to move assert-splattribute-expression to glimmer

* Move assert test for splattributes in {{ }} that is now a hard error from @glimmer/syntax

* 0.90.1 -> 0.91.0

* Fix mistaken find and replace

* Fix the state / scope tracker

* Remove mistaken plugin from strict-mode transforms

* Remove tests for code that was supposed to be removed in v4

* Remove extraneous import

* 0.91.0 -> 0.91.1

* Do not expose modifier manager states

* Remove a !

* Revert types/publish.mjs

* Cleanup some types, don't use BlockStatement for scope tracking

* Fix old test: wrapper was not in scope

* restore/rewrite assert-splattribute-expression-test

* Remove default implementation of `getDebugInstance`

We have to make a judgement call per occurance to determine what we
should return here.

This whole mess could use some simplification, but we probably just
won't end up keeping this around for much longer once/if we remove
the action modifier, which is currently the only kind of modifier
we have internally (since `{{on}}` is implemented in glimmer-vm and
essentially duplicates this whole "internal" set up once more time
over there).

* Remove outdated comment

* add back `TransformEachTrackArray`

* Re-apply Program -> Template fix after rebase

* Missing Block visitor

* Additional coverage for strict mode keywords

* Pass list of strict mode keywords when calling precompile

* 0.91.1 -> 0.91.2

* 0.91.2 -> 0.92.0

* Update tests to accoutn for the (action) and {{action}} deprecation

---------

Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
  • Loading branch information
NullVoxPopuli and chancancode committed Apr 10, 2024
1 parent e78142e commit 11feb3a
Show file tree
Hide file tree
Showing 45 changed files with 910 additions and 666 deletions.
33 changes: 17 additions & 16 deletions package.json
Expand Up @@ -58,24 +58,24 @@
"dependencies": {
"@babel/helper-module-imports": "^7.16.7",
"@ember/edition-utils": "^1.2.0",
"@glimmer/compiler": "0.87.1",
"@glimmer/compiler": "0.92.0",
"@glimmer/component": "^1.1.2",
"@glimmer/destroyable": "0.87.1",
"@glimmer/destroyable": "0.92.0",
"@glimmer/env": "^0.1.7",
"@glimmer/global-context": "0.87.1",
"@glimmer/interfaces": "0.87.1",
"@glimmer/manager": "0.87.1",
"@glimmer/node": "0.87.1",
"@glimmer/opcode-compiler": "0.87.1",
"@glimmer/owner": "0.87.1",
"@glimmer/program": "0.87.1",
"@glimmer/reference": "0.87.1",
"@glimmer/runtime": "0.87.1",
"@glimmer/syntax": "0.87.1",
"@glimmer/util": "0.87.1",
"@glimmer/validator": "0.87.1",
"@glimmer/vm": "0.87.1",
"@glimmer/vm-babel-plugins": "0.87.1",
"@glimmer/global-context": "0.92.0",
"@glimmer/interfaces": "0.92.0",
"@glimmer/manager": "0.92.0",
"@glimmer/node": "0.92.0",
"@glimmer/opcode-compiler": "0.92.0",
"@glimmer/owner": "0.92.0",
"@glimmer/program": "0.92.0",
"@glimmer/reference": "0.92.0",
"@glimmer/runtime": "0.92.0",
"@glimmer/syntax": "0.92.0",
"@glimmer/util": "0.92.0",
"@glimmer/validator": "0.92.0",
"@glimmer/vm": "0.92.0",
"@glimmer/vm-babel-plugins": "0.92.0",
"@simple-dom/interface": "^1.4.0",
"babel-plugin-debug-macros": "^0.3.4",
"babel-plugin-ember-template-compilation": "^2.1.1",
Expand Down Expand Up @@ -107,6 +107,7 @@
"devDependencies": {
"@aws-sdk/client-s3": "^3.321.1",
"@babel/core": "^7.22.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.23.6",
"@babel/plugin-transform-typescript": "^7.22.9",
"@babel/preset-env": "^7.16.11",
Expand Down
4 changes: 4 additions & 0 deletions packages/@ember/-internals/glimmer/lib/modifiers/action.ts
Expand Up @@ -200,6 +200,10 @@ class ActionModifierManager implements InternalModifierManager<ActionState, obje
return new ActionState(element, owner, actionId, actionArgs, named, positional);
}

getDebugInstance(): unknown {
return null;
}

getDebugName(): string {
return 'action';
}
Expand Down
4 changes: 3 additions & 1 deletion packages/@ember/-internals/glimmer/lib/modifiers/internal.ts
Expand Up @@ -52,7 +52,7 @@ class InternalModifierState implements Destroyable {
constructor(readonly instance: InternalModifier) {}
}

export class InternalModifierManager
export abstract class InternalModifierManager
implements ModifierManager<InternalModifierState, typeof InternalModifier>
{
constructor(private ModifierClass: typeof InternalModifier, private name: string) {}
Expand All @@ -78,6 +78,8 @@ export class InternalModifierManager
return null;
}

abstract getDebugInstance(state: InternalModifierState): unknown;

getDebugName(): string {
return this.name;
}
Expand Down

0 comments on commit 11feb3a

Please sign in to comment.