perf: drop redundant JSON.parse(JSON.stringify()) in recipe API
Every recipe list endpoint wrapped its result in `JSON.parse(JSON.stringify(...))` before handing it to `json()`, which then serialises again — a full extra stringify+parse cycle per response. `lean()` already returns plain objects and ObjectIds/Dates serialise correctly through `json()`'s single `JSON.stringify`, so the extra round trip was pure waste. Removed from the 9 output-side call sites (all_brief, category, category/[cat], tag, tag/[tag], icon, icon/[icon], in_season/[month], search, favorites/recipes, offline-db, translate/untranslated). Kept the two deep-clone-before-mutation usages in items/[name] and json-ld/[name] — those are load-bearing. Shuffle stays server-side: moving it to the client would need a hero preload + hydration rework that's bigger than a perf tweak.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "homepage",
|
||||
"version": "1.46.14",
|
||||
"version": "1.46.15",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user