gl-matrix icon indicating copy to clipboard operation
gl-matrix copied to clipboard

breaking change in 3.4.4

Open birkskyum opened this issue 4 months ago • 4 comments

The CI of MapLibre GL JS appear to be breaking when dependabot try to upgrade form 3.4.3 -> 3.4.4

  • https://github.com/maplibre/maplibre-gl-js/pull/6234

I didn't expect this of a patch release

[!] (plugin typescript) RollupError: [plugin typescript] src/geo/projection/mercator_transform.test.ts (27:45): @rollup/plugin-typescript TS2339: Property 'values' does not exist on type 'mat2'.
  Property 'values' does not exist on type 'IndexedCollection'.
src/geo/projection/mercator_transform.test.ts (27:45)

27         expect([...transform.rotationMatrix.values()]).toEqual([0.9998477101325989, -0.017452405765652657, 0.017452405765652657, 0.9998477101325989]);

birkskyum avatar Aug 15 '25 06:08 birkskyum

Same here when trying to build MapLibre GL JS locally on this version. Downgrade to 3.4.3 resolves this issue for me

thurnbauermatthi avatar Aug 18 '25 12:08 thurnbauermatthi

I've just pushed a fix to solve the breaking changes. It's also worth mentioning that I needed to fix some numbers in tests due to precision changes (might be related to sqrt change as it seems like the only thing in the change log that can cause this). I would advise to push a version 4 to npm to indicate that this was a breaking change version for future users. Here's the change in the test that was needed in order to pass CI: https://github.com/maplibre/maplibre-gl-js/pull/6234/files#diff-9196ffbdbe9e16cf51ecf61b3bfed1ab9631b441b03396927fb074276d3d9268R305

HarelM avatar Aug 18 '25 18:08 HarelM

I would like to add that the IndexedCollection type is substantially worse than the previous typing (a number[] or Float32Array), because it cannot be passed directly to WebGL functions like uniformMatrix3fv.

valadaptive avatar Oct 11 '25 06:10 valadaptive

I can confirm that the newest version (3.4.4) is complete disaster in terms of types compared to previous 3.4.3: huge amount of code is not working. Newest TS versions show a lots of errors.

You cannot use anymore uniform* calls with values from vec3, mat4 etc, they all have same errors:

Argument of type 'vec3' is not assignable to parameter of type 'Float32List'.
  Type 'IndexedCollection' is not assignable to type 'Float32List'.
    Type 'IndexedCollection' is missing the following properties from type 'number[]': pop, push, concat, join, and 33 more.

we should remove IndexedCollection and put back everywhere Float32Array

@toji can we please move back a little with this?

psnet avatar Oct 30 '25 17:10 psnet