@norith/glimmerx-babel-preset 1.0.5 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -1
- package/package.json +6 -3
- package/test/fixtures/debug/output.js +19 -39
- package/test/fixtures/production/output.js +19 -39
package/index.js
CHANGED
|
@@ -8,7 +8,9 @@ module.exports = function (api, options) {
|
|
|
8
8
|
return {
|
|
9
9
|
presets: [
|
|
10
10
|
[
|
|
11
|
-
__loadPlugins
|
|
11
|
+
__loadPlugins
|
|
12
|
+
? require('@norith/glimmer-babel-preset')
|
|
13
|
+
: require.resolve('@norith/glimmer-babel-preset'),
|
|
12
14
|
{
|
|
13
15
|
...options,
|
|
14
16
|
__customInlineTemplateModules: {
|
|
@@ -22,6 +24,14 @@ module.exports = function (api, options) {
|
|
|
22
24
|
export: 'hbs',
|
|
23
25
|
useTemplateLiteralProposalSemantics: 1,
|
|
24
26
|
},
|
|
27
|
+
'@glimmerx/core': {
|
|
28
|
+
export: 'hbs',
|
|
29
|
+
useTemplateLiteralProposalSemantics: 1,
|
|
30
|
+
},
|
|
31
|
+
'@norith/glimmerx-core': {
|
|
32
|
+
export: 'hbs',
|
|
33
|
+
useTemplateLiteralProposalSemantics: 1,
|
|
34
|
+
},
|
|
25
35
|
|
|
26
36
|
'TEMPLATE-TAG-MODULE': {
|
|
27
37
|
export: 'GLIMMER_TEMPLATE',
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@norith/glimmerx-babel-preset",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "GlimmerX Babel Preset",
|
|
5
|
-
"repository":
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/snorith/glimmer-experimental"
|
|
8
|
+
},
|
|
6
9
|
"author": "Tom Dale <tom@tomdale.net>",
|
|
7
10
|
"license": "MIT",
|
|
8
11
|
"private": false,
|
|
@@ -10,7 +13,7 @@
|
|
|
10
13
|
"test": "mocha -r esm"
|
|
11
14
|
},
|
|
12
15
|
"dependencies": {
|
|
13
|
-
"@norith/glimmer-babel-preset": "^1.0.
|
|
16
|
+
"@norith/glimmer-babel-preset": "^1.0.2"
|
|
14
17
|
},
|
|
15
18
|
"devDependencies": {
|
|
16
19
|
"babel-plugin-tester": "^6.4.0",
|
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
var _class, _descriptor, _cantTouchThis,
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
14
|
-
|
|
15
|
-
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.'); }
|
|
16
|
-
|
|
17
|
-
import { setComponentTemplate as _setComponentTemplate } from "@glimmer/core";
|
|
18
|
-
import { createTemplateFactory as _createTemplateFactory } from "@glimmer/core";
|
|
1
|
+
var _class, _descriptor, _cantTouchThis, _Test_brand;
|
|
2
|
+
function _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }
|
|
3
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
4
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
5
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }
|
|
10
|
+
function _initializerWarningHelper(r, e) { throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform."); }
|
|
11
|
+
import { setComponentTemplate as _setComponentTemplate } from "@norith/glimmer-core";
|
|
12
|
+
import { createTemplateFactory as _createTemplateFactory } from "@norith/glimmer-core";
|
|
19
13
|
import { assert, deprecate } from '@norith/glimmer-debug';
|
|
20
14
|
import { tracked } from '@glimmerx/tracking';
|
|
21
15
|
import Component from '@norith/glimmerx-component';
|
|
22
|
-
|
|
23
|
-
if (true
|
|
24
|
-
/* DEBUG */
|
|
25
|
-
) {
|
|
16
|
+
if (true /* DEBUG */) {
|
|
26
17
|
console.log('DEBUG!');
|
|
27
18
|
}
|
|
28
|
-
|
|
29
19
|
(true && assert(true, 'is true'));
|
|
30
20
|
(true && !(false) && deprecate('this is deprecated', false, {
|
|
31
21
|
id: 'foo'
|
|
32
22
|
}));
|
|
33
|
-
|
|
34
23
|
let Test = _setComponentTemplate(_createTemplateFactory(
|
|
35
24
|
/*
|
|
36
25
|
Hello World
|
|
@@ -40,29 +29,20 @@ let Test = _setComponentTemplate(_createTemplateFactory(
|
|
|
40
29
|
"block": "[[[1,\"Hello World\"]],[],false,[]]",
|
|
41
30
|
"moduleName": "(unknown template module)",
|
|
42
31
|
"isStrictMode": true
|
|
43
|
-
}), (_class = (_cantTouchThis = /*#__PURE__*/new WeakMap(),
|
|
32
|
+
}), (_class = (_cantTouchThis = /*#__PURE__*/new WeakMap(), _Test_brand = /*#__PURE__*/new WeakSet(), class Test extends Component {
|
|
44
33
|
constructor(...args) {
|
|
45
34
|
super(...args);
|
|
46
|
-
|
|
47
|
-
_classPrivateMethodInitSpec(this, _hammerTime);
|
|
48
|
-
|
|
35
|
+
_classPrivateMethodInitSpec(this, _Test_brand);
|
|
49
36
|
_initializerDefineProperty(this, "bar", _descriptor, this);
|
|
50
|
-
|
|
51
|
-
_classPrivateFieldInitSpec(this, _cantTouchThis, {
|
|
52
|
-
writable: true,
|
|
53
|
-
value: 'mc hammer'
|
|
54
|
-
});
|
|
37
|
+
_classPrivateFieldInitSpec(this, _cantTouchThis, 'mc hammer');
|
|
55
38
|
}
|
|
56
|
-
|
|
57
|
-
}), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "bar", [tracked], {
|
|
39
|
+
}), _descriptor = _applyDecoratedDescriptor(_class.prototype, "bar", [tracked], {
|
|
58
40
|
configurable: true,
|
|
59
41
|
enumerable: true,
|
|
60
42
|
writable: true,
|
|
61
43
|
initializer: function () {
|
|
62
44
|
return 123;
|
|
63
45
|
}
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
function _hammerTime2() {}
|
|
67
|
-
|
|
46
|
+
}), _class));
|
|
47
|
+
function _hammerTime() {}
|
|
68
48
|
export { Test as default };
|
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
var _class, _descriptor, _cantTouchThis,
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
14
|
-
|
|
15
|
-
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.'); }
|
|
16
|
-
|
|
17
|
-
import { setComponentTemplate as _setComponentTemplate } from "@glimmer/core";
|
|
18
|
-
import { createTemplateFactory as _createTemplateFactory } from "@glimmer/core";
|
|
1
|
+
var _class, _descriptor, _cantTouchThis, _Test_brand;
|
|
2
|
+
function _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }
|
|
3
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
4
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
5
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }
|
|
10
|
+
function _initializerWarningHelper(r, e) { throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform."); }
|
|
11
|
+
import { setComponentTemplate as _setComponentTemplate } from "@norith/glimmer-core";
|
|
12
|
+
import { createTemplateFactory as _createTemplateFactory } from "@norith/glimmer-core";
|
|
19
13
|
import { assert, deprecate } from '@norith/glimmer-debug';
|
|
20
14
|
import { tracked } from '@glimmerx/tracking';
|
|
21
15
|
import Component from '@norith/glimmerx-component';
|
|
22
|
-
|
|
23
|
-
if (false
|
|
24
|
-
/* DEBUG */
|
|
25
|
-
) {
|
|
16
|
+
if (false /* DEBUG */) {
|
|
26
17
|
console.log('DEBUG!');
|
|
27
18
|
}
|
|
28
|
-
|
|
29
19
|
(false && assert(true, 'is true'));
|
|
30
20
|
(false && !(false) && deprecate('this is deprecated', false, {
|
|
31
21
|
id: 'foo'
|
|
32
22
|
}));
|
|
33
|
-
|
|
34
23
|
let Test = _setComponentTemplate(_createTemplateFactory(
|
|
35
24
|
/*
|
|
36
25
|
Hello World
|
|
@@ -40,29 +29,20 @@ let Test = _setComponentTemplate(_createTemplateFactory(
|
|
|
40
29
|
"block": "[[[1,\"Hello World\"]],[],false,[]]",
|
|
41
30
|
"moduleName": "(unknown template module)",
|
|
42
31
|
"isStrictMode": true
|
|
43
|
-
}), (_class = (_cantTouchThis = /*#__PURE__*/new WeakMap(),
|
|
32
|
+
}), (_class = (_cantTouchThis = /*#__PURE__*/new WeakMap(), _Test_brand = /*#__PURE__*/new WeakSet(), class Test extends Component {
|
|
44
33
|
constructor(...args) {
|
|
45
34
|
super(...args);
|
|
46
|
-
|
|
47
|
-
_classPrivateMethodInitSpec(this, _hammerTime);
|
|
48
|
-
|
|
35
|
+
_classPrivateMethodInitSpec(this, _Test_brand);
|
|
49
36
|
_initializerDefineProperty(this, "bar", _descriptor, this);
|
|
50
|
-
|
|
51
|
-
_classPrivateFieldInitSpec(this, _cantTouchThis, {
|
|
52
|
-
writable: true,
|
|
53
|
-
value: 'mc hammer'
|
|
54
|
-
});
|
|
37
|
+
_classPrivateFieldInitSpec(this, _cantTouchThis, 'mc hammer');
|
|
55
38
|
}
|
|
56
|
-
|
|
57
|
-
}), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "bar", [tracked], {
|
|
39
|
+
}), _descriptor = _applyDecoratedDescriptor(_class.prototype, "bar", [tracked], {
|
|
58
40
|
configurable: true,
|
|
59
41
|
enumerable: true,
|
|
60
42
|
writable: true,
|
|
61
43
|
initializer: function () {
|
|
62
44
|
return 123;
|
|
63
45
|
}
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
function _hammerTime2() {}
|
|
67
|
-
|
|
46
|
+
}), _class));
|
|
47
|
+
function _hammerTime() {}
|
|
68
48
|
export { Test as default };
|