Skip to content

Commit

Permalink
Update to latest glimmerjs and glimmer-vm (#93)
Browse files Browse the repository at this point in the history
* Update to latest glimmerjs and glimmer-vm

* Add support for simple helper and modifier functions
  • Loading branch information
chiragpat authored Jan 20, 2021
1 parent 0eea50c commit 1fab40b
Show file tree
Hide file tree
Showing 50 changed files with 572 additions and 512 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/preset-env": "^7.9.5",
"@babel/preset-typescript": "^7.9.0",
"@glimmer/babel-plugin-glimmer-env": "2.0.0-beta.11",
"@glimmer/babel-plugin-glimmer-env": "2.0.0-beta.12",
"@types/qunit": "^2.9.1",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"dependencies": {
"@babel/core": "^7.9.0",
"@babel/helper-module-imports": "^7.8.3",
"@glimmer/babel-plugin-strict-template-precompile": "2.0.0-beta.11",
"@glimmer/syntax": "0.62.4"
"@glimmer/babel-plugin-strict-template-precompile": "2.0.0-beta.12",
"@glimmer/syntax": "0.73.0"
},
"devDependencies": {
"@babel/preset-env": "^7.9.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import Component from '@glimmerx/component';
class MyComponent extends Component {}

_setComponentTemplate({
id: "tBsr36lW",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[1,[30,[36,0],[\"foo\"],null]],[13]],\"hasEval\":false,\"upvars\":[\"_t\"]}",
meta: {
scope: () => ({
_t: _t
})
}
"id": "BFMB8fiz",
"block": "[[[10,\"h1\"],[12],[1,[28,[32,0],[\"foo\"],null]],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [_t],
"isStrictMode": true
}, MyComponent)
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { t as _t } from "t-helper";
import Component from '@glimmerx/component';

const MyComponent = _setComponentTemplate({
id: "tBsr36lW",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[1,[30,[36,0],[\"foo\"],null]],[13]],\"hasEval\":false,\"upvars\":[\"_t\"]}",
meta: {
scope: () => ({
_t: _t
})
}
"id": "BFMB8fiz",
"block": "[[[10,\"h1\"],[12],[1,[28,[32,0],[\"foo\"],null]],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [_t],
"isStrictMode": true
}, class extends Component {});
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { setComponentTemplate as _setComponentTemplate } from "@glimmer/core";
import { t as _t } from "t-helper";

const someTemplate = _setComponentTemplate({
id: "tBsr36lW",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[1,[30,[36,0],[\"foo\"],null]],[13]],\"hasEval\":false,\"upvars\":[\"_t\"]}",
meta: {
scope: () => ({
_t: _t
})
}
"id": "BFMB8fiz",
"block": "[[[10,\"h1\"],[12],[1,[28,[32,0],[\"foo\"],null]],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [_t],
"isStrictMode": true
}, _templateOnlyComponent());
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { templateOnlyComponent as _templateOnlyComponent } from "@glimmer/core";
import { setComponentTemplate as _setComponentTemplate } from "@glimmer/core";

const template = _setComponentTemplate({
id: "iLYq0mJl",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[2,\"Hello world\"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({})
}
"id": "iQBI6eOx",
"block": "[[[10,\"h1\"],[12],[1,\"Hello world\"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": null,
"isStrictMode": true
}, _templateOnlyComponent());
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import Component from '@glimmerx/component';
class MyComponent extends Component {}

_setComponentTemplate({
id: "iLYq0mJl",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[2,\"Hello world\"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({})
}
"id": "iQBI6eOx",
"block": "[[[10,\"h1\"],[12],[1,\"Hello world\"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": null,
"isStrictMode": true
}, MyComponent)
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ const unknownValue = null;
const MaybeComponent = null;
const maybeModifier = null;
class MyComponent extends Component {
static template = hbs`<h1 {{maybeModifier}}>Hello world {{unknownValue}}<MySubComponent><MaybeComponent /></MySubComponent></h1>`;
}
static template = hbs`<h1 {{maybeModifier}}>Hello world {{unknownValue}}<MaybeComponent /></h1>`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ const maybeModifier = null;
class MyComponent extends Component {}

_setComponentTemplate({
id: "fmofmZv3",
block: "{\"symbols\":[],\"statements\":[[11,\"h1\"],[4,[38,0],null,null],[12],[2,\"Hello world \"],[1,[34,1]],[8,\"MySubComponent\",[],[[],[]],[[\"default\"],[{\"statements\":[[8,\"MaybeComponent\",[],[[],[]],null]],\"parameters\":[]}]]],[13]],\"hasEval\":false,\"upvars\":[\"maybeModifier\",\"unknownValue\"]}",
meta: {
scope: () => ({
maybeModifier: maybeModifier,
unknownValue: unknownValue,
MaybeComponent: MaybeComponent
})
}
"id": "jFBJ3iUu",
"block": "[[[11,\"h1\"],[4,[32,0],null,null],[12],[1,\"Hello world \"],[1,[32,1]],[8,[32,2],null,null,null],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [maybeModifier, unknownValue, MaybeComponent],
"isStrictMode": true
}, MyComponent)
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { setComponentTemplate as _setComponentTemplate } from "@glimmer/core";
import Component from '@glimmerx/component';

const MyComponent = _setComponentTemplate({
id: "9bMgfwbA",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[2,\"Hello world\"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({})
}
"id": "UnWFMClF",
"block": "[[[10,\"h1\"],[12],[1,\"Hello world\"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": null,
"isStrictMode": true
}, class extends Component {});
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,43 @@ import Component from '@glimmerx/component';
class Class1Declaration extends Component {}

_dangerouslySetComponentTemplate({
id: "9bMgfwbA",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[2,\"Hello world\"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({})
}
"id": "UnWFMClF",
"block": "[[[10,\"h1\"],[12],[1,\"Hello world\"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": null,
"isStrictMode": true
}, Class1Declaration)

const Class1Expression = _dangerouslySetComponentTemplate({
id: "9bMgfwbA",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[2,\"Hello world\"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({})
}
"id": "UnWFMClF",
"block": "[[[10,\"h1\"],[12],[1,\"Hello world\"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": null,
"isStrictMode": true
}, class extends Component {});

class Class2Declaration extends Component {}

_dangerouslySetComponentTemplate({
id: "+VA0BbEt",
block: "{\"symbols\":[],\"statements\":[[10,\"h2\"],[12],[2,\"\\n Goodbye world\\n \"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({})
}
"id": "PN1+SdGD",
"block": "[[[10,\"h2\"],[12],[1,\"\\n Goodbye world\\n \"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": null,
"isStrictMode": true
}, Class2Declaration)

const Class2Expression = _dangerouslySetComponentTemplate({
id: "uIjvs0yQ",
block: "{\"symbols\":[],\"statements\":[[10,\"h2\"],[12],[2,\"\\n Goodbye world\"],[8,\"Class2Declaration\",[],[[],[]],null],[2,\"\\n \"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({
Class2Declaration: Class2Declaration
})
}
"id": "E/B0dLEA",
"block": "[[[10,\"h2\"],[12],[1,\"\\n Goodbye world\"],[8,[32,0],null,null,null],[1,\"\\n \"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [Class2Declaration],
"isStrictMode": true
}, class extends Component {});

const TOComponent = _dangerouslySetComponentTemplate({
id: "tsv3hFVE",
block: "{\"symbols\":[],\"statements\":[[10,\"h3\"],[12],[2,\"Hello again world\"],[8,\"Class2Expression\",[],[[],[]],null],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({
Class2Expression: Class2Expression
})
}
"id": "fyKZX1dI",
"block": "[[[10,\"h3\"],[12],[1,\"Hello again world\"],[8,[32,0],null,null,null],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [Class2Expression],
"isStrictMode": true
}, _TOComponent());
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ const unknownValue = null;
const MaybeComponent = null;
const maybeModifier = null;
class MyComponent extends Component {
static template = hbs`<h1 {{maybeModifier}}>Hello world {{unknownValue}}<MySubComponent><MaybeComponent /></MySubComponent></h1>`;
}
static template = hbs`<h1 {{maybeModifier}}>Hello world {{unknownValue}}<MaybeComponent /></h1>`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ const maybeModifier = null;
class MyComponent extends Component {}

_setComponentTemplate({
id: "fmofmZv3",
block: "{\"symbols\":[],\"statements\":[[11,\"h1\"],[4,[38,0],null,null],[12],[2,\"Hello world \"],[1,[34,1]],[8,\"MySubComponent\",[],[[],[]],[[\"default\"],[{\"statements\":[[8,\"MaybeComponent\",[],[[],[]],null]],\"parameters\":[]}]]],[13]],\"hasEval\":false,\"upvars\":[\"maybeModifier\",\"unknownValue\"]}",
meta: {
scope: () => ({
maybeModifier: maybeModifier,
unknownValue: unknownValue,
MaybeComponent: MaybeComponent
})
}
"id": "jFBJ3iUu",
"block": "[[[11,\"h1\"],[4,[32,0],null,null],[12],[1,\"Hello world \"],[1,[32,1]],[8,[32,2],null,null,null],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [maybeModifier, unknownValue, MaybeComponent],
"isStrictMode": true
}, MyComponent)
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ if (DEBUG) {
}

class MyComponent extends Component {
static template = hbs`<h1 {{maybeModifier}}>Hello world {{unknownValue}}<MySubComponent><MaybeComponent /></MySubComponent></h1>`;
static template = hbs`<h1 {{maybeModifier}}>Hello world {{unknownValue}}<MaybeComponent /></h1>`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@ if (true
class MyComponent extends Component {}

_setComponentTemplate({
id: "fmofmZv3",
block: "{\"symbols\":[],\"statements\":[[11,\"h1\"],[4,[38,0],null,null],[12],[2,\"Hello world \"],[1,[34,1]],[8,\"MySubComponent\",[],[[],[]],[[\"default\"],[{\"statements\":[[8,\"MaybeComponent\",[],[[],[]],null]],\"parameters\":[]}]]],[13]],\"hasEval\":false,\"upvars\":[\"maybeModifier\",\"unknownValue\"]}",
meta: {
scope: () => ({
maybeModifier: maybeModifier,
unknownValue: unknownValue,
MaybeComponent: MaybeComponent
})
}
"id": "jFBJ3iUu",
"block": "[[[11,\"h1\"],[4,[32,0],null,null],[12],[1,\"Hello world \"],[1,[32,1]],[8,[32,2],null,null,null],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [maybeModifier, unknownValue, MaybeComponent],
"isStrictMode": true
}, MyComponent)
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,33 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
class Class1Declaration extends _component.default {}

(0, _core.setComponentTemplate)({
id: "9bMgfwbA",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[2,\"Hello world\"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({})
}
"id": "UnWFMClF",
"block": "[[[10,\"h1\"],[12],[1,\"Hello world\"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": null,
"isStrictMode": true
}, Class1Declaration)
const Class1Expression = (0, _core.setComponentTemplate)({
id: "9bMgfwbA",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[2,\"Hello world\"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({})
}
"id": "UnWFMClF",
"block": "[[[10,\"h1\"],[12],[1,\"Hello world\"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": null,
"isStrictMode": true
}, class extends _component.default {});

class Class2Declaration extends _component.default {}

(0, _core.setComponentTemplate)({
id: "+VA0BbEt",
block: "{\"symbols\":[],\"statements\":[[10,\"h2\"],[12],[2,\"\\n Goodbye world\\n \"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({})
}
"id": "PN1+SdGD",
"block": "[[[10,\"h2\"],[12],[1,\"\\n Goodbye world\\n \"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": null,
"isStrictMode": true
}, Class2Declaration)
const Class2Expression = (0, _core.setComponentTemplate)({
id: "U1swtToI",
block: "{\"symbols\":[],\"statements\":[[10,\"h2\"],[12],[2,\"\\n Goodbye world\"],[8,\"Class1Expression\",[],[[],[]],null],[2,\"\\n \"],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({
Class1Expression: Class1Expression
})
}
"id": "E/B0dLEA",
"block": "[[[10,\"h2\"],[12],[1,\"\\n Goodbye world\"],[8,[32,0],null,null,null],[1,\"\\n \"],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [Class1Expression],
"isStrictMode": true
}, class extends _component.default {});
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
class MyComponent extends _component.default {}

(0, _core.setComponentTemplate)({
id: "KK5UHDcn",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[2,\"Hello \"],[8,\"ExternalComponent\",[],[[],[]],null],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({
ExternalComponent: _somewhere.OtherComponent
})
}
"id": "rUcvMrKh",
"block": "[[[10,\"h1\"],[12],[1,\"Hello \"],[8,[32,0],null,null,null],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [_somewhere.OtherComponent],
"isStrictMode": true
}, MyComponent)

class OtherComponent extends _component.default {}

(0, _core.setComponentTemplate)({
id: "KK5UHDcn",
block: "{\"symbols\":[],\"statements\":[[10,\"h1\"],[12],[2,\"Hello \"],[8,\"ExternalComponent\",[],[[],[]],null],[13]],\"hasEval\":false,\"upvars\":[]}",
meta: {
scope: () => ({
ExternalComponent: _somewhere.OtherComponent
})
}
"id": "rUcvMrKh",
"block": "[[[10,\"h1\"],[12],[1,\"Hello \"],[8,[32,0],null,null,null],[13]],[],false,[]]",
"moduleName": "(unknown template module)",
"scope": () => [_somewhere.OtherComponent],
"isStrictMode": true
}, OtherComponent)
Loading

0 comments on commit 1fab40b

Please sign in to comment.