Jon Staab
de5695339d
1. throttle (line 1146-1174)
...
Before: Used recursive setTimeout calls via unpause, creating nested closures and multiple timer contexts.
After:
- Tracks a single timeoutId to manage timer lifecycle
- Eliminates nested closure creation
- Cleaner timer chain when calls are pending
2. batch (line 1204-1227)
Before: Used throttle internally, inheriting its timer overhead.
After:
- Direct timer management without the throttle wrapper
- Single timeoutId tracked explicitly
- Maintains the same semantics (first item processed immediately, rest batched)
3. batcher (line 1235-1259)
Before:
- Created new timer every time queue went from empty to non-empty
- Had unnecessary async in forEach and await r when r was already type U
After:
- Tracks timeoutId to prevent duplicate timer creation
- Only creates timer when queue is truly empty
- Removed unnecessary async/await in result handling
- More efficient error handling (rejects all items at once if length mismatch)
Performance Benefits:
These changes should significantly reduce timer overhead by:
- Fewer timer objects: Only one active timer per throttled/batched function instead of chains
- Less garbage collection: Fewer closure allocations and intermediate objects
- Better memory usage: Explicit timer ID tracking instead of implicit state in closures
2025-11-14 15:29:03 -08:00
Jon Staab
24860c9a02
Add prepend util
2025-11-12 11:06:13 -08:00
Jon Staab
e582d46afd
Break down relay utils, replace removeNil with removeUndefined
2025-11-11 14:05:30 -08:00
Jon Staab
4c1c138329
Forget about null, use undefined
2025-11-06 12:10:24 -08:00
Jon Staab
8426febcdf
Memoize some stores, improve room support
2025-11-03 13:26:47 -08:00
Jon Staab
3132b8c59a
Make sorting/limit more resilient in repository
2025-10-28 13:23:25 -07:00
Jon Staab
a03a289e93
Improve relay tracking with thunks, add/rename some kinds
2025-10-24 06:41:56 -07:00
Jon Staab
247c7bafeb
Add wrap manager for tracking gift wraps
2025-10-20 14:19:44 -07:00
Jon Staab
543dbda64f
Make thunks an array instead of an object
2025-10-20 14:19:44 -07:00
Jon Staab
d4a6873ed5
Generalize some utils
2025-10-13 13:41:53 -07:00
Jon Staab
5c03ff3e29
Pass pubkey to nip 55 signer to avoid mixing up sessions
2025-10-13 11:20:01 -07:00
Jon Staab
0ada7d4b29
Optimize some utils
2025-10-03 10:11:07 -07:00
Jon Staab
599e6a5085
Add some type utils, findFeed, and fix feed listener to use limit: 0 instead of since
2025-09-09 16:20:21 -07:00
Jon Staab
3b99cb7d4c
Fix throttle function, add retryAuth
2025-09-03 17:31:19 -07:00
Jon Staab
00c0497892
Add anonymous session, re-work thunk utilities
2025-08-19 14:03:28 -07:00
Jon Staab
3b4fe0973d
Validate url in fetch, rework some hints
2025-08-05 17:26:18 -07:00
Jon Staab
24acae704d
Improve socket auth, outbox loading, some other things
2025-06-19 12:51:05 -07:00
Jon Staab
4cabf53c2f
Add docs for blossom, add nip 86 and 98 support
2025-06-10 13:18:03 -07:00
Jon Staab
d13ea745ff
Add blossom support
2025-06-06 16:35:46 -07:00
Jon Staab
bc65b96d46
Sort events in deriveEventsMapped, bump nostr-tools
2025-06-06 12:55:03 -07:00
Jon Staab
d2ba0f6642
Add bufferToHex, re-export some stuff from nostr-editor
2025-05-09 12:31:14 -07:00
Jon Staab
bfa2ac4f53
Remove nip46 broker getter, since websocket connections were getting closed and interrupting login flows
2025-05-07 13:50:48 -07:00
Jon Staab
f20eab929e
Remove app date functions
2025-04-30 14:14:03 -07:00
Jon Staab
b3e8d7a332
Tweak feed display
2025-04-25 17:17:18 -07:00
Jon Staab
4031564c6c
Add feed validation and display
2025-04-24 09:40:22 -07:00
Jon Staab
2996e25359
Split router out into its own library
2025-04-23 13:34:04 -07:00
Jon Staab
c5ea7edf6b
Rework storage adapters
2025-04-16 12:54:34 -07:00
Jon Staab
ded668890f
Fix docs/tests
2025-04-14 13:18:49 -07:00
Jon Staab
e54cb0a62d
re-work thunks
2025-04-14 13:10:20 -07:00
Jon Staab
859f7fa68f
Improve feed loader, wait for db before executing reads/updates, make taskQueue subscribable, add race, rename auth methods, fix failed wasm verify, fix localhost urls
2025-04-09 15:39:07 -07:00
Jon Staab
1bcc57d695
Add poll utility
2025-04-09 13:47:59 -07:00
Jon Staab
728ad1fba0
Lint
2025-04-09 11:58:29 -07:00
Jon Staab
8e585fc150
Delete readmes, update docs
2025-04-09 11:17:12 -07:00
Jon Staab
02202d298e
Tweak docs
2025-04-08 14:43:12 -07:00
Jon Staab
35f75bb38e
Get rid of typed emitter
2025-04-02 08:54:50 -07:00
Jon Staab
04816f8377
Get rid of Worker, use TaskQueue instead
2025-03-31 15:55:10 -07:00
Jon Staab
1524d128e3
Fix ts errors
2025-03-31 12:49:28 -07:00
Jon Staab
d7b74d2c7e
Minor net2 cleanup
2025-03-27 11:07:25 -07:00
Jon Staab
62f0caff1d
Add policy for deferring messages when auth has failed
2025-03-27 11:07:25 -07:00
Jon Staab
34e22eaa27
Add adapter to net2
2025-03-27 11:07:25 -07:00
Jon Staab
f00ffc5c9c
Add pool, flesh out auth
2025-03-27 11:07:25 -07:00
Jon Staab
7d0d303dae
Add task queue, work on socket
2025-03-27 11:07:25 -07:00
Ticruz
23f7244039
more tests
2025-02-28 15:06:05 -08:00
Ticruz
1bb83e556b
fix vitepress prod build
2025-02-26 11:37:42 +01:00
Ticruz
8a2b62f693
Add tests
2025-02-25 14:34:49 -08:00
Jon Staab
eb354b4330
Bump versions
2025-02-10 16:35:58 -08:00
Jon Staab
cd0494659b
Fix min
2025-02-07 17:05:52 -08:00
Jon Staab
63cfebe673
Add enumerate util
2025-02-04 20:03:52 -08:00
Jon Staab
e412109852
Add handler removers to worker
2025-02-04 14:16:07 -08:00
Jon Staab
369a89dc60
Add abortThunk, bump versions
2025-01-29 10:08:58 -08:00