diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fad94ca51..1ffa5f55cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1095,7 +1095,7 @@ - Ocular based website: initial directory (#564) - Adopt new underscore convention for experimental exports (#563) - Make polyfills for webgl1 optional (Dist Size Reduction) (#554) -- Update code to import GL from luma.gl/constants (#556) +- Update code to import {GL} from luma.gl/constants (#556) - Code cleanup (#559) - Doc Improvements (#558) diff --git a/dev-modules/babel-plugin-inline-webgl-constants/README.md b/dev-modules/babel-plugin-inline-webgl-constants/README.md index 8c406df4bd..7a2f2c70c4 100644 --- a/dev-modules/babel-plugin-inline-webgl-constants/README.md +++ b/dev-modules/babel-plugin-inline-webgl-constants/README.md @@ -21,7 +21,7 @@ const max = 34921; #### in ```typescript -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; ... const max = GL.MAX_VERTEX_ATTRIBS; ``` diff --git a/dev-modules/babel-plugin-inline-webgl-constants/index.js b/dev-modules/babel-plugin-inline-webgl-constants/index.js index 1c877c0ff8..7028ce8426 100644 --- a/dev-modules/babel-plugin-inline-webgl-constants/index.js +++ b/dev-modules/babel-plugin-inline-webgl-constants/index.js @@ -1,5 +1,5 @@ /* eslint-disable no-console, import/no-unresolved */ -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; const COLOR_RESET = '\x1b[0m'; const COLOR_YELLOW = '\x1b[33m'; diff --git a/docs/api-reference-v8/constants/README.md b/docs/api-reference-v8/constants/README.md index ded8ab7028..64c695deee 100644 --- a/docs/api-reference-v8/constants/README.md +++ b/docs/api-reference-v8/constants/README.md @@ -10,7 +10,7 @@ a (big) enum `GL` that contains all WebGL constants (i.e. the OpenGL API constan ## Usage ```typescript -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; const type = GL.POINTS; ``` diff --git a/docs/api-reference-v8/webgl-legacy/context/context-properties.md b/docs/api-reference-v8/webgl-legacy/context/context-properties.md index 1cb0f11cab..c7f59c562b 100644 --- a/docs/api-reference-v8/webgl-legacy/context/context-properties.md +++ b/docs/api-reference-v8/webgl-legacy/context/context-properties.md @@ -15,7 +15,7 @@ luma.gl provides several helper functions for testing properties of a WebGL cont ```` Check a certain limit (whether through an extension under WebGL 1 or through WebGL 2) ```typescript -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getContextLimits} from '@luma.gl/gltools'; const limits = getContextLimits(gl); if (limits[GL.MAX_COLOR_ATTACHMENTS] > 0) { // it will be 0 for WebGL 1 diff --git a/docs/api-reference/api/device-limits.mdx b/docs/api-reference/api/device-limits.mdx index 5c35c37aec..87bbfb1ffc 100644 --- a/docs/api-reference/api/device-limits.mdx +++ b/docs/api-reference/api/device-limits.mdx @@ -69,7 +69,7 @@ the luma.gl Device APIs. You can access "raw" WebGL extensions and limits direct A luma.gl `WebGLDevice` extracts an object that contains all "raw" WebGL limits. ```typescript -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice} from '@luma.gl/webgl'; const webglDevice = device instanceof WebGLDevice ? device as WebGLDevice: null; diff --git a/docs/upgrade-guide/README.md b/docs/upgrade-guide/README.md index 00ef6e321f..b7776e9e28 100644 --- a/docs/upgrade-guide/README.md +++ b/docs/upgrade-guide/README.md @@ -364,7 +364,7 @@ luma.gl v6.0 removes a number of previously deprecated symbols. luma.gl will now | Removed symbol | Replacement | Reason for change | | ------------------ | ------------------------------------ | ------------------------------------------------------- | -| `GL` | `import GL from 'luma.gl/constants'` | Bundle size reduction (by making this import optional). | +| `GL` | `import {GL} from 'luma.gl/constants'` | Bundle size reduction (by making this import optional). | | `glGet(name)` | `glGet(gl, name)` | Bundle size reduction (Was deprecated in v5.3) | | `glKey(value)` | `glKey(gl, value)` | Bundle size reduction (Was deprecated in v5.3) | | `glKeyType(value)` | `glKeyType(gl, value)` | Bundle size reduction (Was deprecated in v5.3) | @@ -438,7 +438,7 @@ v5.3 deprecates a number of symbols. It is recommended that you replace their us | Deprecated symbol | Replacement | Reason | | ----------------- | ------------------------------------ | --------------------------- | -| `GL` | `import GL from 'luma.gl/constants'` | Bundle size concerns | +| `GL` | `import {GL} from 'luma.gl/constants'` | Bundle size concerns | | `deleteGLContest` | `destroyGLContext` | API Audit: Naming alignment | | `pollContext` | `pollGLContext` | API Audit: Naming alignment | diff --git a/docs/upgrade-guide/upgrade-v9.md b/docs/upgrade-guide/upgrade-v9.md index 738834780f..68a0b5cd31 100644 --- a/docs/upgrade-guide/upgrade-v9.md +++ b/docs/upgrade-guide/upgrade-v9.md @@ -40,17 +40,22 @@ The ground-up focus on TypeScript and strong typing in luma.gl v9 should create Detailed notes -- `@luma.gl/gltools` (removed) - - The WebGL context functions (`createGLContext` etc), have been moved to the new `WebGLDevice` and `CanvasContext` classes. - - It also contains the classic luma.gl WebGL 2 classes (`Program`, `Texture2D`) etc that used to be improved from `@luma.gl/webgl`. However these classes are now just exposed for backwards compatibility and should gradually be relaced. - - To simplify gradual introduction of the new v9 API, all APIs in `@luma.gl/Webgl-legacy` have been updated to optionally accept a `Device` parameter instead of a `WebGLRenderingContext` -- `@luma.gl/core` module is "in transition": +**`@luma.gl/core`** module is "in transition": - in v9, the core module still exports the deprecated v8 classes from `@luma.gl/gltools` (so that applications can gradually start moving to the v10 API). - WebGL class exports are deprecated and should be imported directly from `@luma.gl/webgl-legacy`. -- `@luma.gl/constants` module remains but is no longer needed by applications: + +**`@luma.gl/experimental`** + - Scene graph exports (`ModelNode`, `GroupNode`, `ScenegraphNode`) has been moved into `@luma.gl/engine`. + +**`@luma.gl/constants`** module remains but is no longer needed by applications: - WebGL-style numeric constants (`GL.` constants) are no longer used in the public v9 API. - Instead, the luma.gl v9 API contains strictly types WebGPU style string constants + - Breaking change: Constants are now exported via a named export rather than a default export (for better ES modules compatibility): `import GL from @luma.gl/constants` => `import {GL} from @luma.gl/constants`. +**`@luma.gl/gltools`** (removed) + - The WebGL context functions (`createGLContext` etc), have been moved to the new `WebGLDevice` and `CanvasContext` classes. + - It also contains the classic luma.gl WebGL 2 classes (`Program`, `Texture2D`) etc that used to be improved from `@luma.gl/webgl`. However these classes are now just exposed for backwards compatibility and should gradually be relaced. + - To simplify gradual introduction of the new v9 API, all APIs in `@luma.gl/Webgl-legacy` have been updated to optionally accept a `Device` parameter instead of a `WebGLRenderingContext` ### Feature-level changes diff --git a/docs/whats-new.md b/docs/whats-new.md index 9c62146400..8e2c038e80 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -55,10 +55,10 @@ Note that adoption of the new v9 luma.gl API will require existing luma.gl v8 ap - Exports `WebGLDevice`, a WebGL / WebGL 2 backend implementation of the luma.gl API (`@luma.gl/api`). - Importing this module enables the application to create `Device`s of type `'webgl2'` or `'webgl'`. -#### `@luma.gl/constants` (deprecated) +#### `@luma.gl/constants` (breaking changes, deprecated) -- The `@luma.gl/constants` module is still available, but is no longer needed by luma.gl v9 applications. -- For convenience, the {`GL`} export is also available in the `@luma.gl/webgl-legacy` module. +- The `@luma.gl/constants` module is still available, but is now considered an internal luma.gl module as GL constants are no longer exposed in the luma.gl v9 API. +- Constants are now exported via a named export `GL` rather than a default export (for better ES modules compatibility). #### `@luma.gl/debug` diff --git a/modules-wip/experimental/src/gltf/gltf-material-parser.ts b/modules-wip/experimental/src/gltf/gltf-material-parser.ts index fb173197e5..e39fc20c04 100644 --- a/modules-wip/experimental/src/gltf/gltf-material-parser.ts +++ b/modules-wip/experimental/src/gltf/gltf-material-parser.ts @@ -1,6 +1,6 @@ import type {Device, Texture, Binding, Parameters} from '@luma.gl/api'; import {log} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {PBREnvironment} from './pbr-environment'; /* eslint-disable camelcase */ diff --git a/modules-wip/experimental/src/gpgpu/point-in-polygon/gpu-point-in-polygon.ts b/modules-wip/experimental/src/gpgpu/point-in-polygon/gpu-point-in-polygon.ts index 62d4c2d550..650056781c 100644 --- a/modules-wip/experimental/src/gpgpu/point-in-polygon/gpu-point-in-polygon.ts +++ b/modules-wip/experimental/src/gpgpu/point-in-polygon/gpu-point-in-polygon.ts @@ -1,5 +1,5 @@ import {assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Buffer, Texture2D} from '@luma.gl/webgl-legacy'; import {Transform} from '@luma.gl/webgl-legacy'; import {textureFilterModule} from './texture-filter'; diff --git a/modules-wip/webgl-legacy/src/classic/context-api.ts b/modules-wip/webgl-legacy/src/classic/context-api.ts index 113acab855..fdf612e3bc 100644 --- a/modules-wip/webgl-legacy/src/classic/context-api.ts +++ b/modules-wip/webgl-legacy/src/classic/context-api.ts @@ -4,7 +4,7 @@ /* eslint-disable quotes */ import type {Device, DeviceProps} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice} from '@luma.gl/webgl'; import {DEPRECATED_FEATURES, DEPRECATED_TO_CLASSIC_FEATURES} from './features'; diff --git a/modules-wip/webgl-legacy/src/classic/copy-and-blit.ts b/modules-wip/webgl-legacy/src/classic/copy-and-blit.ts index a315c2c3d6..c4f146e08c 100644 --- a/modules-wip/webgl-legacy/src/classic/copy-and-blit.ts +++ b/modules-wip/webgl-legacy/src/classic/copy-and-blit.ts @@ -1,6 +1,6 @@ // luma.gl, MIT license import {log, assert, Texture, Framebuffer} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WEBGLTexture, WEBGLFramebuffer, assertWebGL2Context} from '@luma.gl/webgl'; import {withParameters} from '@luma.gl/webgl'; import {flipRows, scalePixels} from '../webgl-utils/typed-array-utils'; diff --git a/modules-wip/webgl-legacy/src/classic/framebuffer.ts b/modules-wip/webgl-legacy/src/classic/framebuffer.ts index 134683ea25..aa0fc08a18 100644 --- a/modules-wip/webgl-legacy/src/classic/framebuffer.ts +++ b/modules-wip/webgl-legacy/src/classic/framebuffer.ts @@ -1,6 +1,6 @@ import type {FramebufferProps} from '@luma.gl/api'; import {Device, log, assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getWebGL2Context, assertWebGL2Context} from '@luma.gl/webgl'; import {WebGLDevice, WEBGLFramebuffer, WEBGLTexture, WEBGLRenderbuffer} from '@luma.gl/webgl'; import {getKey} from '../webgl-utils/constants-to-keys'; diff --git a/modules-wip/webgl-legacy/src/classic/program.ts b/modules-wip/webgl-legacy/src/classic/program.ts index 08ad87c5e8..03a1a2fbf7 100644 --- a/modules-wip/webgl-legacy/src/classic/program.ts +++ b/modules-wip/webgl-legacy/src/classic/program.ts @@ -2,7 +2,7 @@ import type {Device, RenderPipelineProps, RenderPipelineParameters, RenderPass} from '@luma.gl/api'; import {log, assert, uid, cast, Shader} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {parseUniformName, getUniformSetter} from './uniforms'; import ProgramConfiguration from './program-configuration'; import {copyUniform, checkUniformValues} from './uniforms'; diff --git a/modules-wip/webgl-legacy/src/classic/renderbuffer.ts b/modules-wip/webgl-legacy/src/classic/renderbuffer.ts index 46bf6afb26..6f451d0590 100644 --- a/modules-wip/webgl-legacy/src/classic/renderbuffer.ts +++ b/modules-wip/webgl-legacy/src/classic/renderbuffer.ts @@ -1,6 +1,6 @@ /* eslint-disable no-inline-comments */ import type {Device} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice, WEBGLRenderbuffer, RenderbufferProps, convertGLToTextureFormat} from '@luma.gl/webgl'; export type ClassicRenderbufferProps = Omit & { diff --git a/modules-wip/webgl-legacy/src/classic/shader.ts b/modules-wip/webgl-legacy/src/classic/shader.ts index 3f6fdab264..6590f611e8 100644 --- a/modules-wip/webgl-legacy/src/classic/shader.ts +++ b/modules-wip/webgl-legacy/src/classic/shader.ts @@ -1,6 +1,6 @@ // luma.gl, MIT license import {assert, uid, ShaderProps} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getShaderInfo} from '@luma.gl/shadertools'; import {WebGLDevice, WEBGLShader} from '@luma.gl/webgl'; import {assertWebGLContext} from '@luma.gl/webgl'; diff --git a/modules-wip/webgl-legacy/src/classic/texture-cube.ts b/modules-wip/webgl-legacy/src/classic/texture-cube.ts index ce625d595a..bac3610e95 100644 --- a/modules-wip/webgl-legacy/src/classic/texture-cube.ts +++ b/modules-wip/webgl-legacy/src/classic/texture-cube.ts @@ -1,5 +1,5 @@ import {Device} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import Texture, {TextureProps} from './texture'; /** diff --git a/modules-wip/webgl-legacy/src/classic/texture.ts b/modules-wip/webgl-legacy/src/classic/texture.ts index d6a2d4647b..e47ea2852d 100644 --- a/modules-wip/webgl-legacy/src/classic/texture.ts +++ b/modules-wip/webgl-legacy/src/classic/texture.ts @@ -1,5 +1,5 @@ import {Device, TextureFormat, TextureProps, assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {isWebGL2} from '@luma.gl/webgl'; import {getKey, getKeyValue} from '../webgl-utils/constants-to-keys'; import {WebGLDevice, WEBGLTexture} from '@luma.gl/webgl'; diff --git a/modules-wip/webgl-legacy/src/classic/transform-feedback.ts b/modules-wip/webgl-legacy/src/classic/transform-feedback.ts index 3f3ea3b6bc..63545a1957 100644 --- a/modules-wip/webgl-legacy/src/classic/transform-feedback.ts +++ b/modules-wip/webgl-legacy/src/classic/transform-feedback.ts @@ -1,5 +1,5 @@ import {Device, ResourceProps, log, isObjectEmpty} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice, WebGLResource} from '@luma.gl/webgl'; import {isWebGL2} from '@luma.gl/webgl'; import Buffer from './buffer'; diff --git a/modules-wip/webgl-legacy/src/classic/uniforms.ts b/modules-wip/webgl-legacy/src/classic/uniforms.ts index 0d4e5595a7..ddc3dfb104 100644 --- a/modules-wip/webgl-legacy/src/classic/uniforms.ts +++ b/modules-wip/webgl-legacy/src/classic/uniforms.ts @@ -1,5 +1,5 @@ import {log, assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WEBGLTexture, WEBGLFramebuffer, WEBGLRenderbuffer} from '@luma.gl/webgl'; type NumberUniformInfo = { diff --git a/modules-wip/webgl-legacy/src/classic/vertex-array-object.ts b/modules-wip/webgl-legacy/src/classic/vertex-array-object.ts index 4c9c4b60d5..6cf0b6a53f 100644 --- a/modules-wip/webgl-legacy/src/classic/vertex-array-object.ts +++ b/modules-wip/webgl-legacy/src/classic/vertex-array-object.ts @@ -1,6 +1,6 @@ import type {NumberArray} from '@luma.gl/api'; import {assert, getScratchArray, fillArray, ResourceProps} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getBrowser} from '@probe.gl/env'; import {WebGLDevice} from '@luma.gl/webgl'; import {assertWebGL2Context, isWebGL2} from '@luma.gl/webgl'; diff --git a/modules-wip/webgl-legacy/src/classic/vertex-array.ts b/modules-wip/webgl-legacy/src/classic/vertex-array.ts index eb76d54a03..a3a972ae18 100644 --- a/modules-wip/webgl-legacy/src/classic/vertex-array.ts +++ b/modules-wip/webgl-legacy/src/classic/vertex-array.ts @@ -1,6 +1,6 @@ import {log, assert, AttributeBinding, TypedArray} from '@luma.gl/api'; import {ClassicBuffer, WEBGLBuffer, AccessorObject} from '@luma.gl/webgl'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import Accessor from './accessor'; import Program from './program'; import ProgramConfiguration from './program-configuration'; diff --git a/modules-wip/webgl-legacy/src/engine/classic-clip-space.ts b/modules-wip/webgl-legacy/src/engine/classic-clip-space.ts index 44cf0fc35a..5e266244b9 100644 --- a/modules-wip/webgl-legacy/src/engine/classic-clip-space.ts +++ b/modules-wip/webgl-legacy/src/engine/classic-clip-space.ts @@ -1,6 +1,6 @@ // ClipSpace import {Device} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Geometry} from '@luma.gl/engine'; import Model, {ClassicModelProps as ModelProps} from './classic-model'; diff --git a/modules-wip/webgl-legacy/src/engine/classic-model.ts b/modules-wip/webgl-legacy/src/engine/classic-model.ts index 4ccc7a8dd5..97c7058793 100644 --- a/modules-wip/webgl-legacy/src/engine/classic-model.ts +++ b/modules-wip/webgl-legacy/src/engine/classic-model.ts @@ -1,7 +1,7 @@ // luma.gl, MIT license import type {RenderPipelineParameters, Shader} from '@luma.gl/api'; import {Device, Buffer, log, isObjectEmpty, uid, assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice, GLParameters} from '@luma.gl/webgl'; import type {ProgramProps} from '../classic/program'; diff --git a/modules-wip/webgl-legacy/src/engine/model-utils.ts b/modules-wip/webgl-legacy/src/engine/model-utils.ts index 7a471e7a47..e7cabf55de 100644 --- a/modules-wip/webgl-legacy/src/engine/model-utils.ts +++ b/modules-wip/webgl-legacy/src/engine/model-utils.ts @@ -1,5 +1,5 @@ import {assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Buffer} from '@luma.gl/webgl'; // Support for mapping new geometries with glTF attribute names to "classic" luma.gl shader names diff --git a/modules-wip/webgl-legacy/src/transform/texture-transform.ts b/modules-wip/webgl-legacy/src/transform/texture-transform.ts index 13ee7b0142..8facf2917c 100644 --- a/modules-wip/webgl-legacy/src/transform/texture-transform.ts +++ b/modules-wip/webgl-legacy/src/transform/texture-transform.ts @@ -1,6 +1,6 @@ // luma.gl, MIT license -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Device, Framebuffer} from '@luma.gl/api'; import { diff --git a/modules-wip/webgl-legacy/src/transform/transform.ts b/modules-wip/webgl-legacy/src/transform/transform.ts index 523effafc5..cdf589ee52 100644 --- a/modules-wip/webgl-legacy/src/transform/transform.ts +++ b/modules-wip/webgl-legacy/src/transform/transform.ts @@ -2,7 +2,7 @@ import {Device, assert, isObjectEmpty, Framebuffer} from '@luma.gl/api'; import {getShaderInfo, getPassthroughFS} from '@luma.gl/shadertools'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice, GLParameters} from '@luma.gl/webgl'; // import {AccessorObject} from '@luma.gl/webgl'; diff --git a/modules-wip/webgl-legacy/src/webgl-utils/format-utils.ts b/modules-wip/webgl-legacy/src/webgl-utils/format-utils.ts index 4ce85068f7..821bb54b30 100644 --- a/modules-wip/webgl-legacy/src/webgl-utils/format-utils.ts +++ b/modules-wip/webgl-legacy/src/webgl-utils/format-utils.ts @@ -1,5 +1,5 @@ import {assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; // Returns number of components in a specific readPixels WebGL format export function glFormatToComponents(format) { diff --git a/modules-wip/webgl-legacy/src/webgl-utils/typed-array-utils.ts b/modules-wip/webgl-legacy/src/webgl-utils/typed-array-utils.ts index 0fba390c48..f06db376ad 100644 --- a/modules-wip/webgl-legacy/src/webgl-utils/typed-array-utils.ts +++ b/modules-wip/webgl-legacy/src/webgl-utils/typed-array-utils.ts @@ -1,6 +1,6 @@ // luma.gl, MIT license -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; const ERR_TYPE_DEDUCTION = 'Failed to deduce GL constant from typed array'; diff --git a/modules-wip/webgl-legacy/test/classic/accessor.spec.ts b/modules-wip/webgl-legacy/test/classic/accessor.spec.ts index 29d74db7b7..e192e8cfa0 100644 --- a/modules-wip/webgl-legacy/test/classic/accessor.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/accessor.spec.ts @@ -1,5 +1,5 @@ import test from 'tape-promise/tape'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Accessor} from '@luma.gl/webgl-legacy'; import {DEFAULT_ACCESSOR_VALUES} from '@luma.gl/webgl/classic/accessor'; diff --git a/modules-wip/webgl-legacy/test/classic/buffer.spec.ts b/modules-wip/webgl-legacy/test/classic/buffer.spec.ts index 447b826df0..59b2783f8c 100644 --- a/modules-wip/webgl-legacy/test/classic/buffer.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/buffer.spec.ts @@ -1,4 +1,4 @@ -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Buffer, isWebGL} from '@luma.gl/webgl-legacy'; import test from 'tape-promise/tape'; diff --git a/modules-wip/webgl-legacy/test/classic/context/limits.spec.ts b/modules-wip/webgl-legacy/test/classic/context/limits.spec.ts index 0640ef2aee..f9e4c88acd 100644 --- a/modules-wip/webgl-legacy/test/classic/context/limits.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/context/limits.spec.ts @@ -1,7 +1,7 @@ // luma.gl, MIT license import { WebGLLimits } from '@luma.gl/webgl'; import {getKey, getContextInfo} from '@luma.gl/webgl-legacy'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import test from 'tape-promise/tape'; import {fixture} from 'test/setup'; diff --git a/modules-wip/webgl-legacy/test/classic/copy-and-blit.spec.ts b/modules-wip/webgl-legacy/test/classic/copy-and-blit.spec.ts index 16e730f815..f80608d8cf 100644 --- a/modules-wip/webgl-legacy/test/classic/copy-and-blit.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/copy-and-blit.spec.ts @@ -1,5 +1,5 @@ import test from 'tape-promise/tape'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Framebuffer, Renderbuffer, Texture2D, Buffer, getKey} from '@luma.gl/webgl-legacy'; import {fixture} from 'test/setup'; import {readPixelsToArray, readPixelsToBuffer, copyToTexture, blit} from '@luma.gl/webgl-legacy'; diff --git a/modules-wip/webgl-legacy/test/classic/framebuffer.spec.ts b/modules-wip/webgl-legacy/test/classic/framebuffer.spec.ts index 5fbf769dde..3b1fbbf0b8 100644 --- a/modules-wip/webgl-legacy/test/classic/framebuffer.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/framebuffer.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable max-len */ import test from 'tape-promise/tape'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Framebuffer, Renderbuffer, Texture2D} from '@luma.gl/webgl-legacy'; import {fixture} from 'test/setup'; diff --git a/modules-wip/webgl-legacy/test/classic/program-configuration.spec.ts b/modules-wip/webgl-legacy/test/classic/program-configuration.spec.ts index b44d126a1f..67fca5511d 100644 --- a/modules-wip/webgl-legacy/test/classic/program-configuration.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/program-configuration.spec.ts @@ -1,5 +1,5 @@ import test from 'tape-promise/tape'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Program} from '@luma.gl/webgl-legacy'; import ProgramConfiguration from '@luma.gl/webgl-legacy/classic/program-configuration'; import {fixture} from 'test/setup'; diff --git a/modules-wip/webgl-legacy/test/classic/query.spec.ts b/modules-wip/webgl-legacy/test/classic/query.spec.ts index 79ae8237da..21902bc9c1 100644 --- a/modules-wip/webgl-legacy/test/classic/query.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/query.spec.ts @@ -2,7 +2,7 @@ import test from 'tape-promise/tape'; import {Query} from '@luma.gl/webgl-legacy'; // import util from 'util'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {fixture} from 'test/setup'; function pollQuery(query, t) { diff --git a/modules-wip/webgl-legacy/test/classic/texture-cube.spec.ts b/modules-wip/webgl-legacy/test/classic/texture-cube.spec.ts index 580db0b1d8..fe4a5badcd 100644 --- a/modules-wip/webgl-legacy/test/classic/texture-cube.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/texture-cube.spec.ts @@ -1,6 +1,6 @@ import test from 'tape-promise/tape'; import {TextureCube} from '@luma.gl/webgl-legacy'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {fixture} from 'test/setup'; diff --git a/modules-wip/webgl-legacy/test/classic/texture.spec.ts b/modules-wip/webgl-legacy/test/classic/texture.spec.ts index 225d1e4391..a15e400a9e 100644 --- a/modules-wip/webgl-legacy/test/classic/texture.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/texture.spec.ts @@ -2,7 +2,7 @@ import test from 'tape-promise/tape'; import {fixture} from 'test/setup'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {isWebGL2} from '@luma.gl/webgl-legacy'; import {Buffer, Texture2D, getKey, readPixelsToArray} from '@luma.gl/webgl-legacy'; diff --git a/modules-wip/webgl-legacy/test/classic/transform-feedback.spec.ts b/modules-wip/webgl-legacy/test/classic/transform-feedback.spec.ts index 78f0a5e2f8..e918872a4d 100644 --- a/modules-wip/webgl-legacy/test/classic/transform-feedback.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/transform-feedback.spec.ts @@ -1,5 +1,5 @@ import {glsl} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {TransformFeedback, Buffer} from '@luma.gl/webgl-legacy'; // TODO - tests shouldn't depend on higher level module? import {Model} from '@luma.gl/webgl-legacy'; diff --git a/modules-wip/webgl-legacy/test/classic/uniform-buffer-layout.spec.ts b/modules-wip/webgl-legacy/test/classic/uniform-buffer-layout.spec.ts index 34e73c1eec..9cebc5d68d 100644 --- a/modules-wip/webgl-legacy/test/classic/uniform-buffer-layout.spec.ts +++ b/modules-wip/webgl-legacy/test/classic/uniform-buffer-layout.spec.ts @@ -2,7 +2,7 @@ import test from 'tape-promise/tape'; import {glsl} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {UniformBufferLayout, Buffer, Program} from '@luma.gl/webgl-legacy'; // TODO - tests shouldn't depend on higher level module? import {Transform} from '@luma.gl/webgl-legacy'; diff --git a/modules-wip/webgl-legacy/test/classic/uniform-cache-test-cases.ts b/modules-wip/webgl-legacy/test/classic/uniform-cache-test-cases.ts index 35656e86fe..0905c867ac 100644 --- a/modules-wip/webgl-legacy/test/classic/uniform-cache-test-cases.ts +++ b/modules-wip/webgl-legacy/test/classic/uniform-cache-test-cases.ts @@ -1,4 +1,4 @@ -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; export const CACHING_TEST_CASES = [ { diff --git a/modules-wip/webgl-legacy/test/engine/model.spec.ts b/modules-wip/webgl-legacy/test/engine/model.spec.ts index a7dbe7c845..8a7efd1ba3 100644 --- a/modules-wip/webgl-legacy/test/engine/model.spec.ts +++ b/modules-wip/webgl-legacy/test/engine/model.spec.ts @@ -1,7 +1,7 @@ import test from 'tape-promise/tape'; import {webgl1Device} from '@luma.gl/test-utils'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {luma} from '@luma.gl/api'; // TODO - Model test should not depend on Cube import {ClassicModel as Model, ProgramManager} from '@luma.gl/webgl-legacy'; diff --git a/modules-wip/webgl-legacy/test/transform/transform.spec.ts b/modules-wip/webgl-legacy/test/transform/transform.spec.ts index 0eb1b910e5..ebc9e45e72 100644 --- a/modules-wip/webgl-legacy/test/transform/transform.spec.ts +++ b/modules-wip/webgl-legacy/test/transform/transform.spec.ts @@ -2,7 +2,7 @@ import test from 'tape-promise/tape'; import {webgl1Device, webgl2Device} from '@luma.gl/test-utils'; import {luma, glsl} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Transform} from '@luma.gl/webgl-legacy'; import {Buffer, Texture2D, setParameters, getParameters} from '@luma.gl/webgl-legacy'; import {TypedArray} from 'modules/api/dist'; diff --git a/modules-wip/webgl-legacy/test/webgl-utils/texture-utils.spec.ts b/modules-wip/webgl-legacy/test/webgl-utils/texture-utils.spec.ts index b8362f34b4..b09fc098a6 100644 --- a/modules-wip/webgl-legacy/test/webgl-utils/texture-utils.spec.ts +++ b/modules-wip/webgl-legacy/test/webgl-utils/texture-utils.spec.ts @@ -2,7 +2,7 @@ import test from 'tape-promise/tape'; import {cloneTextureFrom} from '@luma.gl/webgl-legacy/webgl-utils/texture-utils'; import {Texture2D} from '@luma.gl/webgl-legacy'; import {fixture} from 'test/setup'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; test('texture-utils#cloneTextureFrom', (t) => { const {gl} = fixture; diff --git a/modules/api-tests/test/adapter/device-helpers/device-limits.spec.ts b/modules/api-tests/test/adapter/device-helpers/device-limits.spec.ts index 3612a5bbd3..852904f34c 100644 --- a/modules/api-tests/test/adapter/device-helpers/device-limits.spec.ts +++ b/modules/api-tests/test/adapter/device-helpers/device-limits.spec.ts @@ -1,5 +1,5 @@ import test from 'tape-promise/tape'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getTestDevices, getWebGLTestDevices} from '@luma.gl/test-utils'; const DEVICE_LIMITS = { diff --git a/modules/api-tests/test/adapter/device-helpers/set-device-parameters.spec.ts b/modules/api-tests/test/adapter/device-helpers/set-device-parameters.spec.ts index d8256cd904..a076306e34 100644 --- a/modules/api-tests/test/adapter/device-helpers/set-device-parameters.spec.ts +++ b/modules/api-tests/test/adapter/device-helpers/set-device-parameters.spec.ts @@ -2,7 +2,7 @@ import test, {Test} from 'tape-promise/tape'; import {webgl1Device, webgl2Device} from '@luma.gl/test-utils'; import {Parameters} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {setDeviceParameters, GLParameters, getParameters, resetParameters} from '@luma.gl/webgl'; // import {createTestDevice} from '@luma.gl/test-utils'; diff --git a/modules/api-tests/test/adapter/resources/buffer.spec.ts b/modules/api-tests/test/adapter/resources/buffer.spec.ts index a707e6c914..e7d02d5851 100644 --- a/modules/api-tests/test/adapter/resources/buffer.spec.ts +++ b/modules/api-tests/test/adapter/resources/buffer.spec.ts @@ -2,7 +2,7 @@ import {Buffer} from '@luma.gl/api'; import {WEBGLBuffer} from '@luma.gl/webgl'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import test from 'tape-promise/tape'; import {getWebGLTestDevices} from '@luma.gl/test-utils'; diff --git a/modules/api-tests/test/adapter/resources/texture.spec.ts b/modules/api-tests/test/adapter/resources/texture.spec.ts index 5d95f3fe15..d00a43cd00 100644 --- a/modules/api-tests/test/adapter/resources/texture.spec.ts +++ b/modules/api-tests/test/adapter/resources/texture.spec.ts @@ -6,7 +6,7 @@ import test from 'tape-promise/tape'; import {webgl1Device, webgl2Device, getTestDevices} from '@luma.gl/test-utils'; import {Device, Texture, TextureFormat, cast} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; // import {readPixelsToArray} from '@luma.gl/webgl-legacy'; import {TEXTURE_FORMATS} from '@luma.gl/webgl/adapter/converters/texture-formats'; diff --git a/modules/constants/src/bundle.ts b/modules/constants/src/bundle.ts index 0b651b5b3b..d73d557339 100644 --- a/modules/constants/src/bundle.ts +++ b/modules/constants/src/bundle.ts @@ -1,3 +1,3 @@ -import GLConstants from './index'; +import {GL as GLConstants} from './index'; export {GLConstants}; diff --git a/modules/constants/src/index.ts b/modules/constants/src/index.ts index e0f1814f2a..61e7a53082 100644 --- a/modules/constants/src/index.ts +++ b/modules/constants/src/index.ts @@ -1,5 +1,5 @@ // WebGL constants -export {GL, GL as default} from './constants-enum'; +export {GL} from './constants-enum'; // WebGL types export type { diff --git a/modules/constants/test/constants.spec.ts b/modules/constants/test/constants.spec.ts index 85f5e87d90..bcea217837 100644 --- a/modules/constants/test/constants.spec.ts +++ b/modules/constants/test/constants.spec.ts @@ -1,7 +1,7 @@ import test from 'tape-promise/tape'; import {fixture} from 'test/setup'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; test('@luma.gl/constants', (t) => { t.equal(typeof GL, 'object', '@luma.gl/constants is an object'); diff --git a/modules/debug/src/glsl-to-js-compiler/debug-context.ts b/modules/debug/src/glsl-to-js-compiler/debug-context.ts index de7a73669a..75995ac939 100644 --- a/modules/debug/src/glsl-to-js-compiler/debug-context.ts +++ b/modules/debug/src/glsl-to-js-compiler/debug-context.ts @@ -1,4 +1,4 @@ -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {drawModel} from './draw-model'; /* eslint-disable @typescript-eslint/unbound-method */ diff --git a/modules/debug/src/webgl-api-tracing/webgl-debug-context.ts b/modules/debug/src/webgl-api-tracing/webgl-debug-context.ts index 12d2a025e5..0b47fa174f 100644 --- a/modules/debug/src/webgl-api-tracing/webgl-debug-context.ts +++ b/modules/debug/src/webgl-api-tracing/webgl-debug-context.ts @@ -1,7 +1,7 @@ // Depends on Khronos Debug support module being imported via "luma.gl/debug" // NOTE deprecated, this file has been copied into luma.gl/webgl import {log} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; // Expose Khronos Debug support module on global context import {WebGLDebugUtils} from './webgl-debug'; diff --git a/modules/engine/src/geometry/geometry.ts b/modules/engine/src/geometry/geometry.ts index b8850c47fd..9e009e79e3 100644 --- a/modules/engine/src/geometry/geometry.ts +++ b/modules/engine/src/geometry/geometry.ts @@ -1,7 +1,7 @@ // luma.gl, MIT license import type {PrimitiveTopology, TypedArray} from '@luma.gl/api'; import {uid, assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; /** * Rendering primitives - "topology" specifies how to extract primitives from vertices. diff --git a/modules/engine/src/lib/clip-space.ts b/modules/engine/src/lib/clip-space.ts index fbf93a0f69..cbe4cf0230 100644 --- a/modules/engine/src/lib/clip-space.ts +++ b/modules/engine/src/lib/clip-space.ts @@ -1,6 +1,6 @@ // ClipSpace -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Device, glsl} from '@luma.gl/api'; import {WebGLDevice} from '@luma.gl/webgl'; import {Model, ModelProps} from '../model/model'; diff --git a/modules/engine/src/transform/transform.ts b/modules/engine/src/transform/transform.ts index aef73f9e09..0d90fe1628 100644 --- a/modules/engine/src/transform/transform.ts +++ b/modules/engine/src/transform/transform.ts @@ -2,7 +2,7 @@ import {Device, Buffer, Texture, Framebuffer} from '@luma.gl/api'; import {getShaderInfo, getPassthroughFS} from '@luma.gl/shadertools'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice, GLParameters} from '@luma.gl/webgl'; import {Model} from '../model/model'; diff --git a/modules/engine/test/lib/model.spec.ts b/modules/engine/test/lib/model.spec.ts index 4161cb190d..af0bb26ce9 100644 --- a/modules/engine/test/lib/model.spec.ts +++ b/modules/engine/test/lib/model.spec.ts @@ -2,7 +2,7 @@ import test from 'tape-promise/tape'; import {webgl1Device} from '@luma.gl/test-utils'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {luma} from '@luma.gl/api'; // TODO - Model test should not depend on Cube import {Model, ProgramManager} from '@luma.gl/engine'; diff --git a/modules/webgl/src/adapter/converters/device-parameters.ts b/modules/webgl/src/adapter/converters/device-parameters.ts index b7406b9226..5fa7d3c8a6 100644 --- a/modules/webgl/src/adapter/converters/device-parameters.ts +++ b/modules/webgl/src/adapter/converters/device-parameters.ts @@ -6,7 +6,7 @@ import { log, isObjectEmpty } from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import type {GLParameters} from '@luma.gl/constants'; import {pushContextState, popContextState} from '../../context/state-tracker/track-context-state'; import {setParameters} from '../../context/parameters/unified-parameter-api'; diff --git a/modules/webgl/src/adapter/converters/texture-formats.ts b/modules/webgl/src/adapter/converters/texture-formats.ts index 5f241489cd..01e0b7385a 100644 --- a/modules/webgl/src/adapter/converters/texture-formats.ts +++ b/modules/webgl/src/adapter/converters/texture-formats.ts @@ -1,6 +1,6 @@ import type {TextureFormat, DeviceFeature} from '@luma.gl/api'; import {decodeTextureFormat} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {isWebGL2} from '../../context/context/webgl-checks'; /* eslint-disable camelcase */ diff --git a/modules/webgl/src/adapter/converters/vertex-formats.ts b/modules/webgl/src/adapter/converters/vertex-formats.ts index dc561b60a3..166d0db1b2 100644 --- a/modules/webgl/src/adapter/converters/vertex-formats.ts +++ b/modules/webgl/src/adapter/converters/vertex-formats.ts @@ -1,4 +1,4 @@ -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {VertexFormat} from '@luma.gl/api'; export function getVertexFormat(type: GL, components: number): VertexFormat { diff --git a/modules/webgl/src/adapter/device-helpers/device-limits.ts b/modules/webgl/src/adapter/device-helpers/device-limits.ts index ca4e18babf..4dd2ed658b 100644 --- a/modules/webgl/src/adapter/device-helpers/device-limits.ts +++ b/modules/webgl/src/adapter/device-helpers/device-limits.ts @@ -1,6 +1,6 @@ // luma.gl, MIT license import type {DeviceLimits} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getWebGL2Context} from '../../context/context/webgl-checks'; /** Populate a WebGPU style device limits */ diff --git a/modules/webgl/src/adapter/device-helpers/get-device-info.ts b/modules/webgl/src/adapter/device-helpers/get-device-info.ts index 49a5d2df02..6afd03da2e 100644 --- a/modules/webgl/src/adapter/device-helpers/get-device-info.ts +++ b/modules/webgl/src/adapter/device-helpers/get-device-info.ts @@ -1,5 +1,5 @@ import {DeviceInfo} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {isWebGL2} from '../../context/context/webgl-checks'; /** @returns strings identifying the GPU vendor and driver. */ diff --git a/modules/webgl/src/adapter/helpers/get-shader-layout.ts b/modules/webgl/src/adapter/helpers/get-shader-layout.ts index cb538ba71e..83bced28b0 100644 --- a/modules/webgl/src/adapter/helpers/get-shader-layout.ts +++ b/modules/webgl/src/adapter/helpers/get-shader-layout.ts @@ -11,7 +11,7 @@ import { // AttributeLayout, AccessorObject } from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {isWebGL2} from '../../context/context/webgl-checks'; import {Accessor} from '../../classic/accessor'; // TODO - should NOT depend on classic API import {decodeUniformType, decodeAttributeType} from './uniforms'; diff --git a/modules/webgl/src/adapter/helpers/set-uniform.ts b/modules/webgl/src/adapter/helpers/set-uniform.ts index f8ab53045a..e7cf2bd4d8 100644 --- a/modules/webgl/src/adapter/helpers/set-uniform.ts +++ b/modules/webgl/src/adapter/helpers/set-uniform.ts @@ -1,7 +1,7 @@ /* eslint-disable */ // Uniforms -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; /** Set a raw uniform (without type conversion and caching) */ /* eslint-disable max-len */ diff --git a/modules/webgl/src/adapter/objects/constants-to-keys.ts b/modules/webgl/src/adapter/objects/constants-to-keys.ts index 9f91c44842..5d89ba6608 100644 --- a/modules/webgl/src/adapter/objects/constants-to-keys.ts +++ b/modules/webgl/src/adapter/objects/constants-to-keys.ts @@ -1,5 +1,5 @@ import {assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; // Resolve a WebGL enumeration name (returns itself if already a number) export function getKeyValue(gl: WebGLRenderingContext, name: string | GL): GL { diff --git a/modules/webgl/src/adapter/objects/webgl-renderbuffer.ts b/modules/webgl/src/adapter/objects/webgl-renderbuffer.ts index 78fb993bae..93bb4cdbeb 100644 --- a/modules/webgl/src/adapter/objects/webgl-renderbuffer.ts +++ b/modules/webgl/src/adapter/objects/webgl-renderbuffer.ts @@ -1,5 +1,5 @@ import {assert, ResourceProps, TextureFormat} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice} from '../webgl-device'; import {WebGLResource} from './webgl-resource'; import {isRenderbufferFormatSupported} from '../converters/texture-formats'; diff --git a/modules/webgl/src/adapter/objects/webgl-resource.ts b/modules/webgl/src/adapter/objects/webgl-resource.ts index 6dd0e9ff08..a3d3e54ba9 100644 --- a/modules/webgl/src/adapter/objects/webgl-resource.ts +++ b/modules/webgl/src/adapter/objects/webgl-resource.ts @@ -1,7 +1,7 @@ // luma.gl, MIT license import {Resource, assert, uid, stubRemovedMethods} from '@luma.gl/api'; import type {Device, ResourceProps} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {isWebGL2, assertWebGLContext} from '../../context/context/webgl-checks'; import {WebGLDevice} from '../webgl-device'; diff --git a/modules/webgl/src/adapter/objects/webgl-vertex-array-object.ts b/modules/webgl/src/adapter/objects/webgl-vertex-array-object.ts index 7a1f09ae6c..7b7bf1b5fd 100644 --- a/modules/webgl/src/adapter/objects/webgl-vertex-array-object.ts +++ b/modules/webgl/src/adapter/objects/webgl-vertex-array-object.ts @@ -1,5 +1,5 @@ import {assert, ResourceProps} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getBrowser} from '@probe.gl/env'; import {WebGLDevice} from '../webgl-device'; diff --git a/modules/webgl/src/adapter/resources/webgl-buffer.ts b/modules/webgl/src/adapter/resources/webgl-buffer.ts index 70331f5dc6..988aaab6ed 100644 --- a/modules/webgl/src/adapter/resources/webgl-buffer.ts +++ b/modules/webgl/src/adapter/resources/webgl-buffer.ts @@ -1,6 +1,6 @@ import type {BufferProps} from '@luma.gl/api'; import {Buffer, assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice} from '../webgl-device'; const DEBUG_DATA_LENGTH = 10; diff --git a/modules/webgl/src/adapter/resources/webgl-command-buffer.ts b/modules/webgl/src/adapter/resources/webgl-command-buffer.ts index 32e9327d0f..d79afe3fc0 100644 --- a/modules/webgl/src/adapter/resources/webgl-command-buffer.ts +++ b/modules/webgl/src/adapter/resources/webgl-command-buffer.ts @@ -12,7 +12,7 @@ import { // Buffer, Framebuffer } from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; // import {getTypedArrayFromGLType, getGLTypeFromTypedArray} from '../../classic/typed-array-utils'; import {WebGLDevice} from '../webgl-device'; diff --git a/modules/webgl/src/adapter/resources/webgl-framebuffer.ts b/modules/webgl/src/adapter/resources/webgl-framebuffer.ts index 048355ebc7..671681b7df 100644 --- a/modules/webgl/src/adapter/resources/webgl-framebuffer.ts +++ b/modules/webgl/src/adapter/resources/webgl-framebuffer.ts @@ -2,7 +2,7 @@ import type {FramebufferProps, TextureFormat} from '@luma.gl/api'; import {Framebuffer, Texture, assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice} from '../webgl-device'; import {WEBGLTexture} from './webgl-texture'; import {WEBGLRenderbuffer} from '../objects/webgl-renderbuffer'; diff --git a/modules/webgl/src/adapter/resources/webgl-render-pipeline.ts b/modules/webgl/src/adapter/resources/webgl-render-pipeline.ts index f78d48bcfe..34845a02a0 100644 --- a/modules/webgl/src/adapter/resources/webgl-render-pipeline.ts +++ b/modules/webgl/src/adapter/resources/webgl-render-pipeline.ts @@ -9,7 +9,7 @@ import type { AttributeLayout } from '@luma.gl/api'; import {RenderPipeline, cast, log, decodeVertexFormat} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getWebGLDataType} from '../converters/texture-formats'; import {getShaderLayout} from '../helpers/get-shader-layout'; diff --git a/modules/webgl/src/adapter/resources/webgl-shader.ts b/modules/webgl/src/adapter/resources/webgl-shader.ts index e0316e82c6..272fe6348e 100644 --- a/modules/webgl/src/adapter/resources/webgl-shader.ts +++ b/modules/webgl/src/adapter/resources/webgl-shader.ts @@ -1,6 +1,6 @@ // luma.gl, MIT license import {log, uid, Shader, ShaderProps, CompilerMessage, formatCompilerLog} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getShaderInfo} from '../helpers/get-shader-info'; import {parseShaderCompilerLog} from '../helpers/parse-shader-compiler-log'; import {WebGLDevice} from '../webgl-device'; diff --git a/modules/webgl/src/classic/accessor.ts b/modules/webgl/src/classic/accessor.ts index a4beef1334..c8187ff0fe 100644 --- a/modules/webgl/src/classic/accessor.ts +++ b/modules/webgl/src/classic/accessor.ts @@ -1,5 +1,5 @@ import {assert, checkProps, Buffer, AccessorObject} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getTypedArrayFromGLType} from './typed-array-utils'; const DEFAULT_ACCESSOR_VALUES = { diff --git a/modules/webgl/src/classic/buffer.ts b/modules/webgl/src/classic/buffer.ts index b30b172f2b..5abb0422c2 100644 --- a/modules/webgl/src/classic/buffer.ts +++ b/modules/webgl/src/classic/buffer.ts @@ -2,7 +2,7 @@ import type {Device, BufferProps, TypedArray} from '@luma.gl/api'; import {assert, checkProps} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {assertWebGL2Context} from '../context/context/webgl-checks'; import {AccessorObject} from '../types'; import {Accessor} from './accessor'; diff --git a/modules/webgl/src/classic/copy-and-blit.ts b/modules/webgl/src/classic/copy-and-blit.ts index baba674c06..3fd7b03d12 100644 --- a/modules/webgl/src/classic/copy-and-blit.ts +++ b/modules/webgl/src/classic/copy-and-blit.ts @@ -1,6 +1,6 @@ // luma.gl, MIT license import {assert, Texture, Framebuffer, FramebufferProps} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {ClassicBuffer as Buffer} from './buffer'; import {WEBGLTexture} from '../adapter/resources/webgl-texture'; diff --git a/modules/webgl/src/classic/format-utils.ts b/modules/webgl/src/classic/format-utils.ts index 4ce85068f7..821bb54b30 100644 --- a/modules/webgl/src/classic/format-utils.ts +++ b/modules/webgl/src/classic/format-utils.ts @@ -1,5 +1,5 @@ import {assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; // Returns number of components in a specific readPixels WebGL format export function glFormatToComponents(format) { diff --git a/modules/webgl/src/context/debug/webgl-developer-tools.ts b/modules/webgl/src/context/debug/webgl-developer-tools.ts index 148e82c164..fe5b76ec2d 100644 --- a/modules/webgl/src/context/debug/webgl-developer-tools.ts +++ b/modules/webgl/src/context/debug/webgl-developer-tools.ts @@ -1,6 +1,6 @@ // luma.gl, MIT license import {log, loadScript} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; const WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js'; diff --git a/modules/webgl/src/context/polyfill/get-parameter-polyfill.ts b/modules/webgl/src/context/polyfill/get-parameter-polyfill.ts index 2a332859de..31f7f0fd2f 100644 --- a/modules/webgl/src/context/polyfill/get-parameter-polyfill.ts +++ b/modules/webgl/src/context/polyfill/get-parameter-polyfill.ts @@ -1,5 +1,5 @@ /* eslint-disable no-inline-comments, max-len, camelcase */ -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {isWebGL2} from '../context/webgl-checks'; const OES_element_index = 'OES_element_index'; diff --git a/modules/webgl/src/context/polyfill/polyfill-table.ts b/modules/webgl/src/context/polyfill/polyfill-table.ts index 09ad758863..123b61e14f 100644 --- a/modules/webgl/src/context/polyfill/polyfill-table.ts +++ b/modules/webgl/src/context/polyfill/polyfill-table.ts @@ -1,5 +1,5 @@ import {assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {isWebGL2} from '../context/webgl-checks'; import {getParameterPolyfill} from './get-parameter-polyfill'; diff --git a/modules/webgl/test/adapter/device-helpers/device-limits.spec.ts b/modules/webgl/test/adapter/device-helpers/device-limits.spec.ts index 3612a5bbd3..852904f34c 100644 --- a/modules/webgl/test/adapter/device-helpers/device-limits.spec.ts +++ b/modules/webgl/test/adapter/device-helpers/device-limits.spec.ts @@ -1,5 +1,5 @@ import test from 'tape-promise/tape'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {getTestDevices, getWebGLTestDevices} from '@luma.gl/test-utils'; const DEVICE_LIMITS = { diff --git a/modules/webgl/test/adapter/device-helpers/set-device-parameters.spec.ts b/modules/webgl/test/adapter/device-helpers/set-device-parameters.spec.ts index d8256cd904..a076306e34 100644 --- a/modules/webgl/test/adapter/device-helpers/set-device-parameters.spec.ts +++ b/modules/webgl/test/adapter/device-helpers/set-device-parameters.spec.ts @@ -2,7 +2,7 @@ import test, {Test} from 'tape-promise/tape'; import {webgl1Device, webgl2Device} from '@luma.gl/test-utils'; import {Parameters} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {setDeviceParameters, GLParameters, getParameters, resetParameters} from '@luma.gl/webgl'; // import {createTestDevice} from '@luma.gl/test-utils'; diff --git a/modules/webgl/test/adapter/objects/webgl-vertex-array-object.spec.ts b/modules/webgl/test/adapter/objects/webgl-vertex-array-object.spec.ts index 884023c669..d84fdcd9df 100644 --- a/modules/webgl/test/adapter/objects/webgl-vertex-array-object.spec.ts +++ b/modules/webgl/test/adapter/objects/webgl-vertex-array-object.spec.ts @@ -3,7 +3,7 @@ import test from 'tape-promise/tape'; import {getWebGLTestDevices} from '@luma.gl/test-utils'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WEBGLVertexArrayObject} from '@luma.gl/webgl'; test('WebGL#WEBGLVertexArrayObject#enable', t => { diff --git a/modules/webgl/test/adapter/resources/webgl-texture.spec.ts b/modules/webgl/test/adapter/resources/webgl-texture.spec.ts index 810a148e98..8f1e5d1f73 100644 --- a/modules/webgl/test/adapter/resources/webgl-texture.spec.ts +++ b/modules/webgl/test/adapter/resources/webgl-texture.spec.ts @@ -6,7 +6,7 @@ import test from 'tape-promise/tape'; import {webgl1Device, webgl2Device, getTestDevices} from '@luma.gl/test-utils'; import {Device, Texture, TextureFormat, cast} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {Buffer, readPixelsToArray} from '@luma.gl/webgl-legacy'; import {TEXTURE_FORMATS} from '@luma.gl/webgl/adapter/converters/texture-formats'; diff --git a/modules/webgl/test/context/polyfill/get-parameter-polyfill.spec.ts b/modules/webgl/test/context/polyfill/get-parameter-polyfill.spec.ts index 5271110e26..ec87980556 100644 --- a/modules/webgl/test/context/polyfill/get-parameter-polyfill.spec.ts +++ b/modules/webgl/test/context/polyfill/get-parameter-polyfill.spec.ts @@ -1,5 +1,5 @@ import {getParameterPolyfill} from '@luma.gl/webgl/context/polyfill/get-parameter-polyfill'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import test from 'tape-promise/tape'; import {fixture} from 'test/setup'; diff --git a/modules/webgl/test/context/state-tracker/context-state.spec.ts b/modules/webgl/test/context/state-tracker/context-state.spec.ts index 6cdb3920aa..4af15c20dd 100644 --- a/modules/webgl/test/context/state-tracker/context-state.spec.ts +++ b/modules/webgl/test/context/state-tracker/context-state.spec.ts @@ -1,7 +1,7 @@ import test from 'tape-promise/tape'; import {webgl1Device, webgl2Device} from '@luma.gl/test-utils'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import type {TypedArray} from '@luma.gl/api' import type {GLParameters} from '@luma.gl/webgl'; diff --git a/modules/webgl/test/context/state-tracker/data/sample-enum-settings.ts b/modules/webgl/test/context/state-tracker/data/sample-enum-settings.ts index 5334e23023..53a93405a2 100644 --- a/modules/webgl/test/context/state-tracker/data/sample-enum-settings.ts +++ b/modules/webgl/test/context/state-tracker/data/sample-enum-settings.ts @@ -1,6 +1,6 @@ // luma.gl, MIT license -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {GLParameters} from '@luma.gl/webgl'; // NOTE: These settings should be in sync with FUNCTION_STYLE_SETTINGS_SET1 diff --git a/modules/webgl/test/context/state-tracker/data/sample-function-settings.ts b/modules/webgl/test/context/state-tracker/data/sample-function-settings.ts index 053d841eb2..9b4aad5e43 100644 --- a/modules/webgl/test/context/state-tracker/data/sample-function-settings.ts +++ b/modules/webgl/test/context/state-tracker/data/sample-function-settings.ts @@ -1,4 +1,4 @@ -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import type {GLParameters} from '@luma.gl/webgl'; // NOTE: These settings are same as ENUM_STYLE_SETTINGS_SET1 diff --git a/modules/webgl/test/context/state-tracker/set-parameters.spec.ts b/modules/webgl/test/context/state-tracker/set-parameters.spec.ts index 78d9722965..68f678e259 100644 --- a/modules/webgl/test/context/state-tracker/set-parameters.spec.ts +++ b/modules/webgl/test/context/state-tracker/set-parameters.spec.ts @@ -4,7 +4,7 @@ import {stringifyTypedArray} from './context-state.spec'; import {setParameters, getParameters, resetParameters} from '@luma.gl/webgl'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {GL_PARAMETER_DEFAULTS} from '@luma.gl/webgl/context/parameters/webgl-parameter-tables'; import {ENUM_STYLE_SETTINGS_SET1_PRIMITIVE} from './data/sample-enum-settings'; diff --git a/modules/webgpu/src/adapter/helpers/accessor-to-format.ts b/modules/webgpu/src/adapter/helpers/accessor-to-format.ts index edaf8ca209..4e4934ab6a 100644 --- a/modules/webgpu/src/adapter/helpers/accessor-to-format.ts +++ b/modules/webgpu/src/adapter/helpers/accessor-to-format.ts @@ -1,6 +1,6 @@ /* import {assert} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; type Accessor = Record; diff --git a/test/apps/tree-shaking/app.js b/test/apps/tree-shaking/app.js index cb07554b2e..e0d4f6a4a6 100644 --- a/test/apps/tree-shaking/app.js +++ b/test/apps/tree-shaking/app.js @@ -1,6 +1,6 @@ /* eslint-disable no-var, max-statements */ import {glsl} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; // eslint-disable-next-line import {AnimationLoop, Cube} from '@luma.gl/engine'; import {createTestContext} from '@luma.gl/test-utils'; diff --git a/test/dev-modules/babel-plugin-inline-gl-constants.spec.js b/test/dev-modules/babel-plugin-inline-gl-constants.spec.js index 7a4a8cdb3c..3b4d5c6a52 100644 --- a/test/dev-modules/babel-plugin-inline-gl-constants.spec.js +++ b/test/dev-modules/babel-plugin-inline-gl-constants.spec.js @@ -39,7 +39,7 @@ const TEST_CASES = [ { title: 'remove import', input: ` - import GL from '@luma.gl/constants'; + import {GL} from '@luma.gl/constants'; const x = GL.FLOAT; `, output: 'const x = 5126;' diff --git a/website/src/react-luma/components/device-info.tsx b/website/src/react-luma/components/device-info.tsx index e0d7ae2048..34967b9477 100644 --- a/website/src/react-luma/components/device-info.tsx +++ b/website/src/react-luma/components/device-info.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {Device, DeviceInfo, DeviceLimits, TextureFormat, cast} from '@luma.gl/api'; -import GL from '@luma.gl/constants'; +import {GL} from '@luma.gl/constants'; import {WebGLDevice} from '@luma.gl/webgl'; import {useStore} from '../store/device-store';