From e9bd5cafe0714256ca625d2139ef165ed6710704 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Mon, 10 Mar 2025 14:40:31 -0500 Subject: [PATCH 1/5] transpile to es5 --- .../signals/signals-runtime/babel.config.js | 12 ++ .../build-signals-runtime-global.js | 14 ++ .../bundle-build-tests/runtime-env.test.ts | 4 + packages/signals/signals-runtime/package.json | 3 + .../src/mobile/get-runtime-code.generated.ts | 121 +++++++++++++++++- .../src/web/get-runtime-code.generated.ts | 88 ++++++++++++- yarn.lock | 3 + 7 files changed, 243 insertions(+), 2 deletions(-) create mode 100644 packages/signals/signals-runtime/babel.config.js diff --git a/packages/signals/signals-runtime/babel.config.js b/packages/signals/signals-runtime/babel.config.js new file mode 100644 index 000000000..3d75009e1 --- /dev/null +++ b/packages/signals/signals-runtime/babel.config.js @@ -0,0 +1,12 @@ +module.exports = { + presets: [ + [ + '@babel/preset-env', + { + targets: { + ie: '11', // target es5 -- for example, react-native's QuickJS does not support class + }, + }, + ], + ], +} diff --git a/packages/signals/signals-runtime/build-signals-runtime-global.js b/packages/signals/signals-runtime/build-signals-runtime-global.js index a13c9db7c..480a5346c 100644 --- a/packages/signals/signals-runtime/build-signals-runtime-global.js +++ b/packages/signals/signals-runtime/build-signals-runtime-global.js @@ -2,6 +2,7 @@ const esbuild = require('esbuild') const path = require('path') const fs = require('fs') const fsPromises = fs.promises +const { execSync } = require('child_process') const getBanner = (entryPoint) => { const content = [ @@ -63,6 +64,14 @@ const buildRuntimeAsString = async (platform) => { console.log(`wrote: ${generatedTsFile}`) } +// while esbuild supports target: es5 natively, it chokes with errors like] +// ✘ [ERROR] Transforming const to the configured target environment ("es5") is not supported yet +const compileToEs5WithBabel = (outFile) => { + return execSync( + `npx babel ${outFile} --out-file ${outFile} --config-file ./babel.config.js` + ) +} + const buildRuntime = async (platform) => { const entryPoint = getEntryPoint(platform) const { outfileUnminified, outfileMinified } = getOutFiles(platform) @@ -85,6 +94,11 @@ const buildRuntime = async (platform) => { minify: false, banner: { js: getBanner(entryPoint) }, }) + + // Compile to ES5 + compileToEs5WithBabel(outfileUnminified) + compileToEs5WithBabel(outfileMinified) + console.log(`wrote: ${outfileUnminified}`) } diff --git a/packages/signals/signals-runtime/bundle-build-tests/runtime-env.test.ts b/packages/signals/signals-runtime/bundle-build-tests/runtime-env.test.ts index 3e72e5a8c..54bf789db 100644 --- a/packages/signals/signals-runtime/bundle-build-tests/runtime-env.test.ts +++ b/packages/signals/signals-runtime/bundle-build-tests/runtime-env.test.ts @@ -26,6 +26,8 @@ describe('Global Scope Test: Web', () => { expect(dom.window).toBeDefined() // @ts-ignore expect(typeof dom.window.signals).toBe('object') + expect(typeof dom.window.signals.find).toBe('function') + expect(typeof dom.window.signals.filter).toBe('function') }) test('should expose constants', () => { @@ -59,6 +61,8 @@ describe('Global Scope Test: Mobile', () => { expect(dom.window).toBeDefined() // @ts-ignore expect(typeof dom.window.signals).toBe('object') + expect(typeof dom.window.signals.find).toBe('function') + expect(typeof dom.window.signals.filter).toBe('function') }) test('should expose constants', () => { diff --git a/packages/signals/signals-runtime/package.json b/packages/signals/signals-runtime/package.json index 8f7f93f6b..9a136d29b 100644 --- a/packages/signals/signals-runtime/package.json +++ b/packages/signals/signals-runtime/package.json @@ -44,6 +44,9 @@ "url": "https://github.com/segmentio/analytics-next" }, "devDependencies": { + "@babel/cli": "^7.22.10", + "@babel/core": "^7.22.11", + "@babel/preset-env": "^7.22.10", "@internal/test-helpers": "workspace:^", "@microsoft/api-extractor": "^7.47.9" } diff --git a/packages/signals/signals-runtime/src/mobile/get-runtime-code.generated.ts b/packages/signals/signals-runtime/src/mobile/get-runtime-code.generated.ts index 35913d024..c70edf5cf 100644 --- a/packages/signals/signals-runtime/src/mobile/get-runtime-code.generated.ts +++ b/packages/signals/signals-runtime/src/mobile/get-runtime-code.generated.ts @@ -2,6 +2,125 @@ // GENERATED, DO NOT EDIT // Entry point: src/mobile/index.signals-runtime.ts export const getRuntimeCode = (): string => ` -"use strict";(()=>{var g=Object.defineProperty;var f=(r,n)=>{for(var e in n)g(r,e,{get:n[e],enumerable:!0})};var l={};f(l,{EventType:()=>d,LocalDataAction:()=>c,NavigationAction:()=>S,NetworkAction:()=>u,SignalType:()=>p});var p=Object.freeze({Interaction:"interaction",Navigation:"navigation",Network:"network",LocalData:"localData",Instrumentation:"instrumentation",UserDefined:"userDefined"}),d=Object.freeze({Track:"track",Page:"page",Screen:"screen",Identify:"identify",Group:"group",Alias:"alias"}),S=Object.freeze({Forward:"forward",Backward:"backward",Modal:"modal",Entering:"entering",Leaving:"leaving",Page:"page",Popup:"popup"}),u=Object.freeze({Request:"request",Response:"response"}),c=Object.freeze({Loaded:"loaded",Updated:"updated",Saved:"saved",Deleted:"deleted",Undefined:"undefined"});var a=class{constructor(n=[]){this.find=(n,e,i)=>this.filter(n,e,i)[0];this.filter=(n,e,i)=>{let o=s=>s.type===e;return this.signalBuffer.slice(this.signalBuffer.indexOf(n)+1).filter(o).filter(s=>i?i(s):()=>!0)};this.signalBuffer=n}};var t=class extends a{constructor(e=[]){super(e);this.add=e=>{this.signalCounter<0&&(this.signalCounter=0),"index"in e&&e.index==-1&&(e.index=this.getNextIndex()),this.signalBuffer.unshift(e),this.signalBuffer.length>this.maxBufferSize&&this.signalBuffer.pop()};this.getNextIndex=()=>{let e=this.signalCounter;return this.signalCounter+=1,e};this.signalCounter=0,this.maxBufferSize=1e3}};Object.assign(globalThis,{signals:new t},l);})(); +"use strict"; + +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +(function () { + var g = Object.defineProperty; + var f = function f(r, n) { + for (var e in n) g(r, e, { + get: n[e], + enumerable: !0 + }); + }; + var l = {}; + f(l, { + EventType: function EventType() { + return d; + }, + LocalDataAction: function LocalDataAction() { + return c; + }, + NavigationAction: function NavigationAction() { + return S; + }, + NetworkAction: function NetworkAction() { + return u; + }, + SignalType: function SignalType() { + return p; + } + }); + var p = Object.freeze({ + Interaction: "interaction", + Navigation: "navigation", + Network: "network", + LocalData: "localData", + Instrumentation: "instrumentation", + UserDefined: "userDefined" + }), + d = Object.freeze({ + Track: "track", + Page: "page", + Screen: "screen", + Identify: "identify", + Group: "group", + Alias: "alias" + }), + S = Object.freeze({ + Forward: "forward", + Backward: "backward", + Modal: "modal", + Entering: "entering", + Leaving: "leaving", + Page: "page", + Popup: "popup" + }), + u = Object.freeze({ + Request: "request", + Response: "response" + }), + c = Object.freeze({ + Loaded: "loaded", + Updated: "updated", + Saved: "saved", + Deleted: "deleted", + Undefined: "undefined" + }); + var a = /*#__PURE__*/_createClass(function a() { + var _this = this; + var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + _classCallCheck(this, a); + this.find = function (n, e, i) { + return _this.filter(n, e, i)[0]; + }; + this.filter = function (n, e, i) { + var o = function o(s) { + return s.type === e; + }; + return _this.signalBuffer.slice(_this.signalBuffer.indexOf(n) + 1).filter(o).filter(function (s) { + return i ? i(s) : function () { + return !0; + }; + }); + }; + this.signalBuffer = n; + }); + var t = /*#__PURE__*/function (_a) { + _inherits(t, _a); + var _super = _createSuper(t); + function t() { + var _this2; + var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + _classCallCheck(this, t); + _this2 = _super.call(this, e); + _this2.add = function (e) { + _this2.signalCounter < 0 && (_this2.signalCounter = 0), "index" in e && e.index == -1 && (e.index = _this2.getNextIndex()), _this2.signalBuffer.unshift(e), _this2.signalBuffer.length > _this2.maxBufferSize && _this2.signalBuffer.pop(); + }; + _this2.getNextIndex = function () { + var e = _this2.signalCounter; + return _this2.signalCounter += 1, e; + }; + _this2.signalCounter = 0, _this2.maxBufferSize = 1e3; + return _this2; + } + return _createClass(t); + }(a); + Object.assign(globalThis, { + signals: new t() + }, l); +})(); ` \ No newline at end of file diff --git a/packages/signals/signals-runtime/src/web/get-runtime-code.generated.ts b/packages/signals/signals-runtime/src/web/get-runtime-code.generated.ts index 5c9ba359e..4a570cea9 100644 --- a/packages/signals/signals-runtime/src/web/get-runtime-code.generated.ts +++ b/packages/signals/signals-runtime/src/web/get-runtime-code.generated.ts @@ -2,6 +2,92 @@ // GENERATED, DO NOT EDIT // Entry point: src/web/index.signals-runtime.ts export const getRuntimeCode = (): string => ` -"use strict";(()=>{var o=Object.defineProperty;var S=(l,e)=>{for(var n in e)o(l,n,{get:e[n],enumerable:!0})};var i=class{constructor(e=[]){this.find=(e,n,a)=>this.filter(e,n,a)[0];this.filter=(e,n,a)=>{let s=g=>g.type===n;return this.signalBuffer.slice(this.signalBuffer.indexOf(e)+1).filter(s).filter(g=>a?a(g):()=>!0)};this.signalBuffer=e}};var t=class extends i{};var r={};S(r,{EventType:()=>f,NavigationAction:()=>p,SignalType:()=>y});var f=Object.freeze({Track:"track",Page:"page",Screen:"screen",Identify:"identify",Group:"group",Alias:"alias"}),p=Object.freeze({URLChange:"urlChange",PageLoad:"pageLoad"}),y=Object.freeze({Interaction:"interaction",Navigation:"navigation",Network:"network",LocalData:"localData",Instrumentation:"instrumentation",UserDefined:"userDefined"});Object.assign(globalThis,{signals:new t},r);})(); +"use strict"; + +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +(function () { + var o = Object.defineProperty; + var S = function S(l, e) { + for (var n in e) o(l, n, { + get: e[n], + enumerable: !0 + }); + }; + var i = /*#__PURE__*/_createClass(function i() { + var _this = this; + var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + _classCallCheck(this, i); + this.find = function (e, n, a) { + return _this.filter(e, n, a)[0]; + }; + this.filter = function (e, n, a) { + var s = function s(g) { + return g.type === n; + }; + return _this.signalBuffer.slice(_this.signalBuffer.indexOf(e) + 1).filter(s).filter(function (g) { + return a ? a(g) : function () { + return !0; + }; + }); + }; + this.signalBuffer = e; + }); + var t = /*#__PURE__*/function (_i) { + _inherits(t, _i); + var _super = _createSuper(t); + function t() { + _classCallCheck(this, t); + return _super.apply(this, arguments); + } + return _createClass(t); + }(i); + var r = {}; + S(r, { + EventType: function EventType() { + return f; + }, + NavigationAction: function NavigationAction() { + return p; + }, + SignalType: function SignalType() { + return y; + } + }); + var f = Object.freeze({ + Track: "track", + Page: "page", + Screen: "screen", + Identify: "identify", + Group: "group", + Alias: "alias" + }), + p = Object.freeze({ + URLChange: "urlChange", + PageLoad: "pageLoad" + }), + y = Object.freeze({ + Interaction: "interaction", + Navigation: "navigation", + Network: "network", + LocalData: "localData", + Instrumentation: "instrumentation", + UserDefined: "userDefined" + }); + Object.assign(globalThis, { + signals: new t() + }, r); +})(); ` \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 1159d9015..7aa8d268e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6001,6 +6001,9 @@ __metadata: version: 0.0.0-use.local resolution: "@segment/analytics-signals-runtime@workspace:packages/signals/signals-runtime" dependencies: + "@babel/cli": ^7.22.10 + "@babel/core": ^7.22.11 + "@babel/preset-env": ^7.22.10 "@internal/test-helpers": "workspace:^" "@microsoft/api-extractor": ^7.47.9 tslib: ^2.4.1 From 34ce71fe36626a7cd866e07cd47817b24dd10e1f Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Mon, 10 Mar 2025 14:41:23 -0500 Subject: [PATCH 2/5] transpile to es5 --- .changeset/perfect-actors-tease.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/perfect-actors-tease.md diff --git a/.changeset/perfect-actors-tease.md b/.changeset/perfect-actors-tease.md new file mode 100644 index 000000000..4dfa1617f --- /dev/null +++ b/.changeset/perfect-actors-tease.md @@ -0,0 +1,5 @@ +--- +'@segment/analytics-signals-runtime': minor +--- + +Transpile to es5 From 271fd34f8767b2c6c0125204d19cf22b236fe271 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Mon, 10 Mar 2025 14:42:38 -0500 Subject: [PATCH 3/5] wip --- .../signals/signals-runtime/build-signals-runtime-global.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/signals/signals-runtime/build-signals-runtime-global.js b/packages/signals/signals-runtime/build-signals-runtime-global.js index 480a5346c..197c39df4 100644 --- a/packages/signals/signals-runtime/build-signals-runtime-global.js +++ b/packages/signals/signals-runtime/build-signals-runtime-global.js @@ -84,6 +84,7 @@ const buildRuntime = async (platform) => { minify: true, banner: { js: getBanner(entryPoint) }, }) + compileToEs5WithBabel(outfileMinified) console.log(`wrote: ${outfileMinified}`) // Build unminified version @@ -97,8 +98,6 @@ const buildRuntime = async (platform) => { // Compile to ES5 compileToEs5WithBabel(outfileUnminified) - compileToEs5WithBabel(outfileMinified) - console.log(`wrote: ${outfileUnminified}`) } From 12d73f502d8a248f0b26e4dfd8581bf0c63aa0a1 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Mon, 10 Mar 2025 14:44:21 -0500 Subject: [PATCH 4/5] wip --- .../signals/signals-runtime/build-signals-runtime-global.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/signals/signals-runtime/build-signals-runtime-global.js b/packages/signals/signals-runtime/build-signals-runtime-global.js index 197c39df4..c0de968dd 100644 --- a/packages/signals/signals-runtime/build-signals-runtime-global.js +++ b/packages/signals/signals-runtime/build-signals-runtime-global.js @@ -64,9 +64,9 @@ const buildRuntimeAsString = async (platform) => { console.log(`wrote: ${generatedTsFile}`) } -// while esbuild supports target: es5 natively, it chokes with errors like] -// ✘ [ERROR] Transforming const to the configured target environment ("es5") is not supported yet const compileToEs5WithBabel = (outFile) => { + // While esbuild supports target: es5 natively, we use babel because esbuild chokes with errors. e.g.: + // ✘ [ERROR] Transforming const to the configured target environment ("es5") is not supported yet return execSync( `npx babel ${outFile} --out-file ${outFile} --config-file ./babel.config.js` ) From 81d088659ae49383ce4637e068551dd356a6ce56 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Mon, 10 Mar 2025 15:05:51 -0500 Subject: [PATCH 5/5] wip --- .../build-signals-runtime-global.js | 36 ++- packages/signals/signals-runtime/package.json | 5 +- .../src/mobile/get-runtime-code.generated.ts | 121 +------- .../src/web/get-runtime-code.generated.ts | 88 +----- yarn.lock | 273 +++++++++++++++++- 5 files changed, 298 insertions(+), 225 deletions(-) diff --git a/packages/signals/signals-runtime/build-signals-runtime-global.js b/packages/signals/signals-runtime/build-signals-runtime-global.js index c0de968dd..64f8bd346 100644 --- a/packages/signals/signals-runtime/build-signals-runtime-global.js +++ b/packages/signals/signals-runtime/build-signals-runtime-global.js @@ -2,7 +2,7 @@ const esbuild = require('esbuild') const path = require('path') const fs = require('fs') const fsPromises = fs.promises -const { execSync } = require('child_process') +const babel = require('esbuild-plugin-babel-cjs') const getBanner = (entryPoint) => { const content = [ @@ -64,40 +64,44 @@ const buildRuntimeAsString = async (platform) => { console.log(`wrote: ${generatedTsFile}`) } -const compileToEs5WithBabel = (outFile) => { - // While esbuild supports target: es5 natively, we use babel because esbuild chokes with errors. e.g.: - // ✘ [ERROR] Transforming const to the configured target environment ("es5") is not supported yet - return execSync( - `npx babel ${outFile} --out-file ${outFile} --config-file ./babel.config.js` - ) -} - const buildRuntime = async (platform) => { const entryPoint = getEntryPoint(platform) const { outfileUnminified, outfileMinified } = getOutFiles(platform) - // Build minified version + // Transpile with Babel + const transpiledFile = `./dist/runtime/index.${platform}.transpiled.js` await esbuild.build({ entryPoints: [entryPoint], + outfile: transpiledFile, + bundle: true, + minify: false, + plugins: [ + babel({ + config: { + presets: ['@babel/preset-env', '@babel/preset-typescript'], + }, + }), + ], + }) + + // Bundle and minify with esbuild + await esbuild.build({ + entryPoints: [transpiledFile], outfile: outfileMinified, bundle: true, minify: true, banner: { js: getBanner(entryPoint) }, }) - compileToEs5WithBabel(outfileMinified) console.log(`wrote: ${outfileMinified}`) - // Build unminified version + // Bundle without minification await esbuild.build({ - entryPoints: [entryPoint], + entryPoints: [transpiledFile], outfile: outfileUnminified, bundle: true, minify: false, banner: { js: getBanner(entryPoint) }, }) - - // Compile to ES5 - compileToEs5WithBabel(outfileUnminified) console.log(`wrote: ${outfileUnminified}`) } diff --git a/packages/signals/signals-runtime/package.json b/packages/signals/signals-runtime/package.json index 9a136d29b..9baeeaaec 100644 --- a/packages/signals/signals-runtime/package.json +++ b/packages/signals/signals-runtime/package.json @@ -47,7 +47,10 @@ "@babel/cli": "^7.22.10", "@babel/core": "^7.22.11", "@babel/preset-env": "^7.22.10", + "@babel/preset-typescript": "^7.22.11", "@internal/test-helpers": "workspace:^", - "@microsoft/api-extractor": "^7.47.9" + "@microsoft/api-extractor": "^7.47.9", + "babel-preset-minify": "^0.5.2", + "esbuild-plugin-babel-cjs": "^1.0.0" } } diff --git a/packages/signals/signals-runtime/src/mobile/get-runtime-code.generated.ts b/packages/signals/signals-runtime/src/mobile/get-runtime-code.generated.ts index c70edf5cf..12e15b166 100644 --- a/packages/signals/signals-runtime/src/mobile/get-runtime-code.generated.ts +++ b/packages/signals/signals-runtime/src/mobile/get-runtime-code.generated.ts @@ -2,125 +2,6 @@ // GENERATED, DO NOT EDIT // Entry point: src/mobile/index.signals-runtime.ts export const getRuntimeCode = (): string => ` -"use strict"; - -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -(function () { - var g = Object.defineProperty; - var f = function f(r, n) { - for (var e in n) g(r, e, { - get: n[e], - enumerable: !0 - }); - }; - var l = {}; - f(l, { - EventType: function EventType() { - return d; - }, - LocalDataAction: function LocalDataAction() { - return c; - }, - NavigationAction: function NavigationAction() { - return S; - }, - NetworkAction: function NetworkAction() { - return u; - }, - SignalType: function SignalType() { - return p; - } - }); - var p = Object.freeze({ - Interaction: "interaction", - Navigation: "navigation", - Network: "network", - LocalData: "localData", - Instrumentation: "instrumentation", - UserDefined: "userDefined" - }), - d = Object.freeze({ - Track: "track", - Page: "page", - Screen: "screen", - Identify: "identify", - Group: "group", - Alias: "alias" - }), - S = Object.freeze({ - Forward: "forward", - Backward: "backward", - Modal: "modal", - Entering: "entering", - Leaving: "leaving", - Page: "page", - Popup: "popup" - }), - u = Object.freeze({ - Request: "request", - Response: "response" - }), - c = Object.freeze({ - Loaded: "loaded", - Updated: "updated", - Saved: "saved", - Deleted: "deleted", - Undefined: "undefined" - }); - var a = /*#__PURE__*/_createClass(function a() { - var _this = this; - var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - _classCallCheck(this, a); - this.find = function (n, e, i) { - return _this.filter(n, e, i)[0]; - }; - this.filter = function (n, e, i) { - var o = function o(s) { - return s.type === e; - }; - return _this.signalBuffer.slice(_this.signalBuffer.indexOf(n) + 1).filter(o).filter(function (s) { - return i ? i(s) : function () { - return !0; - }; - }); - }; - this.signalBuffer = n; - }); - var t = /*#__PURE__*/function (_a) { - _inherits(t, _a); - var _super = _createSuper(t); - function t() { - var _this2; - var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - _classCallCheck(this, t); - _this2 = _super.call(this, e); - _this2.add = function (e) { - _this2.signalCounter < 0 && (_this2.signalCounter = 0), "index" in e && e.index == -1 && (e.index = _this2.getNextIndex()), _this2.signalBuffer.unshift(e), _this2.signalBuffer.length > _this2.maxBufferSize && _this2.signalBuffer.pop(); - }; - _this2.getNextIndex = function () { - var e = _this2.signalCounter; - return _this2.signalCounter += 1, e; - }; - _this2.signalCounter = 0, _this2.maxBufferSize = 1e3; - return _this2; - } - return _createClass(t); - }(a); - Object.assign(globalThis, { - signals: new t() - }, l); -})(); +"use strict";(()=>{(()=>{var _=Object.defineProperty,h=(t,e)=>{for(var n in e)_(t,n,{get:e[n],enumerable:!0})},s={};h(s,{EventType:()=>S,LocalDataAction:()=>j,NavigationAction:()=>w,NetworkAction:()=>P,SignalType:()=>O});var O=Object.freeze({Interaction:"interaction",Navigation:"navigation",Network:"network",LocalData:"localData",Instrumentation:"instrumentation",UserDefined:"userDefined"}),S=Object.freeze({Track:"track",Page:"page",Screen:"screen",Identify:"identify",Group:"group",Alias:"alias"}),w=Object.freeze({Forward:"forward",Backward:"backward",Modal:"modal",Entering:"entering",Leaving:"leaving",Page:"page",Popup:"popup"}),P=Object.freeze({Request:"request",Response:"response"}),j=Object.freeze({Loaded:"loaded",Updated:"updated",Saved:"saved",Deleted:"deleted",Undefined:"undefined"});function a(t){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(t)}function y(t,e){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:[];R(this,t),b(this,"find",function(r,o,i){return e.filter(r,o,i)[0]}),b(this,"filter",function(r,o,i){var M=function(U){return U.type===o};return e.signalBuffer.slice(e.signalBuffer.indexOf(r)+1).filter(M).filter(function(d){return i?i(d):function(){return!0}})}),this.signalBuffer=n});function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(t)}function g(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},u(t)}function v(t,e,n){return e=m(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(t){var e=k(t,"string");return f(e)==="symbol"?e:String(e)}function k(t,e){if(f(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(f(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var L=function(t){z(n,t);var e=D(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return E(this,n),r=e.call(this,o),v(c(r),"add",function(i){r.signalCounter<0&&(r.signalCounter=0),"index"in i&&i.index==-1&&(i.index=r.getNextIndex()),r.signalBuffer.unshift(i),r.signalBuffer.length>r.maxBufferSize&&r.signalBuffer.pop()}),v(c(r),"getNextIndex",function(){var i=r.signalCounter;return r.signalCounter+=1,i}),r.signalCounter=0,r.maxBufferSize=1e3,r}return B(n)}(N);Object.assign(globalThis,{signals:new L},s)})();})(); ` \ No newline at end of file diff --git a/packages/signals/signals-runtime/src/web/get-runtime-code.generated.ts b/packages/signals/signals-runtime/src/web/get-runtime-code.generated.ts index 4a570cea9..70365f9a5 100644 --- a/packages/signals/signals-runtime/src/web/get-runtime-code.generated.ts +++ b/packages/signals/signals-runtime/src/web/get-runtime-code.generated.ts @@ -2,92 +2,6 @@ // GENERATED, DO NOT EDIT // Entry point: src/web/index.signals-runtime.ts export const getRuntimeCode = (): string => ` -"use strict"; - -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -(function () { - var o = Object.defineProperty; - var S = function S(l, e) { - for (var n in e) o(l, n, { - get: e[n], - enumerable: !0 - }); - }; - var i = /*#__PURE__*/_createClass(function i() { - var _this = this; - var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - _classCallCheck(this, i); - this.find = function (e, n, a) { - return _this.filter(e, n, a)[0]; - }; - this.filter = function (e, n, a) { - var s = function s(g) { - return g.type === n; - }; - return _this.signalBuffer.slice(_this.signalBuffer.indexOf(e) + 1).filter(s).filter(function (g) { - return a ? a(g) : function () { - return !0; - }; - }); - }; - this.signalBuffer = e; - }); - var t = /*#__PURE__*/function (_i) { - _inherits(t, _i); - var _super = _createSuper(t); - function t() { - _classCallCheck(this, t); - return _super.apply(this, arguments); - } - return _createClass(t); - }(i); - var r = {}; - S(r, { - EventType: function EventType() { - return f; - }, - NavigationAction: function NavigationAction() { - return p; - }, - SignalType: function SignalType() { - return y; - } - }); - var f = Object.freeze({ - Track: "track", - Page: "page", - Screen: "screen", - Identify: "identify", - Group: "group", - Alias: "alias" - }), - p = Object.freeze({ - URLChange: "urlChange", - PageLoad: "pageLoad" - }), - y = Object.freeze({ - Interaction: "interaction", - Navigation: "navigation", - Network: "network", - LocalData: "localData", - Instrumentation: "instrumentation", - UserDefined: "userDefined" - }); - Object.assign(globalThis, { - signals: new t() - }, r); -})(); +"use strict";(()=>{(()=>{var g=Object.defineProperty,m=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})};function a(t){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(t)}function c(t,e){for(var r=0;r0&&arguments[0]!==void 0?arguments[0]:[];h(this,t),y(this,"find",function(n,i,f){return e.filter(n,i,f)[0]}),y(this,"filter",function(n,i,f){var z=function(L){return L.type===i};return e.signalBuffer.slice(e.signalBuffer.indexOf(n)+1).filter(z).filter(function(v){return f?f(v):function(){return!0}})}),this.signalBuffer=r});function o(t){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(t)}function b(t,e){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},u(t)}var x=function(t){T(r,t);var e=R(r);function r(){return j(this,r),e.apply(this,arguments)}return P(r)}(S),p={};m(p,{EventType:()=>B,NavigationAction:()=>D,SignalType:()=>I});var B=Object.freeze({Track:"track",Page:"page",Screen:"screen",Identify:"identify",Group:"group",Alias:"alias"}),D=Object.freeze({URLChange:"urlChange",PageLoad:"pageLoad"}),I=Object.freeze({Interaction:"interaction",Navigation:"navigation",Network:"network",LocalData:"localData",Instrumentation:"instrumentation",UserDefined:"userDefined"});Object.assign(globalThis,{signals:new x},p)})();})(); ` \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 7aa8d268e..4b59b7507 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6004,8 +6004,11 @@ __metadata: "@babel/cli": ^7.22.10 "@babel/core": ^7.22.11 "@babel/preset-env": ^7.22.10 + "@babel/preset-typescript": ^7.22.11 "@internal/test-helpers": "workspace:^" "@microsoft/api-extractor": ^7.47.9 + babel-preset-minify: ^0.5.2 + esbuild-plugin-babel-cjs: ^1.0.0 tslib: ^2.4.1 languageName: unknown linkType: soft @@ -10380,6 +10383,55 @@ __metadata: languageName: node linkType: hard +"babel-helper-evaluate-path@npm:^0.5.0": + version: 0.5.0 + resolution: "babel-helper-evaluate-path@npm:0.5.0" + checksum: 4a3b301fd931e0cd3f9ec2a34b4c29a32d31acb6465d2b29793d2b27207bcd50e8e06dd9d95e4a91171d0da82c971404ed9e6aed586a3f2c4b09243cd531fb2a + languageName: node + linkType: hard + +"babel-helper-flip-expressions@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-helper-flip-expressions@npm:0.4.3" + checksum: 52174b03edfca1c722b115fae7046d3ddfd726d2e240cb018c6877b1b9baef7a07f9853ed33a37ee7eeebb5769b1748a0cffbd303f9b5a454e18420e0f0a859b + languageName: node + linkType: hard + +"babel-helper-is-nodes-equiv@npm:^0.0.1": + version: 0.0.1 + resolution: "babel-helper-is-nodes-equiv@npm:0.0.1" + checksum: 8621bf12fe5e8238c2de125be278e57f02233fa0e0cf59e0f6b8218b9699eac7a3f71087c8fac5981a80d0941382b34794c642cbbffe363286ac49601b4584ef + languageName: node + linkType: hard + +"babel-helper-is-void-0@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-helper-is-void-0@npm:0.4.3" + checksum: 0aa68c822c21b3688161d9748b83cc25062a1d4ea39c342c17c7f59d33993de476338d01a3b6218d99f725287be03638d3119d5fe774319eb87054e04e06cf43 + languageName: node + linkType: hard + +"babel-helper-mark-eval-scopes@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-helper-mark-eval-scopes@npm:0.4.3" + checksum: 3cf6a1b5ab4e519242abf0031b96bd86ef2ad614a2b296231b6b4480f6f998b84ba99a629426b5c6b00e598c10b8ba2af6d2e9d1c7c3c94ed4a2bc9082f71c33 + languageName: node + linkType: hard + +"babel-helper-remove-or-void@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-helper-remove-or-void@npm:0.4.3" + checksum: 6a2c305c31cb0974a2fd6c860a6685612b4a7ad2cd6b056807f183d9ef5c86f669c002f454fe6729bfd594e5f7349b1f7f06b2107acd7e353e1ccfb2e4d8f32e + languageName: node + linkType: hard + +"babel-helper-to-multiple-sequence-expressions@npm:^0.5.0": + version: 0.5.0 + resolution: "babel-helper-to-multiple-sequence-expressions@npm:0.5.0" + checksum: f8f07139eefc87b3e3f7733250b638cb61e03567060bded12934f48800ec07e86a304815e49a4b83610b549234aeb9db9ff1dc71a7bde1442d37e9ebed658ba0 + languageName: node + linkType: hard + "babel-jest@npm:^29.7.0": version: 29.7.0 resolution: "babel-jest@npm:29.7.0" @@ -10437,6 +10489,104 @@ __metadata: languageName: node linkType: hard +"babel-plugin-minify-builtins@npm:^0.5.0": + version: 0.5.0 + resolution: "babel-plugin-minify-builtins@npm:0.5.0" + checksum: 55fa4b2e77bb5d8e5008e4ab8a5435d5edd64796388840fdff28cb9d67aa4c4a5a075a9b9253672b8d1e683fd3a58cf7085e6151eea05d5737a7ab364053b68c + languageName: node + linkType: hard + +"babel-plugin-minify-constant-folding@npm:^0.5.0": + version: 0.5.0 + resolution: "babel-plugin-minify-constant-folding@npm:0.5.0" + dependencies: + babel-helper-evaluate-path: ^0.5.0 + checksum: 9421a07cf29213852c6f284f16cc9159acfe06df747addc42e3b2dec624bd70bd0af2f18c180e7bdeba40cc63910b99297fb8ecc59da56059847ab5d073dfcb2 + languageName: node + linkType: hard + +"babel-plugin-minify-dead-code-elimination@npm:^0.5.2": + version: 0.5.2 + resolution: "babel-plugin-minify-dead-code-elimination@npm:0.5.2" + dependencies: + babel-helper-evaluate-path: ^0.5.0 + babel-helper-mark-eval-scopes: ^0.4.3 + babel-helper-remove-or-void: ^0.4.3 + lodash: ^4.17.11 + checksum: ed4c683aa9dac021f08bf46a9a8dae28428e32e0beb0cb0e1923e195490019c5169c42e8211ecc9e23c9e2ce6ac54a809af7b9f9d8cece57eebb51b07b9f2e64 + languageName: node + linkType: hard + +"babel-plugin-minify-flip-comparisons@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-plugin-minify-flip-comparisons@npm:0.4.3" + dependencies: + babel-helper-is-void-0: ^0.4.3 + checksum: 54e068f926083d6ae539a13d096a9fa564339717ee607f9b3bded360344d377fa6dd47ada377ac445f98462d03d78cdf772efcaa366c692888f325c6382ab6a6 + languageName: node + linkType: hard + +"babel-plugin-minify-guarded-expressions@npm:^0.4.4": + version: 0.4.4 + resolution: "babel-plugin-minify-guarded-expressions@npm:0.4.4" + dependencies: + babel-helper-evaluate-path: ^0.5.0 + babel-helper-flip-expressions: ^0.4.3 + checksum: 6071558a5bdc64ed811809d66ad9982ea3ead16ac32f09d4f17e41b07b2106d9b0d12641758f89cfa1dff94fdfb3df8afed908ff1c0e50972b0312cc66d09a75 + languageName: node + linkType: hard + +"babel-plugin-minify-infinity@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-plugin-minify-infinity@npm:0.4.3" + checksum: d63d83390286949043adf43016150a46d8d7b4d500cdd684a24322d2ec9153127af0c2df36debe3096e12eff3712d4974935585953d0337a09966f0ec5c81f84 + languageName: node + linkType: hard + +"babel-plugin-minify-mangle-names@npm:^0.5.1": + version: 0.5.1 + resolution: "babel-plugin-minify-mangle-names@npm:0.5.1" + dependencies: + babel-helper-mark-eval-scopes: ^0.4.3 + checksum: fd4dcf6d20b68130063c2e44ebf7c5fa4e912be6bfc8d9036697ac087a348ce2c289aab8d04a3905228e40a3c966300dc0c8e58cc53a16d97553637d820f0669 + languageName: node + linkType: hard + +"babel-plugin-minify-numeric-literals@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-plugin-minify-numeric-literals@npm:0.4.3" + checksum: 8327b43e06ead88c13558ecaa5faf32bbca0e3f726fce93b59bac92d423291abbe6912419ba4b9f669253318cdf04381c5d6d6eabacaafd51a69c9242975dc5b + languageName: node + linkType: hard + +"babel-plugin-minify-replace@npm:^0.5.0": + version: 0.5.0 + resolution: "babel-plugin-minify-replace@npm:0.5.0" + checksum: eca0ef9c9197b55b7c6467fb097fe3f266ca64293eda0c1254303897923df11e9f5a9c25888de98da6a4fc32debe2651d50bdcebb667553013be4875543480f6 + languageName: node + linkType: hard + +"babel-plugin-minify-simplify@npm:^0.5.1": + version: 0.5.1 + resolution: "babel-plugin-minify-simplify@npm:0.5.1" + dependencies: + babel-helper-evaluate-path: ^0.5.0 + babel-helper-flip-expressions: ^0.4.3 + babel-helper-is-nodes-equiv: ^0.0.1 + babel-helper-to-multiple-sequence-expressions: ^0.5.0 + checksum: 79d718001337fc93f7b6002f2940dbbe35b0704b75e2c0c408eae88ac81400af7a2a79e3c7fcbfb781fd00466a45fd1fff94040cad811002992930e9e26cc1fa + languageName: node + linkType: hard + +"babel-plugin-minify-type-constructors@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-plugin-minify-type-constructors@npm:0.4.3" + dependencies: + babel-helper-is-void-0: ^0.4.3 + checksum: 2c6cb97aa8a20c990fc17afd1141e586a1920419bc8a93d2231e7f5f6dcdfbc060c1839873c192c7828040f95ff74b65b8b0af6eb5c54b795e86cf62152ba41e + languageName: node + linkType: hard + "babel-plugin-polyfill-corejs2@npm:^0.4.5": version: 0.4.5 resolution: "babel-plugin-polyfill-corejs2@npm:0.4.5" @@ -10473,6 +10623,87 @@ __metadata: languageName: node linkType: hard +"babel-plugin-transform-inline-consecutive-adds@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-plugin-transform-inline-consecutive-adds@npm:0.4.3" + checksum: e3129bafc9c0ac8b0f3f823db3121d66d03c882fe78c1a0ab0ba5da45889759b7f9176a1b243c0eda12e27353bfd27934ef56e6a3f65861894b78dce96e3df35 + languageName: node + linkType: hard + +"babel-plugin-transform-member-expression-literals@npm:^6.9.4": + version: 6.9.4 + resolution: "babel-plugin-transform-member-expression-literals@npm:6.9.4" + checksum: 0008ca6f50dbeb7642422ed2c8024a05adc3cb9cad89993e7e1f1fa9bf085574bd874e853857fe441aff4b52ff2c1d7ea273c89da0ca6711a43de317ecf35cfb + languageName: node + linkType: hard + +"babel-plugin-transform-merge-sibling-variables@npm:^6.9.5": + version: 6.9.5 + resolution: "babel-plugin-transform-merge-sibling-variables@npm:6.9.5" + checksum: 6182f79703170b473fe4872cfe0df144057d94632be9972076265d3aae05e37aab3fb98ed932ce6d663c722d9aabb48ee2046b2f820ccc73dc45260173ba36e2 + languageName: node + linkType: hard + +"babel-plugin-transform-minify-booleans@npm:^6.9.4": + version: 6.9.4 + resolution: "babel-plugin-transform-minify-booleans@npm:6.9.4" + checksum: d8553742aa5ddfbcbc9c34c05bf4dce1148026b6aa860b3f1d0f7c8820f8d88e21dca148387c1ddf1e94b5fa7d7f39476bc8c07f082639aee2b841d8df5afc4c + languageName: node + linkType: hard + +"babel-plugin-transform-property-literals@npm:^6.9.4": + version: 6.9.4 + resolution: "babel-plugin-transform-property-literals@npm:6.9.4" + dependencies: + esutils: ^2.0.2 + checksum: 14da12703c8b49841594670688c50dc2f7b2be88b5681c70311f5f88b27a50782747a04e9fe1b232b7d2c2a9f223228c61fe6fe41ae0c4eb8208e3a890b2a19d + languageName: node + linkType: hard + +"babel-plugin-transform-regexp-constructors@npm:^0.4.3": + version: 0.4.3 + resolution: "babel-plugin-transform-regexp-constructors@npm:0.4.3" + checksum: 242228775b2c9e7d147a3bc3f8e0ce5d903f3baf7b238edc6c4fe4d95d05f84cc4722f37598cae437c26ffc24d63262550abb79d28eefe3c34d98b36be6d4f17 + languageName: node + linkType: hard + +"babel-plugin-transform-remove-console@npm:^6.9.4": + version: 6.9.4 + resolution: "babel-plugin-transform-remove-console@npm:6.9.4" + checksum: 1123c3816c6f89c064752199c8796f30265d937f5d8e1e43d3837f1c0e87ed0e6bbd0afa6117ce021c8b93ec1de7154e158674bb22331c7ed6609d10121359df + languageName: node + linkType: hard + +"babel-plugin-transform-remove-debugger@npm:^6.9.4": + version: 6.9.4 + resolution: "babel-plugin-transform-remove-debugger@npm:6.9.4" + checksum: ed34e5200dcd6e3f954debb3547baa58c8e422e084984a7d66cac4789bee158424c2d4ab21e0bac25e6818316d9c8ca758a976cf20ac333073146089eae6d49c + languageName: node + linkType: hard + +"babel-plugin-transform-remove-undefined@npm:^0.5.0": + version: 0.5.0 + resolution: "babel-plugin-transform-remove-undefined@npm:0.5.0" + dependencies: + babel-helper-evaluate-path: ^0.5.0 + checksum: cebba3eae74decba944af78bdbd1e806461bed8a3d500c4bc26dc563d5f1af087d5347f9ac1a3f28cc0ed9186a4095ced0f0099d5ec7aa6cf7ef2119436cafe4 + languageName: node + linkType: hard + +"babel-plugin-transform-simplify-comparison-operators@npm:^6.9.4": + version: 6.9.4 + resolution: "babel-plugin-transform-simplify-comparison-operators@npm:6.9.4" + checksum: 0b51e361d4c8c7a5b8813a4d652232c3185c3a17c0f0529676f706da876be1432a5bfc3a418fb801e266db67f12f2b92d4bef93a1c5f4582a3cb4edd2de457c2 + languageName: node + linkType: hard + +"babel-plugin-transform-undefined-to-void@npm:^6.9.4": + version: 6.9.4 + resolution: "babel-plugin-transform-undefined-to-void@npm:6.9.4" + checksum: dd4d89b3e884ed0a35c0a0690fdfa4cf9d5a1678b796a20bc05467f68fc5e186c5f77bc127870811337deb989afed6f6775fb8eab94646fcc7ed1a454c455a95 + languageName: node + linkType: hard + "babel-preset-current-node-syntax@npm:^1.0.0": version: 1.0.1 resolution: "babel-preset-current-node-syntax@npm:1.0.1" @@ -10507,6 +10738,37 @@ __metadata: languageName: node linkType: hard +"babel-preset-minify@npm:^0.5.2": + version: 0.5.2 + resolution: "babel-preset-minify@npm:0.5.2" + dependencies: + babel-plugin-minify-builtins: ^0.5.0 + babel-plugin-minify-constant-folding: ^0.5.0 + babel-plugin-minify-dead-code-elimination: ^0.5.2 + babel-plugin-minify-flip-comparisons: ^0.4.3 + babel-plugin-minify-guarded-expressions: ^0.4.4 + babel-plugin-minify-infinity: ^0.4.3 + babel-plugin-minify-mangle-names: ^0.5.1 + babel-plugin-minify-numeric-literals: ^0.4.3 + babel-plugin-minify-replace: ^0.5.0 + babel-plugin-minify-simplify: ^0.5.1 + babel-plugin-minify-type-constructors: ^0.4.3 + babel-plugin-transform-inline-consecutive-adds: ^0.4.3 + babel-plugin-transform-member-expression-literals: ^6.9.4 + babel-plugin-transform-merge-sibling-variables: ^6.9.5 + babel-plugin-transform-minify-booleans: ^6.9.4 + babel-plugin-transform-property-literals: ^6.9.4 + babel-plugin-transform-regexp-constructors: ^0.4.3 + babel-plugin-transform-remove-console: ^6.9.4 + babel-plugin-transform-remove-debugger: ^6.9.4 + babel-plugin-transform-remove-undefined: ^0.5.0 + babel-plugin-transform-simplify-comparison-operators: ^6.9.4 + babel-plugin-transform-undefined-to-void: ^6.9.4 + lodash: ^4.17.11 + checksum: 36484ad5d4cf89948240ad99ee3eb8bc54c85aed9c5d47b188924dfea058157a7e66a6980624f34c8ec45fc2906161f7ae0cbd3017f983a71689b29f79bebc90 + languageName: node + linkType: hard + "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -13422,6 +13684,15 @@ __metadata: languageName: node linkType: hard +"esbuild-plugin-babel-cjs@npm:^1.0.0": + version: 1.0.0 + resolution: "esbuild-plugin-babel-cjs@npm:1.0.0" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: d2a766a93fcb488868bdc30f2247c02c70d40cdd7785e7195f19235e2a3aeb569f6c574ca1629f585500584057e66bbf43b7c6a216f354667cec6633c668477f + languageName: node + linkType: hard + "esbuild-sunos-64@npm:0.14.54": version: 0.14.54 resolution: "esbuild-sunos-64@npm:0.14.54" @@ -18387,7 +18658,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:~4.17.15": +"lodash@npm:^4.17.11, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:~4.17.15": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7