jpatokal / openflights

Website for storing flight information, rendering paths on a zoomable world map and calculating statistics, with plenty of free airline, airport and route data.
http://openflights.org
GNU Affero General Public License v3.0
1.39k stars 390 forks source link

Upgrade OpenLayers.js #1192

Open reedy opened 1 year ago

reedy commented 1 year ago

I'm under no illusion this will be easy/simple...

https://github.com/jpatokal/openflights/commit/99df5758b28b1b0c618eafc46d900a71fbacb5bd upgraded to 2.11 back in November 2011.

https://github.com/openlayers/openlayers/releases/tag/v7.3.0 was released in early March 2023 https://github.com/openlayers/openlayers/releases/tag/v7.4.0 was released in in early June 2023

May help with https://github.com/jpatokal/openflights/issues/916 maybe...

reedy commented 1 year ago

https://github.com/openlayers/openlayers/compare/release-2.11...v2.13.1 is a lot of changes..

chrisrosset commented 1 year ago

I'm under no illusion this will be easy/simple...

You weren't kidding... :(

I've done some work for this on the side to find any major roadblocks. I have the basic map display working. Here's the branch if anyone's interested: https://github.com/chrisrosset/openflights/tree/openlayers7

OpenLayers 2 (master)

openlayers-old

OpenLayers 7 pre-alpha

openlayers-new

Notice the dateline display issue is resolved. A lot functionality is missing still:

prototype.js-related breakage

I've noticed that the OpenLayers v7 attribution control is broken by prototype.js. I don't know why but that library sets up tons of stuff on core prototypes and is likely interfering with some standard JS functionality.

Unfortunately, we have a dependency chain which is not trivial to remove:

reedy commented 1 year ago

You've been busy!

At least we don't have jQuery to deal with too ;)

scriptaculous and scriptaculous don't seem overly active.. :/

Which means there's not really any updates in that chain that is going to really help

https://github.com/prototypejs/prototype/compare/1.7...1.7.3 which you've done already

It would be interesting if we could just replace that all wholesale... Would require finding something else of course

Maybe I'm being a bit too optimistic... But are there any of the changes you've made in that stack that we can apply to master of openflights as is?

chrisrosset commented 1 year ago

At least we don't have jQuery to deal with too ;)

I think jQuery might have been easier to deal with... ;)

It would be interesting if we could just replace that all wholesale... Would require finding something else of course

https://github.com/kraaden/autocomplete looks promising. It's small and doesn't have external dependencies. I'll have to investigate.

Maybe I'm being a bit too optimistic... But are there any of the changes you've made in that stack that we can apply to master of openflights as is?

The short answer is "unfortunately, no."

I've tried hard to limit changes to a in-place OL2 -> OL7 switch without any restructuring or other JS improvements for fear of this change becoming completely:

  1. unreviewable as it's large enough already and it's not even close to being done
  2. merge conflict hell for me as other changes happen on the main branch

I'm still hopeful about getting this done but I'm going to focus on some other stuff for now.

Most importantly, I'd like to switch the API serialization scheme to JSON. Perhaps you could take help review #1222?

reedy commented 1 year ago

So hopefully this is a little easier now (bar some rebase conflicts 😢 )...

chrisrosset commented 1 year ago

So hopefully this is a little easier now (bar some rebase conflicts cry )...

Definitely a huge step forward. I dread resolving the conflicts... I'll try to rebase the branch soon(-ish). OL7 is not my top priority - I think these changes might be easier if I made some other changes first.

Speaking of priorities, any chance we could coordinate some of these changes? I tried sending you an email a couple of days ago but maybe I ended up in your spam. I didn't want to open GH issues to ask you questions.