@luma.gl/webgl 9.0.10 → 9.0.12

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.
@@ -143,6 +143,9 @@ ${device.info.vendor}, ${device.info.renderer} for canvas: ${device.canvasContex
143
143
  this.gl = gl;
144
144
  this.gl.device = this; // Update GL context: Link webgl context back to device
145
145
  this.gl._version = 2; // Update GL context: Store WebGL version field on gl context (HACK to identify debug contexts)
146
+ if (props.spector) {
147
+ this.spectorJS = initializeSpectorJS({ ...this.props, canvas: this.handle.canvas });
148
+ }
146
149
  // luma Device fields
147
150
  this.info = getDeviceInfo(this.gl, this._extensions);
148
151
  this.limits = new WebGLDeviceLimits(this.gl);
@@ -166,9 +169,6 @@ ${device.info.vendor}, ${device.info.renderer} for canvas: ${device.canvasContex
166
169
  log.level = Math.max(log.level, 1);
167
170
  log.warn('WebGL debug mode activated. Performance reduced.')();
168
171
  }
169
- if (props.spector) {
170
- this.spectorJS = initializeSpectorJS({ ...this.props, canvas: this.handle.canvas });
171
- }
172
172
  }
173
173
  /**
174
174
  * Destroys the context
@@ -3,10 +3,10 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
  import { log, loadScript } from '@luma.gl/core';
5
5
  const DEFAULT_SPECTOR_PROPS = {
6
- spector: log.get('spector') || log.get('inspect')
6
+ spector: log.get('spector') || log.get('spectorjs')
7
7
  };
8
8
  // https://github.com/BabylonJS/Spector.js#basic-usage
9
- const SPECTOR_CDN_URL = 'https://spectorcdn.babylonjs.com/spector.bundle.js';
9
+ const SPECTOR_CDN_URL = 'https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js';
10
10
  const LOG_LEVEL = 1;
11
11
  let spector = null;
12
12
  let initialized = false;
package/dist/dist.dev.js CHANGED
@@ -3656,9 +3656,9 @@ var __exports__ = (() => {
3656
3656
  // src/context/debug/spector.ts
3657
3657
  var import_core12 = __toESM(require_core(), 1);
3658
3658
  var DEFAULT_SPECTOR_PROPS = {
3659
- spector: import_core12.log.get("spector") || import_core12.log.get("inspect")
3659
+ spector: import_core12.log.get("spector") || import_core12.log.get("spectorjs")
3660
3660
  };
3661
- var SPECTOR_CDN_URL = "https://spectorcdn.babylonjs.com/spector.bundle.js";
3661
+ var SPECTOR_CDN_URL = "https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js";
3662
3662
  var LOG_LEVEL = 1;
3663
3663
  var spector = null;
3664
3664
  var initialized = false;
@@ -3715,38 +3715,35 @@ var __exports__ = (() => {
3715
3715
  // src/context/debug/webgl-developer-tools.ts
3716
3716
  var import_core13 = __toESM(require_core(), 1);
3717
3717
 
3718
+ // ../../node_modules/@probe.gl/env/dist/lib/globals.js
3719
+ var document_ = globalThis.document || {};
3720
+ var process_ = globalThis.process || {};
3721
+ var console_ = globalThis.console;
3722
+ var navigator_ = globalThis.navigator || {};
3723
+
3718
3724
  // ../../node_modules/@probe.gl/env/dist/lib/is-electron.js
3719
3725
  function isElectron(mockUserAgent) {
3720
- if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
3726
+ if (typeof window !== "undefined" && window.process?.type === "renderer") {
3721
3727
  return true;
3722
3728
  }
3723
- if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
3729
+ if (typeof process !== "undefined" && Boolean(process.versions?.["electron"])) {
3724
3730
  return true;
3725
3731
  }
3726
- const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
3732
+ const realUserAgent = typeof navigator !== "undefined" && navigator.userAgent;
3727
3733
  const userAgent = mockUserAgent || realUserAgent;
3728
- if (userAgent && userAgent.indexOf("Electron") >= 0) {
3729
- return true;
3730
- }
3731
- return false;
3734
+ return Boolean(userAgent && userAgent.indexOf("Electron") >= 0);
3732
3735
  }
3733
3736
 
3734
3737
  // ../../node_modules/@probe.gl/env/dist/lib/is-browser.js
3735
3738
  function isBrowser() {
3736
- const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
3739
+ const isNode = (
3740
+ // @ts-expect-error
3741
+ typeof process === "object" && String(process) === "[object process]" && !process?.browser
3742
+ );
3737
3743
  return !isNode || isElectron();
3738
3744
  }
3739
3745
 
3740
- // ../../node_modules/@probe.gl/env/dist/lib/globals.js
3741
- var self_ = globalThis.self || globalThis.window || globalThis.global;
3742
- var window_ = globalThis.window || globalThis.self || globalThis.global;
3743
- var document_ = globalThis.document || {};
3744
- var process_ = globalThis.process || {};
3745
- var console_ = globalThis.console;
3746
- var navigator_ = globalThis.navigator || {};
3747
-
3748
3746
  // ../../node_modules/@probe.gl/env/dist/lib/get-browser.js
3749
- var window2 = globalThis;
3750
3747
  function getBrowser(mockUserAgent) {
3751
3748
  if (!mockUserAgent && !isBrowser()) {
3752
3749
  return "Node";
@@ -3758,18 +3755,13 @@ var __exports__ = (() => {
3758
3755
  if (userAgent.indexOf("Edge") > -1) {
3759
3756
  return "Edge";
3760
3757
  }
3761
- const isMSIE = userAgent.indexOf("MSIE ") !== -1;
3762
- const isTrident = userAgent.indexOf("Trident/") !== -1;
3763
- if (isMSIE || isTrident) {
3764
- return "IE";
3765
- }
3766
- if (window2.chrome) {
3758
+ if (globalThis.chrome) {
3767
3759
  return "Chrome";
3768
3760
  }
3769
- if (window2.safari) {
3761
+ if (globalThis.safari) {
3770
3762
  return "Safari";
3771
3763
  }
3772
- if (window2.mozInnerScreenX) {
3764
+ if (globalThis.mozInnerScreenX) {
3773
3765
  return "Firefox";
3774
3766
  }
3775
3767
  return "Unknown";
@@ -6117,6 +6109,9 @@ ${source2}`;
6117
6109
  this.gl = gl;
6118
6110
  this.gl.device = this;
6119
6111
  this.gl._version = 2;
6112
+ if (props.spector) {
6113
+ this.spectorJS = initializeSpectorJS({ ...this.props, canvas: this.handle.canvas });
6114
+ }
6120
6115
  this.info = getDeviceInfo(this.gl, this._extensions);
6121
6116
  this.limits = new WebGLDeviceLimits(this.gl);
6122
6117
  this.features = new WebGLDeviceFeatures(this.gl, this._extensions, this.props.disabledFeatures);
@@ -6136,9 +6131,6 @@ ${source2}`;
6136
6131
  import_core27.log.level = Math.max(import_core27.log.level, 1);
6137
6132
  import_core27.log.warn("WebGL debug mode activated. Performance reduced.")();
6138
6133
  }
6139
- if (props.spector) {
6140
- this.spectorJS = initializeSpectorJS({ ...this.props, canvas: this.handle.canvas });
6141
- }
6142
6134
  }
6143
6135
  /**
6144
6136
  * Destroys the context