seasketch / geoprocessing

Serverless geoprocessing system
https://seasketch.github.io/geoprocessing
BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

Migrate gp library to pure ESM #122

Closed twelch closed 3 months ago

twelch commented 2 years ago

GP library is starting to hit issues with still using Common JS. Notably modern flatgeobuf node client module is a pure ESM module and using it in CJS environment have struggled to make it work, so we are pinned to an older version of flatgeobuf. But the flatgeobuf format seems to have had a breaking change, GDAL 3.5 and up produces flatgeobuf files that flatgeobuf node module v3.17.4 cannot read, produces a "Not a flatgeobuf file" error. The solution is downgrading to GDAL 3.2.2 or below.

We might be able to solve getting latest flatgeobuf node module to load and kick the can down the road, but the longer we stick with CJS, the greater the pain will be. The question is are all the gp dependencies esm-ready? Is Jest? Webpack? Storybook?

The crux things to solve for gp are:

Changes required

Requirements

Approach

Geoprocessing library:

GP project:

References

twelch commented 3 months ago

Resolved via #272