From c82e042aa592e4e619d0c280b02486eeb859d358 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 7 Oct 2026 13:10:43 -0700 Subject: Profile links paint whole on the first frame: the server renders /npub1…, /nprofile1… and / with the kind 0, latest posts, follow counts and mentioned faces inlined (stale-while-refresh cache, 2 s budget), the app seeds its caches from it, and the big avatar never flashes punk art while a lookup runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A cold visit to a profile link showed a punk, '–' counts and no posts for 9 s. Server-side relay answers settle once events stop arriving (idle 400 ms) instead of waiting out a relay that never sends EOSE: a cold build is ~1.9 s. Co-Authored-By: Claude Opus 5.5 --- feed/note-page.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'feed/note-page.js') diff --git a/feed/note-page.js b/feed/note-page.js index f4dc08e..3145f14 100644 --- a/feed/note-page.js +++ b/feed/note-page.js @@ -117,9 +117,9 @@ export function createThreadCache({ build, now = Date.now }) { return { get, refresh }; } -const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c])); +export const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c])); // JSON inside a script tag: nothing in it may close the tag or open a comment -const scriptJson = (v) => JSON.stringify(v).replace(/ JSON.stringify(v).replace(/ e.pubkey === pk); -- cgit v1.2.3