Skip to content

Conversation

@kylebarron
Copy link
Member

Allows esbuild to consume these as text with

esbuild.build({
  ...,
  loader: {
    ".worker.js": "text",
    ".worker.min.js": "text",
  },
});

@kylebarron kylebarron merged commit 21f7eb1 into main Oct 27, 2025
1 check passed
@kylebarron kylebarron deleted the kyle/worker-build-improvements branch October 27, 2025 23:06
kylebarron added a commit to developmentseed/lonboard that referenced this pull request Oct 27, 2025
### Change list

- Define an earcut worker pool once in global scope, and reuse it for
any polygon layers
- This should (significantly?) improve perf for any polygonal layers
(though not the h3 layer)
- Load the worker source as _text_ from the version in `node_modules`.
(`earcut.worker.min.js` is 15KB, and much easier to not have it be
async). This means we don't need any async step, nor do we need to keep
the worker source version in sync with our `geoarrow-js` version in
`package.json`

Depends on geoarrow/geoarrow-js#39

Closes #909
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

Successfully merging this pull request may close these issues.

2 participants