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

Update to use ol ESM modules #530

Open
geferon opened this issue Dec 26, 2024 · 3 comments
Open

Update to use ol ESM modules #530

geferon opened this issue Dec 26, 2024 · 3 comments
Assignees

Comments

@geferon
Copy link

geferon commented Dec 26, 2024

OpenLayers got updated to ESM modules, and no longer exports everything as a base namespace that can be used for everything.
Even though you can work around this, with the inject functions and etc, it isn't ideal for types and just causes issues with TypeScript.
It would be nice if jsts got a respective update to support the newer versions of ol, as right now the only way of using it with TypeScript is adding skipLibCheck, which isn't nice imo.

@bjornharrtell
Copy link
Owner

Agreed, even though OpenLayers still offer a bundled script variant. I could probably do something similar as I have in https://github.com/flatgeobuf/flatgeobuf, i.e make ol an optional dependency and have the bundled version of jsts assume that modules exists as globals.

@bjornharrtell
Copy link
Owner

Started work on it at #531, considering dropping the single file bundle entirely and major version bump since this change is a breaking one anyway.

@geferon
Copy link
Author

geferon commented Jan 2, 2025

Perfect! Thank you so much!

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

2 participants