@dcl/ecs 7.19.0 → 7.19.1-21526551025.commit-799f37f

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.
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Internal utilities for standardized globalThis access.
3
+ */
4
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Internal utilities for standardized globalThis access.
3
+ */
4
+ /**
5
+ * Type-safe globalThis property access.
6
+ * @internal
7
+ */
8
+ export function getGlobal(key) {
9
+ return globalThis[key];
10
+ }
11
+ /**
12
+ * Sets a globalThis property as a polyfill (only if undefined/null).
13
+ * @internal
14
+ */
15
+ export function setGlobalPolyfill(key, value) {
16
+ ;
17
+ globalThis[key] = globalThis[key] ?? value;
18
+ }
@@ -12,6 +12,7 @@ import { createTweenSystem } from '../../systems/tween';
12
12
  import { pointerEventColliderChecker } from '../../systems/pointer-event-collider-checker';
13
13
  import { createTriggerAreaEventsSystem } from '../../systems/triggerArea';
14
14
  import { createTimers } from '../helpers/timers';
15
+ import { setGlobalPolyfill } from '../globals';
15
16
  /**
16
17
  * @public
17
18
  * The engine is the part of the scene that sits in the middle and manages all of the other parts.
@@ -65,10 +66,10 @@ export const triggerAreaEventsSystem = /* @__PURE__ */ createTriggerAreaEventsSy
65
66
  */
66
67
  export const timers = /* @__PURE__ */ createTimers(engine);
67
68
  export { createTimers };
68
- globalThis.setTimeout = globalThis.setTimeout ?? timers.setTimeout;
69
- globalThis.clearTimeout = globalThis.clearTimeout ?? timers.clearTimeout;
70
- globalThis.setInterval = globalThis.setInterval ?? timers.setInterval;
71
- globalThis.clearInterval = globalThis.clearInterval ?? timers.clearInterval;
69
+ setGlobalPolyfill('setTimeout', timers.setTimeout);
70
+ setGlobalPolyfill('clearTimeout', timers.clearTimeout);
71
+ setGlobalPolyfill('setInterval', timers.setInterval);
72
+ setGlobalPolyfill('clearInterval', timers.clearInterval);
72
73
  /**
73
74
  * Adds pointer event collider system only in DEV env
74
75
  */
@@ -1,6 +1,7 @@
1
1
  import * as components from '../components';
2
2
  import { ReadWriteByteBuffer } from '../serialization/ByteBuffer';
3
3
  import { dataCompare } from './crdt/utils';
4
+ import { getGlobal } from '../runtime/globals';
4
5
  /**
5
6
  * Avoid creating multiple tween systems
6
7
  */
@@ -147,7 +148,7 @@ export function createTweenSystem(engine) {
147
148
  }, Number.NEGATIVE_INFINITY);
148
149
  }
149
150
  // Some Explorers may not inject the flag and TweenSequence logic must be enabled in that case
150
- const enableTweenSequenceLogic = globalThis.ENABLE_SDK_TWEEN_SEQUENCE;
151
+ const enableTweenSequenceLogic = getGlobal('ENABLE_SDK_TWEEN_SEQUENCE');
151
152
  if (enableTweenSequenceLogic !== false)
152
153
  initializeTweenSequenceSystem();
153
154
  const tweenSystem = {
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Internal utilities for standardized globalThis access.
3
+ */
4
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /**
3
+ * Internal utilities for standardized globalThis access.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.setGlobalPolyfill = exports.getGlobal = void 0;
7
+ /**
8
+ * Type-safe globalThis property access.
9
+ * @internal
10
+ */
11
+ function getGlobal(key) {
12
+ return globalThis[key];
13
+ }
14
+ exports.getGlobal = getGlobal;
15
+ /**
16
+ * Sets a globalThis property as a polyfill (only if undefined/null).
17
+ * @internal
18
+ */
19
+ function setGlobalPolyfill(key, value) {
20
+ ;
21
+ globalThis[key] = globalThis[key] ?? value;
22
+ }
23
+ exports.setGlobalPolyfill = setGlobalPolyfill;
@@ -16,6 +16,7 @@ const pointer_event_collider_checker_1 = require("../../systems/pointer-event-co
16
16
  const triggerArea_1 = require("../../systems/triggerArea");
17
17
  const timers_1 = require("../helpers/timers");
18
18
  Object.defineProperty(exports, "createTimers", { enumerable: true, get: function () { return timers_1.createTimers; } });
19
+ const globals_1 = require("../globals");
19
20
  /**
20
21
  * @public
21
22
  * The engine is the part of the scene that sits in the middle and manages all of the other parts.
@@ -68,10 +69,10 @@ exports.triggerAreaEventsSystem = (0, triggerArea_1.createTriggerAreaEventsSyste
68
69
  * Timer utilities for delayed and repeated execution.
69
70
  */
70
71
  exports.timers = (0, timers_1.createTimers)(exports.engine);
71
- globalThis.setTimeout = globalThis.setTimeout ?? exports.timers.setTimeout;
72
- globalThis.clearTimeout = globalThis.clearTimeout ?? exports.timers.clearTimeout;
73
- globalThis.setInterval = globalThis.setInterval ?? exports.timers.setInterval;
74
- globalThis.clearInterval = globalThis.clearInterval ?? exports.timers.clearInterval;
72
+ (0, globals_1.setGlobalPolyfill)('setTimeout', exports.timers.setTimeout);
73
+ (0, globals_1.setGlobalPolyfill)('clearTimeout', exports.timers.clearTimeout);
74
+ (0, globals_1.setGlobalPolyfill)('setInterval', exports.timers.setInterval);
75
+ (0, globals_1.setGlobalPolyfill)('clearInterval', exports.timers.clearInterval);
75
76
  /**
76
77
  * Adds pointer event collider system only in DEV env
77
78
  */
@@ -27,6 +27,7 @@ exports.createTweenSystem = void 0;
27
27
  const components = __importStar(require("../components"));
28
28
  const ByteBuffer_1 = require("../serialization/ByteBuffer");
29
29
  const utils_1 = require("./crdt/utils");
30
+ const globals_1 = require("../runtime/globals");
30
31
  /**
31
32
  * Avoid creating multiple tween systems
32
33
  */
@@ -173,7 +174,7 @@ function createTweenSystem(engine) {
173
174
  }, Number.NEGATIVE_INFINITY);
174
175
  }
175
176
  // Some Explorers may not inject the flag and TweenSequence logic must be enabled in that case
176
- const enableTweenSequenceLogic = globalThis.ENABLE_SDK_TWEEN_SEQUENCE;
177
+ const enableTweenSequenceLogic = (0, globals_1.getGlobal)('ENABLE_SDK_TWEEN_SEQUENCE');
177
178
  if (enableTweenSequenceLogic !== false)
178
179
  initializeTweenSequenceSystem();
179
180
  const tweenSystem = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcl/ecs",
3
3
  "description": "Decentraland ECS",
4
- "version": "7.19.0",
4
+ "version": "7.19.1-21526551025.commit-799f37f",
5
5
  "author": "DCL",
6
6
  "bugs": "https://github.com/decentraland/ecs/issues",
7
7
  "files": [
@@ -33,5 +33,5 @@
33
33
  },
34
34
  "types": "./dist/index.d.ts",
35
35
  "typings": "./dist/index.d.ts",
36
- "commit": "7ae2e3848e600c323d6828ece5bcecd5fd9f3911"
36
+ "commit": "799f37fef283fc9b91e563551a28262bffd97dbc"
37
37
  }