lonboard
lonboard copied to clipboard
import parquet-wasm from local bundle rather than CDN
Hi, is it possible to import parquet-wasm using esbuild rather than a CDN? I see that parquet-wasm is a dependency in the package.json
https://github.com/developmentseed/lonboard/blob/c8cf2e1862fa7cd84af196039b21a97a5f00fd8f/package.json#L5-L20
but lonboard is also referencing a CDN here:
https://github.com/developmentseed/lonboard/blob/c8cf2e1862fa7cd84af196039b21a97a5f00fd8f/src/parquet.ts#L2-L19
I ask because I'm trying to test out lonboard on a service that prevents me from making front-end requests to CDNs (I would have to request the URL be added to an allowlist, but I want to see if I can avoid this by bundling the code with esbuild but I was running into errors when I tried to use the bundled version - https://github.com/kylebarron/parquet-wasm/issues/488).
I agree, this change would be nice. But it's unclear to me how to get a reference to the local URL within Jupyter to the current bundle. I asked in the anywidget discord
Thanks @kylebarron, I was able to find a workaround that might be relevant here https://github.com/kylebarron/parquet-wasm/issues/488#issuecomment-2047904050
Trevor responded on discord that serializing the wasm on the model is probably the best approach
Until #461 gets merged, the easiest way (imho) is to let user specify a different cdn url (e.g. http://localhost:8888/files/). For now, we need to resort to modifying the js bundle.
What's your use case where you can't use the default CDN?
Offline or standalone usage
On Fri, Oct 11, 2024, 4:47 AM Kyle Barron @.***> wrote:
What's your use case where you can't use the default CDN?
— Reply to this email directly, view it on GitHub https://github.com/developmentseed/lonboard/issues/457#issuecomment-2406009923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFEBYWBHLNJEADOMVJ4X33Z23RWFAVCNFSM6AAAAABPXMRYFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBWGAYDSOJSGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>
But offline you won't be able to see the base map; does that not matter for you?
But offline you won't be able to see the base map; does that not matter for you?
Usually I have a copy of the tiles for performance/practical reasons - it is faster than getting over the internet, while in other cases I am generating them anyway. If BitmapTileLayer (which already works with locally hosted Jupyter file urls) can be expanded to support/include pmtiles it would be perfect (sounds like it is in the works with #494)