Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes MapLibre GL JS v5 #3834

Open
14 of 16 tasks
sbachinin opened this issue Mar 13, 2024 · 15 comments
Open
14 of 16 tasks

Breaking changes MapLibre GL JS v5 #3834

sbachinin opened this issue Mar 13, 2024 · 15 comments

Comments

@sbachinin
Copy link
Collaborator

sbachinin commented Mar 13, 2024

This issue is to track breaking changes for MapLibre GL JS v5:

@sbachinin
Copy link
Collaborator Author

This is likely to produce breaking changes: #3736:

  • queryTerrainElevation should return meters above sea level. (Currently it returns a special offset used for positioning of custom 3d objects).
  • getElevationOffset method should be added. It should return the offset that is currently retrieved from queryTerrainElevation

@HarelM
Copy link
Collaborator

HarelM commented Mar 13, 2024

The following issue will also create breaking change to the output of geometry-type:

This issue has a part in the style-spec repo as well.

@wipfli
Copy link
Contributor

wipfli commented Mar 25, 2024

I am happy with breaking changes in the API of MapLibre GL JS, but we should not do breaking changes in the style spec, see maplibre/maplibre-style-spec#519 (comment). In my opinion, geometry-type should keep the same behavior as it did so far.

@HarelM
Copy link
Collaborator

HarelM commented Mar 25, 2024

I respect your opinion, but I don't agree in this specific case, see my comment in the link you sent. TL;DR: more in the area of bug fix and not a style spec change.

@birkskyum
Copy link
Member

birkskyum commented Mar 26, 2024

Depending on when this release is to come out ( looking at our majors, it's statistically likely to be +6 months from now ), it might be relevant to discuss a WebGL1 sunset again. We had some push back in the v3 release May 2023, but there are some indicators that it might be less problematic going forward, especially when looking at Apple ecosystems support.

There are examples of projects in our ecosystem that have moved to WebGL2-only support (looking at you deck.gl), and keeping WebGL1 support going forward will thus both not be compatible with said libraries, and more concerning it will be at the increasing high cost of locking the renderer to a legacy graphics pipeline.

Despite some users relying on it, MapLibre Native already did sunset OpenGL2 (~webgl1) in favor of OpenGL3+ (webgl2) to do the Modularization Refactor, which was crucial for the long-term viability of that renderer, and it would be necessary to do something similar here as well.

@HarelM
Copy link
Collaborator

HarelM commented Mar 26, 2024

Is there a way you can think of to allow moving the webgl1 code into a plugin somehow leaving the main version using only webgl2 but allowing this plugin to try and "help" in case someone needs webgl1?

@HarelM
Copy link
Collaborator

HarelM commented Mar 31, 2024

Another candidate for v5 breaking changes:

@wipfli
Copy link
Contributor

wipfli commented Apr 8, 2024

Let's discuss phasing out webgl1 in a separate thread here: #3947

@HarelM
Copy link
Collaborator

HarelM commented May 3, 2024

As part of this issue:

I found out that freeze elevation is not the default when doing easeTo when terrain is on.

I think it should be, so that it is consistent with pan movement.
This is a breaking change, so I'm writing it here.
The UX is worse if freeze elevation is on by default and the current fix seems to solve the issue well. No need for a breaking change.

@birkskyum
Copy link
Member

birkskyum commented May 8, 2024

v5 breaking change:

@birkskyum
Copy link
Member

birkskyum commented Jun 6, 2024

The arial font - I'd love to see it gone from the default, because it's always a problem to source it. Causing headache this moment that it's e.g. not present in openmaptiles/font

Related to:

@wipfli
Copy link
Contributor

wipfli commented Jun 6, 2024

I think we should have a discussion in the next monthly meeting how we want to handle breaking style changes. API changes are something different.

@birkskyum
Copy link
Member

birkskyum commented Aug 6, 2024

Is there a way you can think of to allow moving the webgl1 code into a plugin somehow leaving the main version using only webgl2 but allowing this plugin to try and "help" in case someone needs webgl1?

The only way I see that we can realistically keep webgl1 support is by abstraction:

A key difference is how uniforms are made:

individual uniforms uniform buffer objects (UBOs)
webgl1 x
webgl2 x x
webgpu x

So we'll be going through a transition like this, where webgl2 can be leveraged as a transition technology towards webgpu. In MapLibre Native, the opengl2(webgl1) was simply sunset to allow for this incremental migration, but it seems for GL JS that we'll need to keep webgl1 around, making the abstraction somewhat harder because there seems to be a significantly bigger distance from webgl1 <-> webgpu compared to refactored webgl2 w/ UBOs <-> webgpu. @zhangyiatmicrosoft do you have any idea what the usage numbers are for webgl1 now, compared to the numbers you presented a year ago here?

@HarelM
Copy link
Collaborator

HarelM commented Aug 6, 2024

It would also be interesting to see if we can both abstract and allow webgl1 to be moved outside the code base, allowing the code to be fully webgl2 or even abstract enough to require another package defining the GL itself - i.e. abstract and also separate to core, webgl1, webgl2, webgpu so that developer can choose which to support/include.

@HarelM
Copy link
Collaborator

HarelM commented Nov 20, 2024

We are nearing the end of the checklist of breaking changes.
I believe a non pre-release version is soon to come.
If you have any other breaking changes that you think we should consider, now will be the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants