-
-
Notifications
You must be signed in to change notification settings - Fork 789
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 v4 #3052
Comments
I would like to suggest that we start showing a Leaflet-style "MapLibre" in source attribution by default starting with MapLibre GL JS v4. |
@wipfli I was thinking as an alternate to that is we could enable the maplibre logo by default. in the past we had discussed possibly doing that. Though adding to attribution instead might be less disruptive. |
I'm working on the code to reduce as much as possible the callback hell that currently exists. |
The relevant PR of most changes can be found here, it's mostly complete, there are a few things I want to improve in terms of docs, examples, etc, but nothing major ATM: After digging into this deeply as I have, I'm thinking that there might be a way to improve the CC: @AbelVM, @msbarry, @smellyshovel, @bdon. This is also an opportunity to add some other breaking changes, I'll look into issues and PRs to see if I find a mentioning of things that waited for a breaking changes version and add them here. |
To allow reverting back from arrow properties |
Can we take advantage of breaking changes to clean up this? maplibre/maplibre-style-spec#311 |
I think it's a good idea. Can you push this forward? |
Just to clarify: a breaking version of MapLibre GL JS means that some public APIs have breaking changes, but the style spec should not have breaking changes. So maplibre/maplibre-style-spec#311 can come also with a minor release of GL JS. |
This is a default value change basically, so it's also considered a breaking change, just like the attribution in this thread. |
I started with keeping the callback and only adding promises, but weird behavior in the code which I don't think is the right direction. loadTile(tile: Tile): Promise<void>;
abortTile?(tile: Tile): Promise<void>;
unloadTile?(tile: Tile): Promise<void>; original: loadTile(tile: Tile, callback: Callback): void;
abortTile?(tile: Tile, callback: Callback): void;
unloadTile?(tile: Tile, callback: Callback): void; Meaning, if you created a custom source and implemented the interface, you'll need to return a promise instead of using the callback (which wasn't really checked or used...). |
Most of the breaking change related to callback stuff are either merged or there's a PR open. |
@wipfli @acalcutt what would you prefer? The logo looks bigger on desktop: I like the logo only option. P.S. @birkskyum, can you help with the new logo, seems like we are using the old one still... |
I personally like the text link in the attribution more. Thanks for looking into this @HarelM! |
@acalcutt, any input here? |
@HarelM are you using a polyfill for |
The problem with async was not about polyfills or browser support, but about how angular and other frameworks can't use it in the worker thread due to some webpack or babel limitation. |
I think recommending users add a polyfill before maplibre loads on main thread is a fine workaround, but that won't work if it's needed in the worker before maplibre code loads. Will your PR #3459 let you import worker scripts before maplibre code loads? If so that might be sufficient? |
I believe that when you load the library (without creating a map) it will create the workers and it should be possible using the new API, I added it as a global API for that reason exactly, it's only a theory, I haven't tested it though... |
I had an interesting thought just now: |
Would that mean that in the future one would need to use a plugin for things like |
Any idea what the size reduction would be? I wouldn't mind this since for example onthegomap uses custom ui controls so users are downloading the built in ones for no reason (also box zoom handler, 3d terrain, heatmap layers, ...). But it's also an ease trade off of use for first time users that they can just depend on one library and get these common widgets with one line of code. Or are you thinking that new users would depend on a default package that includes the base one plus packages for the common widgets? |
I'll see how much it reduces, obviously if it's not significant, then the value of this is low. |
I love this idea!! The advantages are not only related to tree-shaking (which is a hard requirement in my org, due to LCP times) but also it might expose new public APIs for custom UI components (maybe based on Broadcast Channel API 🤔 )
|
In the Monthly meeting it was suggested to create two packages - core and components and a third package to bundle both of them. |
I've checked the difference between having the controls in the lib vs not having them in the lib (I simply deleted the relevant code). It's worth mentioning that I have create a POC for web components for maplibre-gl a while back, but I didn't see any traction. So, if someone would like to push this forward and create a "component library" for maplibre-gl-js I think we can use the next major version (5.x) to remove the controls and use this new library, or suggest it at least, but if there's no real push towards it, then it means this is not interesting enough. I think I made most of the breaking changes I wanted, and we can revisit another major version in 6-12 month. @acalcutt @wipfli I haven't received your feedback about the changes related to the logo/attribution, so if no feedback is provided I'll probably keep it the way it is now...? |
Regarding logo and attribution, I suggest:
Can you make a pull request for the attribution @HarelM ? |
I also need to move the full screen locale strings to the right place. |
OK, the last two PRs that are linked to this issue is what will be the content of 4.0. |
Any last suggestions before we release 4.0? Now is the time :-) |
Let's start tracking breaking changes for MapLibre GL JS v4 in the thread below.
The text was updated successfully, but these errors were encountered: