diff --git a/packages/@glimmerx/babel-preset/test/fixtures/debug/.babelrc b/packages/@glimmerx/babel-preset/test/fixtures/debug/.babelrc index c74aa0d9..3c3df58f 100644 --- a/packages/@glimmerx/babel-preset/test/fixtures/debug/.babelrc +++ b/packages/@glimmerx/babel-preset/test/fixtures/debug/.babelrc @@ -1,5 +1,5 @@ { "presets": [ - ["@glimmer/babel-preset", { "isDebug": true }] + ["@glimmerx/babel-preset", { "isDebug": true }] ] } diff --git a/packages/@glimmerx/babel-preset/test/fixtures/debug/code.js b/packages/@glimmerx/babel-preset/test/fixtures/debug/code.js index 14b57928..f1054be7 100644 --- a/packages/@glimmerx/babel-preset/test/fixtures/debug/code.js +++ b/packages/@glimmerx/babel-preset/test/fixtures/debug/code.js @@ -1,7 +1,7 @@ import { DEBUG } from '@glimmer/env'; import { assert, deprecate } from '@glimmer/debug'; -import { precompileTemplate } from '@glimmer/core'; -import { tracked } from '@glimmer/tracking'; +import { tracked } from '@glimmerx/tracking'; +import Component, { hbs } from '@glimmerx/component'; if (DEBUG) { console.log('DEBUG!'); @@ -11,12 +11,11 @@ assert(true, 'is true'); deprecate('this is deprecated', false, { id: 'foo' }); -class Test { +export default class Test extends Component { @tracked bar = 123; + static template = hbs`Hello World`; #cantTouchThis = 'mc hammer'; #hammerTime() {} } - -precompileTemplate('Hello, world!', { strictMode: true, scope: { Test } }); diff --git a/packages/@glimmerx/babel-preset/test/fixtures/debug/output.js b/packages/@glimmerx/babel-preset/test/fixtures/debug/output.js index 747d30cd..1be57fe7 100644 --- a/packages/@glimmerx/babel-preset/test/fixtures/debug/output.js +++ b/packages/@glimmerx/babel-preset/test/fixtures/debug/output.js @@ -1,7 +1,5 @@ var _class, _descriptor, _cantTouchThis, _hammerTime; -import { createTemplateFactory as _createTemplateFactory } from "@glimmer/core"; - function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } @@ -10,8 +8,11 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, con function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); } +import { setComponentTemplate as _setComponentTemplate } from "@glimmer/core"; +import { createTemplateFactory as _createTemplateFactory } from "@glimmer/core"; import { assert, deprecate } from '@glimmer/debug'; -import { tracked } from '@glimmer/tracking'; +import { tracked } from '@glimmerx/tracking'; +import Component from '@glimmerx/component'; if (true /* DEBUG */ @@ -23,8 +24,21 @@ if (true (true && !(false) && deprecate('this is deprecated', false, { id: 'foo' })); -let Test = (_class = (_cantTouchThis = new WeakMap(), _hammerTime = new WeakSet(), class Test { - constructor() { + +let Test = _setComponentTemplate(_createTemplateFactory( +/* + Hello World +*/ +{ + "id": null, + "block": "[[[1,\"Hello World\"]],[],false,[]]", + "moduleName": "(unknown template module)", + "scope": null, + "isStrictMode": true +}), (_class = (_cantTouchThis = new WeakMap(), _hammerTime = new WeakSet(), class Test extends Component { + constructor(...args) { + super(...args); + _hammerTime.add(this); _initializerDefineProperty(this, "bar", _descriptor, this); @@ -42,18 +56,8 @@ let Test = (_class = (_cantTouchThis = new WeakMap(), _hammerTime = new WeakSet( initializer: function () { return 123; } -})), _class); +})), _class)); function _hammerTime2() {} -_createTemplateFactory( -/* - Hello, world! -*/ -{ - "id": null, - "block": "[[[1,\"Hello, world!\"]],[],false,[]]", - "moduleName": "(unknown template module)", - "scope": null, - "isStrictMode": true -}); +export { Test as default }; diff --git a/packages/@glimmerx/babel-preset/test/fixtures/production/.babelrc b/packages/@glimmerx/babel-preset/test/fixtures/production/.babelrc index 3b1e4c06..aad794ca 100644 --- a/packages/@glimmerx/babel-preset/test/fixtures/production/.babelrc +++ b/packages/@glimmerx/babel-preset/test/fixtures/production/.babelrc @@ -1,5 +1,5 @@ { "presets": [ - ["@glimmer/babel-preset", { "isDebug": false }] + ["@glimmerx/babel-preset", { "isDebug": false }] ] } diff --git a/packages/@glimmerx/babel-preset/test/fixtures/production/code.js b/packages/@glimmerx/babel-preset/test/fixtures/production/code.js index 14b57928..f1054be7 100644 --- a/packages/@glimmerx/babel-preset/test/fixtures/production/code.js +++ b/packages/@glimmerx/babel-preset/test/fixtures/production/code.js @@ -1,7 +1,7 @@ import { DEBUG } from '@glimmer/env'; import { assert, deprecate } from '@glimmer/debug'; -import { precompileTemplate } from '@glimmer/core'; -import { tracked } from '@glimmer/tracking'; +import { tracked } from '@glimmerx/tracking'; +import Component, { hbs } from '@glimmerx/component'; if (DEBUG) { console.log('DEBUG!'); @@ -11,12 +11,11 @@ assert(true, 'is true'); deprecate('this is deprecated', false, { id: 'foo' }); -class Test { +export default class Test extends Component { @tracked bar = 123; + static template = hbs`Hello World`; #cantTouchThis = 'mc hammer'; #hammerTime() {} } - -precompileTemplate('Hello, world!', { strictMode: true, scope: { Test } }); diff --git a/packages/@glimmerx/babel-preset/test/fixtures/production/output.js b/packages/@glimmerx/babel-preset/test/fixtures/production/output.js index 5644a6f2..f04ce15d 100644 --- a/packages/@glimmerx/babel-preset/test/fixtures/production/output.js +++ b/packages/@glimmerx/babel-preset/test/fixtures/production/output.js @@ -1,7 +1,5 @@ var _class, _descriptor, _cantTouchThis, _hammerTime; -import { createTemplateFactory as _createTemplateFactory } from "@glimmer/core"; - function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } @@ -10,8 +8,11 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, con function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); } +import { setComponentTemplate as _setComponentTemplate } from "@glimmer/core"; +import { createTemplateFactory as _createTemplateFactory } from "@glimmer/core"; import { assert, deprecate } from '@glimmer/debug'; -import { tracked } from '@glimmer/tracking'; +import { tracked } from '@glimmerx/tracking'; +import Component from '@glimmerx/component'; if (false /* DEBUG */ @@ -23,8 +24,21 @@ if (false (false && !(false) && deprecate('this is deprecated', false, { id: 'foo' })); -let Test = (_class = (_cantTouchThis = new WeakMap(), _hammerTime = new WeakSet(), class Test { - constructor() { + +let Test = _setComponentTemplate(_createTemplateFactory( +/* + Hello World +*/ +{ + "id": null, + "block": "[[[1,\"Hello World\"]],[],false,[]]", + "moduleName": "(unknown template module)", + "scope": null, + "isStrictMode": true +}), (_class = (_cantTouchThis = new WeakMap(), _hammerTime = new WeakSet(), class Test extends Component { + constructor(...args) { + super(...args); + _hammerTime.add(this); _initializerDefineProperty(this, "bar", _descriptor, this); @@ -42,18 +56,8 @@ let Test = (_class = (_cantTouchThis = new WeakMap(), _hammerTime = new WeakSet( initializer: function () { return 123; } -})), _class); +})), _class)); function _hammerTime2() {} -_createTemplateFactory( -/* - Hello, world! -*/ -{ - "id": null, - "block": "[[[1,\"Hello, world!\"]],[],false,[]]", - "moduleName": "(unknown template module)", - "scope": null, - "isStrictMode": true -}); +export { Test as default };