Commit Graph

21 Commits

Author SHA1 Message Date
Brandon Liu
cabe8a898a Abort requests [#608] (#625)
* Properly abort requests using AbortController

* add basic adapter tests

---------

Co-authored-by: Andrew Dassonville <dassonville.andrew@gmail.com>
2025-12-24 17:33:11 +08:00
Brandon Liu
4dc2daad8a CI: bump from node 18.x to 22.x [#606] (#614)
* CI: bump from node 18.x to 22.x [#606]

* update cloudflare wrangler version

* fix tests for node 22
2025-12-01 17:02:39 +08:00
Brandon Liu
5b075048cc js: cleanup error throwing to always use new Error (#504) 2024-12-13 14:42:13 +08:00
Brandon Liu
e678dd5326 Pmtiles js v4 (#499)
* pmtiles js v4: remove pmtiles spec v2 compatibility [#287]
* restructure ts files into src
* add tsup for building ESM/CJS and making types work in ESM
* bump fflate dependency
* update CHANGELOG for js 4.0.0
2024-11-26 11:56:41 +08:00
Brandon Liu
ce959e50b0 Chrome windows cache workaround (#454)
js 3.1.0

* Disable browser caching on chrome on windows [#442]
* work around for chromium issue: https://issues.chromium.org/issues/40542704
2024-09-19 23:26:09 +08:00
Brandon Liu
6f5479439b add getTileJson method to PMTiles class [#239, #247] (#453)
* add getTileJson method to PMTiles class [#239, #247]
* update docs related to FetchSource and headers [#397]
2024-09-18 15:57:14 +08:00
Brandon Liu
b229c1a8c7 Remove prefetch boolean from JS sources - no reason to ever not use i… (#353)
* Remove prefetch boolean from JS sources - no reason to ever not use it

* JS optimization for header fetches on etag invalidation [#90]

* If promises are shared between requests, only the first invalidation makes the header request.
* If promises are not shared, simply delete the key.

* JS 3.0.3 [#90]

* update CHANGELOG
2024-02-05 15:57:30 +08:00
Brandon Liu
179b1590b1 JS: ETags logic as part of Sources [#90] (#341)
* Simplifies ETag logic into Source, making if-match conditional requests possible.
* Avoid if-match in FetchSource for latency reasons - use cache buster on ETag change
* handle weak ETags correctly
* add mock fetch server for testing ETags [#90]
2024-01-31 23:00:24 +08:00
Brandon Liu
6638d040a5 linting and typing improvements [#287] (#337)
* Typing improvements [#287]

* rename FileApiSource to FileSource
* In a few cases we need to use any and biome-ignore. Deferring any restructuring here to js v4.
* replace prettier with biome
2024-01-31 12:22:25 +08:00
Brandon Liu
a6cbc1961e Continue linting fixes [#287] (#332)
* make use of ===, if branches, let/const, string templates, var names consistent style.
2024-01-29 17:41:12 +08:00
Brandon Liu
3b61cc8b49 apply automated linting fixes (#331) 2024-01-29 16:04:41 +08:00
Brandon Liu
802f6aea4e run prettier on js/test; add prettier check to CI 2023-03-12 13:30:57 +08:00
Brandon Liu
61a5076dc5 add edge case find_tile test [#117] 2023-01-30 03:41:13 +08:00
Brandon Liu
b23c98dd39 javascript: fix tile id overflow for z > 15 and error assertions in tests. 2022-12-22 21:56:03 +08:00
Brandon Liu
b8a78a7f6a js: avoid use of BigInt operations for older safari browsers [#103] 2022-12-10 18:36:04 +08:00
Brandon Liu
47d35484fc port tests to node 18 test module; remove zora dep 2022-11-22 20:38:14 +08:00
Brandon Liu
6a1af0f4ca simplify cache LRU logic; use count and not size 2022-11-21 19:29:34 +08:00
Brandon Liu
302eeab47e js client: show error when future spec version is read 2022-11-01 17:02:49 +08:00
Brandon Liu
afcd31b511 Fail gracefully when ETag mismatch happens more than once.
* Some HTTP servers will return 206 Partial Content with an ETag for the contents, not the entire resource.
* This change allows the client to continue with mismatched ETags if this case is detected.
2022-10-27 15:32:59 +08:00
Brandon Liu
7526a4b8b6 fix tests for spec magic number/compression changes 2022-10-05 10:46:19 +08:00
Brandon Liu
41b53c2c12 js library has better organization 2022-10-04 23:40:38 +08:00