@farm.js/core 0.1.80 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-BPa5n0ld.d.ts → agent-mcp.d-C2Su3x4D.d.ts} +1 -1
- package/dist/{agent-mcp.d-DOP95Jxm.d.mts → agent-mcp.d-Yak-LqRd.d.mts} +1 -1
- package/dist/agent-runtime.cjs +4 -3
- package/dist/agent-runtime.d.mts +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/agent-runtime.mjs +3 -2
- package/dist/analyzer-LV23T6QN.cjs +17 -0
- package/dist/{analyzer-F7CWE5VA.mjs → analyzer-RPU2KG4J.mjs} +3 -2
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.mjs +1 -1
- package/dist/api/client.native.cjs +1 -1
- package/dist/api/client.native.mjs +1 -1
- package/dist/api/node.cjs +6 -5
- package/dist/api/node.d.mts +4 -3
- package/dist/api/node.d.ts +4 -3
- package/dist/api/node.mjs +5 -4
- package/dist/api/route-manager.cjs +7 -6
- package/dist/api/route-manager.d.mts +4 -3
- package/dist/api/route-manager.d.ts +4 -3
- package/dist/api/route-manager.mjs +6 -5
- package/dist/api/runtime.cjs +5 -4
- package/dist/api/runtime.d.mts +3 -2
- package/dist/api/runtime.d.ts +3 -2
- package/dist/api/runtime.mjs +4 -3
- package/dist/api.cjs +9 -8
- package/dist/api.d.mts +5 -4
- package/dist/api.d.ts +5 -4
- package/dist/api.mjs +8 -7
- package/dist/{app-manifest.d-9UD6BznX.d.mts → app-manifest.d-BcyOFMrg.d.mts} +1 -1
- package/dist/{app-manifest.d-CO6Iu0Hx.d.ts → app-manifest.d-DZyXaICz.d.ts} +1 -1
- package/dist/app-markdown.cjs +3 -3
- package/dist/app-markdown.d.mts +5 -4
- package/dist/app-markdown.d.ts +5 -4
- package/dist/app-markdown.mjs +2 -2
- package/dist/{app.d-DXeRWZK7.d.mts → app.d-C0ePpuaG.d.mts} +30 -4
- package/dist/{app.d-DwX1ePhs.d.ts → app.d-CIoXsAbN.d.ts} +30 -4
- package/dist/{chunk-Q4TRGTO7.cjs → chunk-26WP75W5.cjs} +32 -16
- package/dist/{chunk-7KDCVSTR.mjs → chunk-2PFGA6PB.mjs} +2 -2
- package/dist/chunk-2UYYXSUS.mjs +401 -0
- package/dist/{chunk-PL7MCYYD.mjs → chunk-3AV4DCXY.mjs} +58 -358
- package/dist/{chunk-3GNHJ3RN.cjs → chunk-3BTN3NP7.cjs} +2 -2
- package/dist/chunk-3DE6RK7K.cjs +36 -0
- package/dist/{chunk-GBW5DU7V.mjs → chunk-47I2MYIR.mjs} +487 -304
- package/dist/{chunk-RQBGHHOQ.mjs → chunk-4X7LSGM6.mjs} +1 -1
- package/dist/{chunk-QMR2TUVZ.cjs → chunk-52Q4OB4A.cjs} +4 -4
- package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
- package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
- package/dist/chunk-5MMKNW7Q.cjs +54 -0
- package/dist/{chunk-AXA2BSX3.cjs → chunk-5MUFW5UU.cjs} +22 -21
- package/dist/{chunk-MQOHYV6L.cjs → chunk-5P65LXGU.cjs} +11 -11
- package/dist/{chunk-KEU55O2D.mjs → chunk-63ZE6B6M.mjs} +7 -6
- package/dist/{chunk-TS3ZHJN5.cjs → chunk-6BPFIYGY.cjs} +3 -3
- package/dist/{chunk-NJ4OASLP.mjs → chunk-6QYPP5KC.mjs} +2 -2
- package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
- package/dist/{chunk-G4SZC2WH.cjs → chunk-AIPZDBP6.cjs} +557 -374
- package/dist/{chunk-X4TSMQWF.cjs → chunk-ARORZ3MH.cjs} +548 -397
- package/dist/{chunk-K3XKEZR6.mjs → chunk-AUFEM3FB.mjs} +1 -1
- package/dist/{chunk-MGKWYPE3.mjs → chunk-AYDVUCXD.mjs} +1 -0
- package/dist/{chunk-5OAN7BG5.cjs → chunk-B2PGVHBG.cjs} +4 -4
- package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
- package/dist/chunk-B7L24VPX.cjs +401 -0
- package/dist/{chunk-5VDJEKGK.cjs → chunk-BBVLOEND.cjs} +1 -1
- package/dist/{chunk-XF7MJSUS.mjs → chunk-BCQIXH7L.mjs} +1 -1
- package/dist/{chunk-67MZTLTF.cjs → chunk-BCTHOQPP.cjs} +37 -9
- package/dist/{chunk-GBESKA76.cjs → chunk-BSX5OGSD.cjs} +1 -1
- package/dist/{chunk-CNDBLUKI.mjs → chunk-BVJUFVCU.mjs} +1 -1
- package/dist/{chunk-QHAISITM.mjs → chunk-C3VCYOU4.mjs} +1 -1
- package/dist/chunk-C5QHZ626.cjs +85 -0
- package/dist/{chunk-3K2E55BJ.mjs → chunk-CA2HBLXP.mjs} +13 -3
- package/dist/{chunk-ANZLZNNX.cjs → chunk-CD5Z7RR5.cjs} +155 -20
- package/dist/{chunk-4MIDUSIX.mjs → chunk-CJDBTTLB.mjs} +17 -17
- package/dist/{chunk-RLCOWWE5.cjs → chunk-CN2JOTRO.cjs} +7 -7
- package/dist/chunk-D2VAANBS.mjs +48 -0
- package/dist/{chunk-XZBBKZGW.mjs → chunk-DAXU2NBE.mjs} +128 -41
- package/dist/{chunk-4H4ZXUNB.cjs → chunk-DJ3PVHTW.cjs} +3 -3
- package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
- package/dist/{chunk-ZVSQN7NC.cjs → chunk-DRO3NXA3.cjs} +40 -43
- package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
- package/dist/{chunk-Q4YEAWUK.mjs → chunk-ECVSRE4Y.mjs} +3 -2
- package/dist/{chunk-MDEFTF63.mjs → chunk-EL2Z6YFZ.mjs} +25 -28
- package/dist/chunk-EZYKV24V.mjs +385 -0
- package/dist/{chunk-TVCFY3KK.cjs → chunk-FB4CWSC2.cjs} +12 -12
- package/dist/{chunk-IYFBLWXU.cjs → chunk-FULX5RYX.cjs} +61 -361
- package/dist/{chunk-V73Y4UBL.mjs → chunk-GXLNARPO.mjs} +151 -16
- package/dist/{chunk-ZPEZXQTM.cjs → chunk-HHQEKLZL.cjs} +2 -2
- package/dist/{chunk-HNUBRUFQ.cjs → chunk-HQEYZSF3.cjs} +4 -3
- package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
- package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
- package/dist/{chunk-44G4XHEL.mjs → chunk-I4DR3HCH.mjs} +11 -11
- package/dist/chunk-I4WZRG73.mjs +54 -0
- package/dist/{chunk-MUZHULW2.mjs → chunk-ICOJ2BC6.mjs} +23 -7
- package/dist/{chunk-MNIR7I7B.mjs → chunk-INKVDO42.mjs} +1 -1
- package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
- package/dist/{chunk-HEDGTXXB.cjs → chunk-JB4BHRFK.cjs} +17 -17
- package/dist/{chunk-XKUKWMGX.cjs → chunk-JCYDWJVO.cjs} +3 -3
- package/dist/{chunk-CCMP4JD2.cjs → chunk-JK26IMT7.cjs} +1 -1
- package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
- package/dist/{chunk-SVCUSOEF.mjs → chunk-KR5DF7WK.mjs} +1 -1
- package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
- package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
- package/dist/{chunk-LVGB5PYK.cjs → chunk-LM2ZDNDD.cjs} +28 -28
- package/dist/{chunk-COTFX4GT.mjs → chunk-LTOT5KVJ.mjs} +1 -1
- package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
- package/dist/{chunk-DVHFIETW.cjs → chunk-N2EFMN2K.cjs} +18 -18
- package/dist/{chunk-MZ5QGWRW.mjs → chunk-N3VMHPIY.mjs} +2 -2
- package/dist/{chunk-KKVRWNDH.mjs → chunk-NAHDG6UX.mjs} +4 -4
- package/dist/{chunk-UWOCYINY.cjs → chunk-NEKO3HM2.cjs} +12 -2
- package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
- package/dist/{chunk-ZDYYZX73.mjs → chunk-NRCKBDYP.mjs} +266 -115
- package/dist/{chunk-EG5YBYHO.mjs → chunk-OMB7UGVW.mjs} +1 -1
- package/dist/{chunk-JGEN2FIT.mjs → chunk-OP5VI4TP.mjs} +1 -1
- package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
- package/dist/{chunk-3XTRT3MB.mjs → chunk-PO5MZIWK.mjs} +1 -1
- package/dist/{chunk-ASYOWPSR.cjs → chunk-PWDBWXQI.cjs} +2 -1
- package/dist/{chunk-WJ2O2MPP.cjs → chunk-Q2VOT3K2.cjs} +494 -407
- package/dist/{chunk-7YLDUB4R.cjs → chunk-QCKSYYXK.cjs} +7 -7
- package/dist/{chunk-57QAQU4F.mjs → chunk-QRNYSISP.mjs} +1 -1
- package/dist/{chunk-3JQBQG7K.mjs → chunk-QSMUMK7Y.mjs} +2 -2
- package/dist/{chunk-PRL7FXG4.cjs → chunk-RDNKQ5MK.cjs} +12 -13
- package/dist/{chunk-GCRT6GJG.mjs → chunk-RMLR5RMH.mjs} +30 -2
- package/dist/{chunk-XY5OZQF6.cjs → chunk-RMPUEH5T.cjs} +2 -2
- package/dist/{chunk-7DD5TNPS.cjs → chunk-S7WZUK3B.cjs} +2 -2
- package/dist/{chunk-EGHPFXPZ.cjs → chunk-SAPG45RA.cjs} +23 -23
- package/dist/{chunk-Z4SMFUZ7.cjs → chunk-U54REWMJ.cjs} +23 -23
- package/dist/chunk-U6XYBTUT.mjs +36 -0
- package/dist/chunk-UDMBUTJD.mjs +85 -0
- package/dist/{chunk-WHEQJN4G.cjs → chunk-UGD53SNO.cjs} +2 -2
- package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
- package/dist/{chunk-SDICLSQU.cjs → chunk-VMBIKDKW.cjs} +10 -10
- package/dist/{chunk-WBPVLCNE.mjs → chunk-VPGEYX5Y.mjs} +4 -4
- package/dist/chunk-VS7HLH4S.cjs +385 -0
- package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
- package/dist/chunk-WMRGIQTA.cjs +48 -0
- package/dist/{chunk-52LTENRE.cjs → chunk-WOAXQ5MZ.cjs} +9 -9
- package/dist/{chunk-C6HGUTXB.mjs → chunk-XBSIGZ4J.mjs} +2 -3
- package/dist/{chunk-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
- package/dist/{chunk-2RRTOKRZ.mjs → chunk-YHM4PXJY.mjs} +1 -1
- package/dist/{chunk-A5D3UMLJ.mjs → chunk-YSU3WCW6.mjs} +1 -1
- package/dist/{chunk-4STJ6LGR.mjs → chunk-Z3RM3VA2.mjs} +1 -1
- package/dist/{chunk-YN3YMSKD.mjs → chunk-ZIZRIZLP.mjs} +3 -3
- package/dist/{cli-runtime.d-DPNTN-JV.d.mts → cli-runtime.d-Hnvvadz7.d.mts} +5 -5
- package/dist/{cli-runtime.d-8BhZy_wr.d.ts → cli-runtime.d-I0MphTbc.d.ts} +5 -5
- package/dist/{client-component.d-CkDcob6D.d.ts → client-component.d-5QEvtJsg.d.ts} +1 -1
- package/dist/{client-component.d-CMCdyAr8.d.mts → client-component.d-DapRqtSC.d.mts} +1 -1
- package/dist/{client-plugins.d-WcMwOZGZ.d.mts → client-plugins.d-C1WM3ieD.d.mts} +7 -13
- package/dist/{client-plugins.d-BYIovYqX.d.ts → client-plugins.d-DcmDzcSC.d.ts} +7 -13
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +9 -8
- package/dist/client.d.mts +20 -151
- package/dist/client.d.ts +20 -151
- package/dist/client.mjs +8 -7
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/desktop.d.mts +3 -2
- package/dist/desktop.d.ts +3 -2
- package/dist/{devtools-JJOYTIMS.cjs → devtools-5B7NZE6F.cjs} +15 -14
- package/dist/{devtools-F3FDFV26.mjs → devtools-C5GXZZ7E.mjs} +12 -11
- package/dist/docs.cjs +14 -13
- package/dist/docs.d.mts +4 -3
- package/dist/docs.d.ts +4 -3
- package/dist/docs.mjs +13 -12
- package/dist/environment/vite.cjs +7 -6
- package/dist/environment/vite.mjs +6 -5
- package/dist/{handler.d-s3IM6pbJ.d.mts → handler.d-B8bPCBzl.d.mts} +1 -1
- package/dist/{handler.d-BwdOyc9x.d.ts → handler.d-Cliwo6Nu.d.ts} +1 -1
- package/dist/{headers.d-BR-OXrqQ.d.mts → headers.d-CVwSpSGX.d.mts} +1 -1
- package/dist/{headers.d-CAW4wPey.d.ts → headers.d-C_btqjV6.d.ts} +1 -1
- package/dist/index.cjs +68 -65
- package/dist/{index.d-BEVK61zS.d.mts → index.d-DFuMZk9-.d.mts} +1 -1
- package/dist/{index.d-ah2c89Wu.d.ts → index.d-hOEbMcLk.d.ts} +1 -1
- package/dist/index.d.mts +25 -23
- package/dist/index.d.ts +25 -23
- package/dist/index.mjs +72 -69
- package/dist/instrumentation.cjs +3 -3
- package/dist/instrumentation.mjs +2 -2
- package/dist/integrations/orm.d.mts +2 -1
- package/dist/integrations/orm.d.ts +2 -1
- package/dist/integrations.cjs +4 -3
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/integrations.mjs +3 -2
- package/dist/internal/app-markdown-runtime.cjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +12 -5
- package/dist/internal/app-markdown-runtime.d.ts +12 -5
- package/dist/internal/app-markdown-runtime.mjs +1 -1
- package/dist/internal/build-runtime.cjs +49 -47
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +48 -46
- package/dist/internal/cli-runtime.cjs +25 -24
- package/dist/internal/cli-runtime.d.mts +8 -7
- package/dist/internal/cli-runtime.d.ts +8 -7
- package/dist/internal/cli-runtime.mjs +26 -25
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +76 -15
- package/dist/internal/client-runtime.d.mts +18 -7
- package/dist/internal/client-runtime.d.ts +18 -7
- package/dist/internal/client-runtime.mjs +67 -6
- package/dist/internal/compression-runtime.d.mts +2 -1
- package/dist/internal/compression-runtime.d.ts +2 -1
- package/dist/internal/config-runtime.cjs +14 -13
- package/dist/internal/config-runtime.d.mts +4 -3
- package/dist/internal/config-runtime.d.ts +4 -3
- package/dist/internal/config-runtime.mjs +13 -12
- package/dist/internal/docs-precompiled-runtime.cjs +1 -1
- package/dist/internal/docs-precompiled-runtime.mjs +1 -1
- package/dist/internal/form-actions.cjs +3 -3
- package/dist/internal/form-actions.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +9 -7
- package/dist/internal/infra-analytics-runtime.d.mts +8 -2
- package/dist/internal/infra-analytics-runtime.d.ts +8 -2
- package/dist/internal/infra-analytics-runtime.mjs +9 -7
- package/dist/internal/island-codec.cjs +3 -3
- package/dist/internal/island-codec.mjs +2 -2
- package/dist/internal/island-value-store.d.mts +1 -1
- package/dist/internal/island-value-store.d.ts +1 -1
- package/dist/internal/islands-boot.cjs +63 -23
- package/dist/internal/islands-boot.d.mts +5 -3
- package/dist/internal/islands-boot.d.ts +5 -3
- package/dist/internal/islands-boot.mjs +58 -18
- package/dist/internal/islands-runtime.cjs +10 -56
- package/dist/internal/islands-runtime.mjs +6 -52
- package/dist/internal/islands-server.cjs +4 -4
- package/dist/internal/islands-server.mjs +3 -3
- package/dist/internal/islx-actions-client.cjs +36 -0
- package/dist/internal/islx-actions-client.d.mts +13 -0
- package/dist/internal/islx-actions-client.d.ts +13 -0
- package/dist/internal/islx-actions-client.mjs +36 -0
- package/dist/internal/islx-actions-server.cjs +8 -0
- package/dist/internal/islx-actions-server.d.mts +6 -0
- package/dist/internal/islx-actions-server.d.ts +6 -0
- package/dist/internal/islx-actions-server.mjs +8 -0
- package/dist/internal/islx-client.d.mts +0 -4
- package/dist/internal/islx-client.d.ts +0 -4
- package/dist/internal/isolated-boundary.cjs +3 -3
- package/dist/internal/isolated-boundary.d.mts +1 -1
- package/dist/internal/isolated-boundary.d.ts +1 -1
- package/dist/internal/isolated-boundary.mjs +2 -2
- package/dist/internal/metadata-image-runtime.cjs +4 -2
- package/dist/internal/metadata-image-runtime.d.mts +18 -2
- package/dist/internal/metadata-image-runtime.d.ts +18 -2
- package/dist/internal/metadata-image-runtime.mjs +5 -3
- package/dist/internal/native-server-fns.cjs +5 -4
- package/dist/internal/native-server-fns.mjs +4 -3
- package/dist/internal/navigation-neutral.cjs +36 -0
- package/dist/internal/navigation-neutral.d.mts +14 -0
- package/dist/internal/navigation-neutral.d.ts +14 -0
- package/dist/internal/navigation-neutral.mjs +36 -0
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +30 -25
- package/dist/internal/production-runtime.d.mts +14 -11
- package/dist/internal/production-runtime.d.ts +14 -11
- package/dist/internal/production-runtime.mjs +35 -30
- package/dist/internal/server-tree.cjs +5 -4
- package/dist/internal/server-tree.d.mts +3 -4
- package/dist/internal/server-tree.d.ts +3 -4
- package/dist/internal/server-tree.mjs +4 -3
- package/dist/internal/spa-router.cjs +3 -3
- package/dist/internal/spa-router.d.mts +4 -3
- package/dist/internal/spa-router.d.ts +4 -3
- package/dist/internal/spa-router.mjs +2 -2
- package/dist/internal/start-manifest.d.mts +2 -1
- package/dist/internal/start-manifest.d.ts +2 -1
- package/dist/internal/vercel-edge-middleware.cjs +1 -1
- package/dist/internal/vercel-edge-middleware.mjs +1 -1
- package/dist/island-value-protocol.d-fEoc1m8e.d.mts +27 -0
- package/dist/island-value-protocol.d-fEoc1m8e.d.ts +27 -0
- package/dist/{layers-5ZD4764G.mjs → layers-744BBUY5.mjs} +2 -2
- package/dist/layers-XLOMMQP7.cjs +21 -0
- package/dist/markdown.d.mts +2 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/middleware.cjs +5 -5
- package/dist/middleware.d.mts +2 -1
- package/dist/middleware.d.ts +2 -1
- package/dist/middleware.mjs +4 -4
- package/dist/{mount.d-DcoPFqv5.d.ts → mount.d-CAovYKfs.d.ts} +1 -1
- package/dist/{mount.d-Ylo-CmzK.d.mts → mount.d-DLeYxeRR.d.mts} +1 -1
- package/dist/{native-server-fn-handler-TNVFEQW3.cjs → native-server-fn-handler-57TCQPSM.cjs} +4 -4
- package/dist/{native-server-fn-handler-OXFTI6V5.mjs → native-server-fn-handler-PYK65A46.mjs} +3 -3
- package/dist/{navigation-delegate.d-2MK4YSlL.d.ts → navigation-delegate.d-BLM-8Q3Z.d.ts} +1 -1
- package/dist/{navigation-delegate.d-BA5h0fbE.d.mts → navigation-delegate.d-Chv93QS6.d.mts} +1 -1
- package/dist/navigation-errors.d-DwHtoMyR.d.mts +13 -0
- package/dist/navigation-errors.d-DwHtoMyR.d.ts +13 -0
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +7 -6
- package/dist/navigation.d.ts +7 -6
- package/dist/navigation.mjs +5 -5
- package/dist/{nitro-C3MYDX7V.mjs → nitro-FK3SZM4H.mjs} +2 -2
- package/dist/{nitro-6UOJXJZ6.cjs → nitro-YDFMH5PY.cjs} +6 -6
- package/dist/node-module-bundle-TNSY5PAC.cjs +15 -0
- package/dist/{node-module-bundle-XPLBMXRD.mjs → node-module-bundle-ZWCQJCKA.mjs} +3 -1
- package/dist/{plugin-LN3JBZRR.cjs → plugin-3PT7I26P.cjs} +2 -2
- package/dist/{plugin-33I3V42N.mjs → plugin-QOTAPTVV.mjs} +1 -1
- package/dist/plugin.cjs +41 -37
- package/dist/plugin.d.mts +6 -5
- package/dist/plugin.d.ts +6 -5
- package/dist/plugin.mjs +40 -36
- package/dist/query/client.cjs +10 -10
- package/dist/query/client.mjs +5 -5
- package/dist/{render-plan.d-2o-AG-ot.d.ts → render-plan.d-BSTjTH8h.d.ts} +1 -1
- package/dist/{render-plan.d-ChYBMhLu.d.mts → render-plan.d-CK5Lggyb.d.mts} +1 -1
- package/dist/renderer/none/server.cjs +5 -1
- package/dist/renderer/none/server.d.mts +3 -1
- package/dist/renderer/none/server.d.ts +3 -1
- package/dist/renderer/none/server.mjs +4 -0
- package/dist/renderer/react/server.cjs +6 -6
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +79 -17
- package/dist/renderer-client.d.mts +13 -97
- package/dist/renderer-client.d.ts +13 -97
- package/dist/renderer-client.mjs +69 -7
- package/dist/renderer.cjs +4 -2
- package/dist/renderer.d.mts +43 -5
- package/dist/renderer.d.ts +43 -5
- package/dist/renderer.mjs +3 -1
- package/dist/{request.d-RCnCBuWq.d.mts → request.d-BhggxQf3.d.mts} +1 -1
- package/dist/{request.d-CE0FIkiM.d.ts → request.d-CyJS9bjm.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/{route-rendering.d-BTPOM2nU.d.ts → route-rendering.d-BLPPmI5I.d.ts} +1 -1
- package/dist/{route-rendering.d-BZJnfKsp.d.mts → route-rendering.d-CUpG2mZJ.d.mts} +1 -1
- package/dist/{router.d-BU_WE6Ol.d.ts → router.d-0X2Ki6rf.d.ts} +1 -1
- package/dist/{router.d-D8Vvwl4i.d.mts → router.d-2NQM1Kgw.d.mts} +1 -1
- package/dist/routes.cjs +1 -1
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/routes.mjs +1 -1
- package/dist/{rsc-pipeline-A3R4U26C.cjs → rsc-pipeline-5AOF64FL.cjs} +19 -18
- package/dist/{rsc-pipeline-JZWVSHOR.mjs → rsc-pipeline-DNRLYOJ7.mjs} +18 -17
- package/dist/{runtime-SQFRHRGJ.mjs → runtime-EHG2FRXZ.mjs} +18 -17
- package/dist/{runtime-WZ3CHHGJ.cjs → runtime-ZVHG5SRB.cjs} +20 -19
- package/dist/{runtime.d-DJ6IIKcF.d.ts → runtime.d-CXuwkUgr.d.ts} +1 -1
- package/dist/{runtime.d-BnmuOXVD.d.mts → runtime.d-CaFXcu_Q.d.mts} +1 -1
- package/dist/server-action-security.cjs +1 -1
- package/dist/server-action-security.mjs +1 -1
- package/dist/{server-components-status.d-BeqSXcjM.d.ts → server-components-status.d-BdeFD8ZH.d.ts} +1 -1
- package/dist/{server-components-status.d-BzOg9M8g.d.mts → server-components-status.d-Cp7zvBm5.d.mts} +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +1 -1
- package/dist/server-plugins.d.mts +4 -3
- package/dist/server-plugins.d.ts +4 -3
- package/dist/server-plugins.mjs +1 -1
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +82 -71
- package/dist/server.d.mts +12 -11
- package/dist/server.d.ts +12 -11
- package/dist/server.mjs +61 -50
- package/dist/{spa-router.d-BOwuVkMl.d.ts → spa-router.d-Bjgl-Osi.d.ts} +3 -3
- package/dist/{spa-router.d-CDpftSsk.d.mts → spa-router.d-l3G38xHa.d.mts} +3 -3
- package/dist/{ssg.d-BTVqyq8T.d.ts → ssg.d-DDca17Lc.d.ts} +2 -2
- package/dist/{ssg.d-Bx_WFuwg.d.mts → ssg.d-RnlHOqUL.d.mts} +2 -2
- package/dist/store-core.d-BZjuC6Zc.d.mts +309 -0
- package/dist/store-core.d-BaOUOPf7.d.ts +309 -0
- package/dist/testing.cjs +7 -6
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/testing.mjs +6 -5
- package/dist/{utils.d-_dvevm5s.d.ts → utils.d-D8TWmpWo.d.ts} +1 -1
- package/dist/{utils.d-JkrpS-NJ.d.mts → utils.d-tdzw0_zQ.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +43 -37
- package/dist/vite.d.mts +18 -7
- package/dist/vite.d.ts +18 -7
- package/dist/vite.mjs +42 -36
- package/dist/workflows.cjs +2 -2
- package/dist/workflows.mjs +1 -1
- package/package.json +17 -2
- package/dist/analyzer-I7RBBQ65.cjs +0 -16
- package/dist/chunk-CQL5ZGFU.cjs +0 -50
- package/dist/chunk-HONTCUK6.mjs +0 -203
- package/dist/chunk-K6PGK7DC.cjs +0 -203
- package/dist/chunk-NBIVGHAT.mjs +0 -50
- package/dist/island-value-protocol.d-BRayRghM.d.mts +0 -12
- package/dist/island-value-protocol.d-BRayRghM.d.ts +0 -12
- package/dist/layers-HMEGUEXM.cjs +0 -21
- package/dist/node-module-bundle-M6BISE2P.cjs +0 -13
- package/dist/{chunk-EY7ED5UW.mjs → chunk-3RVLJTFZ.mjs} +3 -3
- package/dist/{chunk-UJPE75GF.mjs → chunk-J2VUPCCR.mjs} +3 -3
- package/dist/{chunk-PBJ7MEOV.cjs → chunk-OZUINP2P.cjs} +2 -2
- package/dist/{chunk-7FQFK3OA.mjs → chunk-V7HNYR76.mjs} +3 -3
- package/dist/{chunk-2FK47RRZ.cjs → chunk-VGHDPEPQ.cjs} +2 -2
- package/dist/{chunk-CGIVCGH5.cjs → chunk-XOFJUSWC.cjs} +2 -2
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveFarmAppClientEntry,
|
|
3
3
|
resolveFarmClientPlugins
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
resolveFarmPlatform
|
|
7
|
-
} from "./chunk-SMUW7UST.mjs";
|
|
4
|
+
} from "./chunk-MO4UTDQ6.mjs";
|
|
8
5
|
import {
|
|
9
6
|
collectSSGPages,
|
|
10
7
|
matchSSGPage,
|
|
11
8
|
resolveRouteRenderingConfigFromFile
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZIZRIZLP.mjs";
|
|
10
|
+
import {
|
|
11
|
+
findFarmAppPackageDir
|
|
12
|
+
} from "./chunk-YSU3WCW6.mjs";
|
|
13
|
+
import {
|
|
14
|
+
resolveFarmPlatform
|
|
15
|
+
} from "./chunk-SMUW7UST.mjs";
|
|
13
16
|
import {
|
|
14
17
|
appendFarmHead,
|
|
15
18
|
classifyFarmDocumentPrefix,
|
|
@@ -22,6 +25,7 @@ import {
|
|
|
22
25
|
createFarmThemeDocumentParts,
|
|
23
26
|
createLateNotFoundRecovery,
|
|
24
27
|
createLateRedirectRecovery,
|
|
28
|
+
createPreHydrationClickQueueScript,
|
|
25
29
|
createRouteDirectoryPattern,
|
|
26
30
|
extractFarmFullDocument,
|
|
27
31
|
farmDocsLayoutsWrapPage,
|
|
@@ -45,10 +49,15 @@ import {
|
|
|
45
49
|
stripRouteGroups,
|
|
46
50
|
takeFarmHoistedHead,
|
|
47
51
|
takeFarmNavigationOutlet
|
|
48
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-CA2HBLXP.mjs";
|
|
53
|
+
import {
|
|
54
|
+
getFarmFormState,
|
|
55
|
+
handleFarmFormActionRequest,
|
|
56
|
+
renderFarmFormStateScript
|
|
57
|
+
} from "./chunk-V7HNYR76.mjs";
|
|
49
58
|
import {
|
|
50
59
|
listFarmMCPLlmsTxtLinks
|
|
51
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-QSMUMK7Y.mjs";
|
|
52
61
|
import {
|
|
53
62
|
FARM_DEFAULT_MCP_PATH,
|
|
54
63
|
collectFarmDefaultMCPPages,
|
|
@@ -58,17 +67,13 @@ import {
|
|
|
58
67
|
resolveFarmDefaultMCPServer
|
|
59
68
|
} from "./chunk-HR4N2K4V.mjs";
|
|
60
69
|
import {
|
|
61
|
-
createFarmMetadataImageResponse
|
|
62
|
-
|
|
70
|
+
createFarmMetadataImageResponse,
|
|
71
|
+
resolveFarmMetadataImageValue
|
|
72
|
+
} from "./chunk-EZYKV24V.mjs";
|
|
63
73
|
import {
|
|
64
74
|
installFarmIslandValues,
|
|
65
75
|
uninstallFarmIslandValues
|
|
66
|
-
} from "./chunk-
|
|
67
|
-
import {
|
|
68
|
-
getFarmFormState,
|
|
69
|
-
handleFarmFormActionRequest,
|
|
70
|
-
renderFarmFormStateScript
|
|
71
|
-
} from "./chunk-7FQFK3OA.mjs";
|
|
76
|
+
} from "./chunk-2PFGA6PB.mjs";
|
|
72
77
|
import {
|
|
73
78
|
FarmSourceSnapshotStore,
|
|
74
79
|
collectFarmRenderedClientModules,
|
|
@@ -95,10 +100,7 @@ import {
|
|
|
95
100
|
traceFarmSourceReads,
|
|
96
101
|
usesFarmServerTree,
|
|
97
102
|
withFarmSourceSnapshot
|
|
98
|
-
} from "./chunk-
|
|
99
|
-
import {
|
|
100
|
-
FARM_ISLAND_REPLAYABLE_SELECTOR
|
|
101
|
-
} from "./chunk-S32PDOLO.mjs";
|
|
103
|
+
} from "./chunk-EL2Z6YFZ.mjs";
|
|
102
104
|
import {
|
|
103
105
|
_setDefaultFarmThemeConfig,
|
|
104
106
|
getTheme
|
|
@@ -122,7 +124,15 @@ import {
|
|
|
122
124
|
resolveFarmAgentCrawlers,
|
|
123
125
|
resolveFarmAgentSitemap,
|
|
124
126
|
resolveFarmPerformanceConfig
|
|
125
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-NQ3Y6E2T.mjs";
|
|
128
|
+
import {
|
|
129
|
+
createFarmCspNonce,
|
|
130
|
+
createFarmCspNonceRewriter,
|
|
131
|
+
filterFarmCspNonces,
|
|
132
|
+
getFarmSecurityHeader,
|
|
133
|
+
resolveFarmSecurityConfig,
|
|
134
|
+
stampFarmCspNonce
|
|
135
|
+
} from "./chunk-22W4FNTG.mjs";
|
|
126
136
|
import {
|
|
127
137
|
collectFarmLlmsTxtPages,
|
|
128
138
|
createFarmDefaultLlmsTxt,
|
|
@@ -133,18 +143,15 @@ import {
|
|
|
133
143
|
resolveFarmAgentOrigin,
|
|
134
144
|
resolveFarmLlmsTxtConfig
|
|
135
145
|
} from "./chunk-XGL42MQ7.mjs";
|
|
136
|
-
import {
|
|
137
|
-
createFarmCspNonce,
|
|
138
|
-
createFarmCspNonceRewriter,
|
|
139
|
-
filterFarmCspNonces,
|
|
140
|
-
getFarmSecurityHeader,
|
|
141
|
-
resolveFarmSecurityConfig,
|
|
142
|
-
stampFarmCspNonce
|
|
143
|
-
} from "./chunk-22W4FNTG.mjs";
|
|
144
146
|
import {
|
|
145
147
|
resolveFarmServerComponentsMode
|
|
146
148
|
} from "./chunk-4QENVMG7.mjs";
|
|
147
149
|
import {
|
|
150
|
+
getFarmAppDirectories,
|
|
151
|
+
getFarmSourceRoots
|
|
152
|
+
} from "./chunk-Z3RM3VA2.mjs";
|
|
153
|
+
import {
|
|
154
|
+
assertFarmRendererServerModule,
|
|
148
155
|
assertFarmRendererStreamingRuntime,
|
|
149
156
|
getFarmRendererCapabilities,
|
|
150
157
|
getFarmRendererComponentExtensions,
|
|
@@ -156,27 +163,23 @@ import {
|
|
|
156
163
|
resolveFarmRenderer,
|
|
157
164
|
resolveFarmRendererAppSetup,
|
|
158
165
|
resolveFarmRendererModule
|
|
159
|
-
} from "./chunk-
|
|
160
|
-
import {
|
|
161
|
-
getFarmAppDirectories,
|
|
162
|
-
getFarmSourceRoots
|
|
163
|
-
} from "./chunk-4STJ6LGR.mjs";
|
|
166
|
+
} from "./chunk-RMLR5RMH.mjs";
|
|
164
167
|
import {
|
|
165
168
|
resolveFarmImageConfig
|
|
166
169
|
} from "./chunk-AOIUYHPH.mjs";
|
|
167
170
|
import {
|
|
168
171
|
resolveCronConfig
|
|
169
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-7VJXYB6S.mjs";
|
|
170
173
|
import {
|
|
171
174
|
resolveServerActionsConfig
|
|
172
175
|
} from "./chunk-NLATR3T3.mjs";
|
|
173
176
|
import {
|
|
174
177
|
createFarmMarkdownRouteModuleFromFile,
|
|
175
178
|
loadFarmMdxComponents
|
|
176
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-ECVSRE4Y.mjs";
|
|
177
180
|
import {
|
|
178
181
|
isFarmMarkdownPageFile
|
|
179
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-ICOJ2BC6.mjs";
|
|
180
183
|
import {
|
|
181
184
|
resolveFarmMdxComponentsModulePath,
|
|
182
185
|
resolveMdxConfig
|
|
@@ -190,9 +193,12 @@ import {
|
|
|
190
193
|
getFarmMarkdownAlternatePath,
|
|
191
194
|
resolveMarkdownConfig
|
|
192
195
|
} from "./chunk-YU2MNIIY.mjs";
|
|
196
|
+
import {
|
|
197
|
+
isPackageSpecifier
|
|
198
|
+
} from "./chunk-AYDVUCXD.mjs";
|
|
193
199
|
import {
|
|
194
200
|
resolveWorkflowsConfig
|
|
195
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-LTOT5KVJ.mjs";
|
|
196
202
|
import {
|
|
197
203
|
resolveFarmThemeConfig
|
|
198
204
|
} from "./chunk-YWPNIYUP.mjs";
|
|
@@ -200,7 +206,7 @@ import {
|
|
|
200
206
|
getIntegrationProviders,
|
|
201
207
|
getRegisteredIntegrationAPIManifest,
|
|
202
208
|
isFarmIntegrationProviderComponentReference
|
|
203
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-XRSNW4IU.mjs";
|
|
204
210
|
import {
|
|
205
211
|
initStorage
|
|
206
212
|
} from "./chunk-QBJ6N5MT.mjs";
|
|
@@ -254,12 +260,12 @@ import {
|
|
|
254
260
|
import {
|
|
255
261
|
sendWebResponse
|
|
256
262
|
} from "./chunk-O5QUJEWT.mjs";
|
|
257
|
-
import {
|
|
258
|
-
loadFarmDevModule
|
|
259
|
-
} from "./chunk-7H2TXT2K.mjs";
|
|
260
263
|
import {
|
|
261
264
|
toFileModuleUrl
|
|
262
265
|
} from "./chunk-VHIXGZYH.mjs";
|
|
266
|
+
import {
|
|
267
|
+
loadFarmDevModule
|
|
268
|
+
} from "./chunk-7H2TXT2K.mjs";
|
|
263
269
|
import {
|
|
264
270
|
resolveFarmI18nConfig
|
|
265
271
|
} from "./chunk-VJSXPN3W.mjs";
|
|
@@ -298,13 +304,13 @@ import {
|
|
|
298
304
|
} from "./chunk-EILUVBKS.mjs";
|
|
299
305
|
import {
|
|
300
306
|
FARM_VERSION
|
|
301
|
-
} from "./chunk-
|
|
302
|
-
import {
|
|
303
|
-
_setFarmSearchPreserveRoutes
|
|
304
|
-
} from "./chunk-VDQZV6BX.mjs";
|
|
307
|
+
} from "./chunk-OP5VI4TP.mjs";
|
|
305
308
|
import {
|
|
306
309
|
normalizeFarmAPIConfig
|
|
307
310
|
} from "./chunk-W6QLRQ3V.mjs";
|
|
311
|
+
import {
|
|
312
|
+
_setFarmSearchPreserveRoutes
|
|
313
|
+
} from "./chunk-VDQZV6BX.mjs";
|
|
308
314
|
import {
|
|
309
315
|
getFarmPageDataRedirect
|
|
310
316
|
} from "./chunk-SD6JGJOM.mjs";
|
|
@@ -354,10 +360,6 @@ import {
|
|
|
354
360
|
getCurrentRequestOrNull,
|
|
355
361
|
resolveFarmRequestURL
|
|
356
362
|
} from "./chunk-FCAYYLAE.mjs";
|
|
357
|
-
import {
|
|
358
|
-
_peekCurrentRequest,
|
|
359
|
-
_resolveCurrentCspNonce
|
|
360
|
-
} from "./chunk-VIXTAVEA.mjs";
|
|
361
363
|
import {
|
|
362
364
|
getFarmRedirectError,
|
|
363
365
|
isFarmNotFoundError,
|
|
@@ -381,6 +383,10 @@ import {
|
|
|
381
383
|
compareRouteSpecificity,
|
|
382
384
|
getRoutePatternShape
|
|
383
385
|
} from "./chunk-5KAEGBIL.mjs";
|
|
386
|
+
import {
|
|
387
|
+
_peekCurrentRequest,
|
|
388
|
+
_resolveCurrentCspNonce
|
|
389
|
+
} from "./chunk-VIXTAVEA.mjs";
|
|
384
390
|
|
|
385
391
|
// src/static-metadata-image.ts
|
|
386
392
|
import { createHash } from "crypto";
|
|
@@ -1329,7 +1335,8 @@ var RouteManager = class _RouteManager {
|
|
|
1329
1335
|
root: this.config.root,
|
|
1330
1336
|
loadModule: viteServer ? (componentModulePath) => loadFarmDevModule(viteServer, componentModulePath) : void 0
|
|
1331
1337
|
}),
|
|
1332
|
-
config: mdxConfig
|
|
1338
|
+
config: mdxConfig,
|
|
1339
|
+
renderer: isReactRenderer(this.config.renderer) ? void 0 : this.rendererRuntime
|
|
1333
1340
|
});
|
|
1334
1341
|
}
|
|
1335
1342
|
if (this.viteServer) {
|
|
@@ -3162,6 +3169,21 @@ function resolveProviderModule(moduleId, root) {
|
|
|
3162
3169
|
return toViteModuleId(path5.resolve(root, moduleId), root);
|
|
3163
3170
|
}
|
|
3164
3171
|
|
|
3172
|
+
// src/server-actions-mode.ts
|
|
3173
|
+
function resolveFarmIslxActionsMode(config) {
|
|
3174
|
+
if (resolveFarmServerComponentsMode(config.experimental?.serverComponents) === "islands") {
|
|
3175
|
+
return "islands";
|
|
3176
|
+
}
|
|
3177
|
+
if (config.experimental?.serverActions !== true) return null;
|
|
3178
|
+
const renderer = config.renderer;
|
|
3179
|
+
if (renderer === void 0 || renderer === false) return null;
|
|
3180
|
+
if (isFarmRendererDisabled(renderer) || isReactRenderer(renderer)) return null;
|
|
3181
|
+
return "renderer";
|
|
3182
|
+
}
|
|
3183
|
+
function farmBrowserServerFnsEnabled(config) {
|
|
3184
|
+
return config.experimental?.serverActions === true && resolveFarmIslxActionsMode(config) !== null;
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3165
3187
|
// src/island-inference.ts
|
|
3166
3188
|
import fs3 from "fs";
|
|
3167
3189
|
import path6 from "path";
|
|
@@ -3839,6 +3861,53 @@ function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
|
3839
3861
|
}
|
|
3840
3862
|
|
|
3841
3863
|
// src/server/renderer.ts
|
|
3864
|
+
function pipeFarmRendererWebStream(runtime) {
|
|
3865
|
+
return (element, callbacks) => {
|
|
3866
|
+
let source;
|
|
3867
|
+
let destination;
|
|
3868
|
+
let aborted = false;
|
|
3869
|
+
let shellSettled = false;
|
|
3870
|
+
const settleShell = (error) => {
|
|
3871
|
+
if (shellSettled) return false;
|
|
3872
|
+
shellSettled = true;
|
|
3873
|
+
if (error === void 0) callbacks.onShellReady();
|
|
3874
|
+
else callbacks.onShellError(error);
|
|
3875
|
+
return true;
|
|
3876
|
+
};
|
|
3877
|
+
Promise.resolve().then(
|
|
3878
|
+
() => runtime.renderToReadableStream(element, {
|
|
3879
|
+
...callbacks.nonce ? { nonce: callbacks.nonce } : {},
|
|
3880
|
+
onError: callbacks.onError
|
|
3881
|
+
})
|
|
3882
|
+
).then(
|
|
3883
|
+
(stream) => {
|
|
3884
|
+
source = Readable.fromWeb(stream);
|
|
3885
|
+
if (aborted) {
|
|
3886
|
+
source.destroy();
|
|
3887
|
+
return;
|
|
3888
|
+
}
|
|
3889
|
+
source.once("readable", () => settleShell());
|
|
3890
|
+
source.once("error", (error) => {
|
|
3891
|
+
if (settleShell(error)) return;
|
|
3892
|
+
callbacks.onError(error);
|
|
3893
|
+
destination?.end();
|
|
3894
|
+
});
|
|
3895
|
+
},
|
|
3896
|
+
(error) => settleShell(error)
|
|
3897
|
+
);
|
|
3898
|
+
return {
|
|
3899
|
+
pipe(target) {
|
|
3900
|
+
destination = target;
|
|
3901
|
+
source?.pipe(target);
|
|
3902
|
+
},
|
|
3903
|
+
abort() {
|
|
3904
|
+
aborted = true;
|
|
3905
|
+
source?.destroy();
|
|
3906
|
+
destination?.end();
|
|
3907
|
+
}
|
|
3908
|
+
};
|
|
3909
|
+
};
|
|
3910
|
+
}
|
|
3842
3911
|
var islands;
|
|
3843
3912
|
function withFarmIslandsRenders(runtime, islandsRuntime) {
|
|
3844
3913
|
const wrap = (element) => islandsRuntime.withFarmIslandsRender(
|
|
@@ -3971,10 +4040,6 @@ var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
|
3971
4040
|
function createPPRRefreshScript() {
|
|
3972
4041
|
return `<script>(function(){if(window.__FARM_PPR_REFRESHING__)return;window.__FARM_PPR_REFRESHING__=true;var owner=document.currentScript;function applyState(doc){doc.querySelectorAll("script[data-farm-refresh-state]").forEach(function(source){var script=document.createElement("script");if(owner&&owner.nonce)script.nonce=owner.nonce;script.textContent=source.textContent||"";document.head.appendChild(script);script.remove();});}function key(node){return node.nodeType===1?node.getAttribute("id"):null}function compatible(current,next){if(current.nodeType!==next.nodeType)return false;if(current.nodeType===1&¤t.tagName!==next.tagName)return false;var currentKey=key(current);var nextKey=key(next);return currentKey||nextKey?currentKey===nextKey:true}function syncAttributes(current,next){Array.from(current.attributes).forEach(function(attribute){if(!next.hasAttribute(attribute.name))current.removeAttribute(attribute.name)});Array.from(next.attributes).forEach(function(attribute){if(current.getAttribute(attribute.name)!==attribute.value)current.setAttribute(attribute.name,attribute.value)})}function syncChildren(current,next){var cursor=current.firstChild;Array.from(next.childNodes).forEach(function(nextChild){if(cursor&&compatible(cursor,nextChild)){var matched=cursor;cursor=cursor.nextSibling;syncNode(matched,nextChild);return}var candidate=cursor;while(candidate&&!compatible(candidate,nextChild))candidate=candidate.nextSibling;if(candidate){current.insertBefore(candidate,cursor);syncNode(candidate,nextChild);return}current.insertBefore(nextChild.cloneNode(true),cursor)});while(cursor){var stale=cursor;cursor=cursor.nextSibling;stale.remove()}}function syncNode(current,next){if(current.nodeType===3||current.nodeType===8){if(current.nodeValue!==next.nodeValue)current.nodeValue=next.nodeValue;return}if(current.nodeType!==1)return;var tag=current.tagName;var value=tag==="INPUT"&¤t.type==="file"?null:"value" in current?current.value:null;var checked="checked" in current?current.checked:null;var selected=tag==="SELECT"?Array.from(current.options).map(function(option){return option.selected}):null;var focused=document.activeElement===current;var selection=focused&&typeof current.selectionStart==="number"?[current.selectionStart,current.selectionEnd,current.selectionDirection]:null;syncAttributes(current,next);syncChildren(current,next);if(value!==null)current.value=value;if(checked!==null)current.checked=checked;if(selected)Array.from(current.options).forEach(function(option,index){option.selected=selected[index]===true});if(selection)try{current.setSelectionRange(selection[0],selection[1],selection[2])}catch{}}function replaceRoot(html){var doc=new DOMParser().parseFromString(html,"text/html");var next=doc.getElementById("root");var current=document.getElementById("root");if(!next||!current)return false;applyState(doc);syncNode(current,next);return true}var attempts=0,settle;window.__FARM_PPR_REFRESH_PROMISE__=new Promise(function(resolve){settle=resolve;});function release(){window.__FARM_PPR_REFRESHING__=false;}function retry(){settle();if(window.__FARM_PPR_HYDRATING__||attempts>=${PPR_REFRESH_MAX_ATTEMPTS})return release();if(navigator.onLine===false){window.addEventListener("online",run,{once:true});return;}setTimeout(run,1000*Math.pow(2,attempts-1));}function run(){if(window.__FARM_PPR_HYDRATING__)return release();attempts++;fetch(window.location.href,{cache:"no-store",credentials:"same-origin",headers:{"x-farm-ppr-refresh":"1"}}).then(function(response){if(!response.ok)throw new Error("status "+response.status);return response.text();}).then(function(html){if(window.__FARM_PPR_HYDRATING__)return release();if(!replaceRoot(html))throw new Error("no root");settle();}).catch(retry);}run();})();</script>`;
|
|
3973
4042
|
}
|
|
3974
|
-
function createPreHydrationClickQueueScript() {
|
|
3975
|
-
const selector = JSON.stringify(FARM_ISLAND_REPLAYABLE_SELECTOR);
|
|
3976
|
-
return `<script>(function(){if(window.__FARM_PREHYDRATION_CLICK_QUEUE__)return;var queue=[];window.__FARM_PREHYDRATION_CLICK_QUEUE__=queue;window.__FARM_HYDRATED__=false;document.documentElement.dataset.farmHydrated="false";function isModified(event){return !!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function inHydrated(node){return !!(node&&node.closest&&node.closest('[data-farm-island-hydrated="true"]'))}function closestQueuedTarget(target){while(target&&target!==document.documentElement){if(target.matches&&target.matches(${selector}))return target;target=target.parentElement}return null}function announce(target,kind){document.dispatchEvent(new CustomEvent("farm:island-interaction",{detail:{target:target,kind:kind||null}}))}function submits(target,kind){return kind==="submit"||!!(target.form&&target.type==="submit")}function hold(event,target,kind){if(!(submits(target,kind)&&queue.some(function(item){return item.target===target}))){queue.push({target:target,kind:kind,createdAt:Date.now()});announce(target,kind)}event.preventDefault();event.stopImmediatePropagation()}document.addEventListener("click",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented||event.button!==0||isModified(event))return;var target=closestQueuedTarget(event.target);if(!target||target.closest&&target.closest("a[href]")||inHydrated(target))return;hold(event,target,"click")},true);document.addEventListener("submit",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented)return;var form=event.target;if(!form||form.nodeName!=="FORM"||inHydrated(form))return;hold(event,form,"submit")},true);function observe(event){if(window.__FARM_HYDRATED__)return;var target=event.target;if(!(target&&target.closest)||inHydrated(target))return;announce(target,null)}document.addEventListener("pointerdown",observe,true);document.addEventListener("focusin",observe,true);})();</script>`;
|
|
3977
|
-
}
|
|
3978
4043
|
function rendererRenderOptions() {
|
|
3979
4044
|
const nonce = _resolveCurrentCspNonce();
|
|
3980
4045
|
return nonce ? { nonce } : void 0;
|
|
@@ -4134,14 +4199,7 @@ var ServerRenderer = class {
|
|
|
4134
4199
|
)
|
|
4135
4200
|
).href);
|
|
4136
4201
|
const runtime = loaded;
|
|
4137
|
-
|
|
4138
|
-
for (const key of required) {
|
|
4139
|
-
if (typeof runtime[key] !== "function") {
|
|
4140
|
-
throw new Error(
|
|
4141
|
-
`Renderer \`${this.config.renderer.name}\` server module must export ${key}().`
|
|
4142
|
-
);
|
|
4143
|
-
}
|
|
4144
|
-
}
|
|
4202
|
+
assertFarmRendererServerModule(runtime, this.config.renderer);
|
|
4145
4203
|
assertFarmRendererStreamingRuntime(
|
|
4146
4204
|
this.config.renderer.name,
|
|
4147
4205
|
this.config.renderer,
|
|
@@ -4174,7 +4232,10 @@ var ServerRenderer = class {
|
|
|
4174
4232
|
this.appliedAppSetupModule = setupModule;
|
|
4175
4233
|
configureApp(setupModule.default);
|
|
4176
4234
|
}
|
|
4177
|
-
createPageBoundary(pageElement, options) {
|
|
4235
|
+
async createPageBoundary(pageElement, options) {
|
|
4236
|
+
if (options.pageShouldHydrate && !options.layoutShouldHydrate) {
|
|
4237
|
+
pageElement = await this.wrapIslandIntegrationProviders(pageElement);
|
|
4238
|
+
}
|
|
4178
4239
|
const boundary = this.rendererRuntime.createElement(
|
|
4179
4240
|
"div",
|
|
4180
4241
|
{
|
|
@@ -4189,6 +4250,15 @@ var ServerRenderer = class {
|
|
|
4189
4250
|
);
|
|
4190
4251
|
return options.pageShouldHydrate && !options.layoutShouldHydrate && this.reactRenderer ? this.reactRenderer.markPagePosition(boundary) : boundary;
|
|
4191
4252
|
}
|
|
4253
|
+
/**
|
|
4254
|
+
* The browser hydrates a page island or a route slot as its own root, inside the integration
|
|
4255
|
+
* providers, so the server renders the providers inside it too, or a provider that renders
|
|
4256
|
+
* markup (a Vue `<slot />` renders fragment markers) puts the root's HTML out of step. React
|
|
4257
|
+
* lines an island up with its tree position instead, and its providers render no markup.
|
|
4258
|
+
*/
|
|
4259
|
+
async wrapIslandIntegrationProviders(element) {
|
|
4260
|
+
return this.reactRenderer ? element : this.wrapWithIntegrationProviders(element);
|
|
4261
|
+
}
|
|
4192
4262
|
/// The app's `<srcDir>/app/globals.css`, linked only when it exists, as the
|
|
4193
4263
|
/// production build imports it only when it exists. An app without one gets
|
|
4194
4264
|
/// no stylesheet link rather than a failing request.
|
|
@@ -4364,6 +4434,19 @@ var ServerRenderer = class {
|
|
|
4364
4434
|
islandValues() {
|
|
4365
4435
|
return resolveFarmServerComponentsMode(this.config.experimental?.serverComponents) === "islands";
|
|
4366
4436
|
}
|
|
4437
|
+
/**
|
|
4438
|
+
* The page's element. Only React renders an async component, so for any other renderer Farm
|
|
4439
|
+
* awaits an async page itself and hands the renderer what it returned, as the production
|
|
4440
|
+
* server does. A `page.md` page is one: it compiles its Markdown on first render.
|
|
4441
|
+
*/
|
|
4442
|
+
async createPageElement(PageComponent, pageProps) {
|
|
4443
|
+
const runtime = this.rendererRuntime;
|
|
4444
|
+
if (isReactRenderer(this.config.renderer) || typeof PageComponent !== "function" || PageComponent.constructor?.name !== "AsyncFunction") {
|
|
4445
|
+
return runtime.createElement(PageComponent, pageProps);
|
|
4446
|
+
}
|
|
4447
|
+
const result = await PageComponent(pageProps);
|
|
4448
|
+
return runtime.isValidElement(result) ? result : runtime.createElement(runtime.Fragment, null, result);
|
|
4449
|
+
}
|
|
4367
4450
|
/**
|
|
4368
4451
|
* Render the route tree used by client navigation without producing a second
|
|
4369
4452
|
* document response. Layout markers let the browser preserve the longest
|
|
@@ -4375,7 +4458,7 @@ var ServerRenderer = class {
|
|
|
4375
4458
|
setFarmBasePath(this.config.basePath);
|
|
4376
4459
|
this.publishSearchPreserveRoutes();
|
|
4377
4460
|
setFarmTrailingSlashPreference(this.config.trailingSlash);
|
|
4378
|
-
let element = this.
|
|
4461
|
+
let element = await this.createPageElement(input.PageComponent, input.pageProps);
|
|
4379
4462
|
if (input.LoadingComponent) {
|
|
4380
4463
|
element = this.rendererRuntime.createElement(
|
|
4381
4464
|
this.rendererRuntime.Suspense,
|
|
@@ -4393,7 +4476,7 @@ var ServerRenderer = class {
|
|
|
4393
4476
|
} else if (input.layoutShouldHydrate && !input.pageShouldHydrate && this.rendererRuntime.isolateServerPageGraph) {
|
|
4394
4477
|
element = await this.isolateServerPage(element, input.serverTree === true);
|
|
4395
4478
|
}
|
|
4396
|
-
element = this.createPageBoundary(element, {
|
|
4479
|
+
element = await this.createPageBoundary(element, {
|
|
4397
4480
|
pageShouldHydrate: input.pageShouldHydrate,
|
|
4398
4481
|
layoutShouldHydrate: input.layoutShouldHydrate,
|
|
4399
4482
|
islandStrategy: input.islandStrategy
|
|
@@ -4418,7 +4501,11 @@ var ServerRenderer = class {
|
|
|
4418
4501
|
continue;
|
|
4419
4502
|
}
|
|
4420
4503
|
let slotElement = this.rendererRuntime.createElement(slot.module.default, slot.props);
|
|
4421
|
-
if (slot.shouldHydrate !== false)
|
|
4504
|
+
if (slot.shouldHydrate !== false) {
|
|
4505
|
+
slotElement = this.wrapClientGraph(
|
|
4506
|
+
await this.wrapIslandIntegrationProviders(slotElement)
|
|
4507
|
+
);
|
|
4508
|
+
}
|
|
4422
4509
|
slotProps[slot.name] = this.rendererRuntime.createElement(
|
|
4423
4510
|
"div",
|
|
4424
4511
|
{
|
|
@@ -4750,7 +4837,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4750
4837
|
searchParams: createFarmSearchParams({}),
|
|
4751
4838
|
path: page.urlPath
|
|
4752
4839
|
};
|
|
4753
|
-
let pageElement = this.
|
|
4840
|
+
let pageElement = await this.createPageElement(PageComponent, pageProps);
|
|
4754
4841
|
const pageMetadata = routeManifest.routes.find(
|
|
4755
4842
|
(entry) => entry.pattern === route?.pattern
|
|
4756
4843
|
) ?? {
|
|
@@ -4764,7 +4851,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4764
4851
|
}
|
|
4765
4852
|
);
|
|
4766
4853
|
const layoutShouldHydrate = layoutMetadata.some((metadata) => metadata.shouldHydrate);
|
|
4767
|
-
pageElement = this.createPageBoundary(pageElement, {
|
|
4854
|
+
pageElement = await this.createPageBoundary(pageElement, {
|
|
4768
4855
|
pageShouldHydrate: pageMetadata.shouldHydrate,
|
|
4769
4856
|
layoutShouldHydrate,
|
|
4770
4857
|
islandStrategy: pageMetadata.islandStrategy
|
|
@@ -4781,7 +4868,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4781
4868
|
if (pageMetadata.shouldHydrate && !layoutShouldHydrate && this.reactRenderer) {
|
|
4782
4869
|
pageElement = this.reactRenderer.markLayoutPosition(pageElement);
|
|
4783
4870
|
}
|
|
4784
|
-
const html = await this.
|
|
4871
|
+
const { html, head: rendererHead } = await this.renderElementToDocumentParts(
|
|
4785
4872
|
await this.wrapWithIntegrationProviders(pageElement)
|
|
4786
4873
|
);
|
|
4787
4874
|
const mergedMetadata = await this.resolveRouteMetadata({
|
|
@@ -4790,8 +4877,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4790
4877
|
pageProps,
|
|
4791
4878
|
pathname: page.urlPath
|
|
4792
4879
|
});
|
|
4793
|
-
const { title, tags, hasFavicon } = renderMetadataHead(mergedMetadata);
|
|
4794
|
-
const
|
|
4880
|
+
const { title, tags, hasFavicon, hasExplicitTitle } = renderMetadataHead(mergedMetadata);
|
|
4881
|
+
const titleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
4882
|
+
const metadataHead = `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}${titleTag}${tags}${rendererHead}`;
|
|
4795
4883
|
const fullDocument = this.createFullHTML(
|
|
4796
4884
|
html,
|
|
4797
4885
|
pageMetadata.shouldHydrate === true,
|
|
@@ -5031,7 +5119,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5031
5119
|
params
|
|
5032
5120
|
});
|
|
5033
5121
|
let actionRequest;
|
|
5034
|
-
if (req.method === "POST" &&
|
|
5122
|
+
if (req.method === "POST" && resolveFarmIslxActionsMode(this.config) !== null) {
|
|
5035
5123
|
await Promise.all([
|
|
5036
5124
|
this.routeManager.loadRouteModule(route.modulePath),
|
|
5037
5125
|
...layouts.map((layout) => this.routeManager.loadLayoutModule(layout.modulePath))
|
|
@@ -5207,13 +5295,6 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5207
5295
|
LoadingFallbackComponent = loadingModule.default;
|
|
5208
5296
|
}
|
|
5209
5297
|
}
|
|
5210
|
-
let ErrorFallbackComponent = null;
|
|
5211
|
-
if (errorBoundaryEntry) {
|
|
5212
|
-
const errorModule = await this.routeManager.loadRouteModule(errorBoundaryEntry.modulePath);
|
|
5213
|
-
if (errorModule.default) {
|
|
5214
|
-
ErrorFallbackComponent = errorModule.default;
|
|
5215
|
-
}
|
|
5216
|
-
}
|
|
5217
5298
|
const routeManifest = this.routeManager.generateClientManifest(this.config.root);
|
|
5218
5299
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5219
5300
|
(entry) => entry.pattern === route.pattern
|
|
@@ -5395,7 +5476,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5395
5476
|
await _runWithMiddlewareData(middlewareDataForContext, async () => {
|
|
5396
5477
|
await _runWithMiddlewareContext(middlewareContext, async () => {
|
|
5397
5478
|
await _runWithCurrentRequest(currentRequest, async () => {
|
|
5398
|
-
let pageElement = this.
|
|
5479
|
+
let pageElement = await this.createPageElement(PageComponent, pageProps);
|
|
5399
5480
|
if (LoadingFallbackComponent && !islandsNavigationRequest) {
|
|
5400
5481
|
const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
|
|
5401
5482
|
...createRouteStateProps({
|
|
@@ -5420,7 +5501,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5420
5501
|
routeManifestEntry?.serverTree === true
|
|
5421
5502
|
);
|
|
5422
5503
|
}
|
|
5423
|
-
pageElement = this.createPageBoundary(pageElement, {
|
|
5504
|
+
pageElement = await this.createPageBoundary(pageElement, {
|
|
5424
5505
|
pageShouldHydrate: isClientComponent || shouldHydrate,
|
|
5425
5506
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
5426
5507
|
islandStrategy: hydrationIslandStrategy
|
|
@@ -5469,7 +5550,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5469
5550
|
slot.module.default,
|
|
5470
5551
|
slot.props
|
|
5471
5552
|
);
|
|
5472
|
-
if (slot.shouldHydrate)
|
|
5553
|
+
if (slot.shouldHydrate) {
|
|
5554
|
+
slotElement = this.wrapClientGraph(
|
|
5555
|
+
await this.wrapIslandIntegrationProviders(slotElement)
|
|
5556
|
+
);
|
|
5557
|
+
}
|
|
5473
5558
|
slotElement = this.rendererRuntime.createElement(
|
|
5474
5559
|
"div",
|
|
5475
5560
|
{
|
|
@@ -5500,24 +5585,6 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5500
5585
|
if (shouldHydrateLayout) {
|
|
5501
5586
|
wrappedElement = this.wrapClientGraph(wrappedElement);
|
|
5502
5587
|
}
|
|
5503
|
-
if (ErrorFallbackComponent && this.rendererRuntime.ErrorBoundary) {
|
|
5504
|
-
wrappedElement = this.rendererRuntime.createElement(
|
|
5505
|
-
this.rendererRuntime.ErrorBoundary,
|
|
5506
|
-
{
|
|
5507
|
-
Fallback: ErrorFallbackComponent,
|
|
5508
|
-
fallbackProps: {
|
|
5509
|
-
...createRouteStateProps({
|
|
5510
|
-
params,
|
|
5511
|
-
searchParamsObject,
|
|
5512
|
-
path: pathname,
|
|
5513
|
-
middlewareMap,
|
|
5514
|
-
pluginExposedContext
|
|
5515
|
-
})
|
|
5516
|
-
}
|
|
5517
|
-
},
|
|
5518
|
-
wrappedElement
|
|
5519
|
-
);
|
|
5520
|
-
}
|
|
5521
5588
|
if ((isClientComponent || shouldHydrate) && !shouldHydrateLayout && this.reactRenderer) {
|
|
5522
5589
|
wrappedElement = this.reactRenderer.markLayoutPosition(wrappedElement);
|
|
5523
5590
|
}
|
|
@@ -6235,7 +6302,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6235
6302
|
searchParams: createFarmSearchParams(options.searchParamsObject),
|
|
6236
6303
|
path: options.pagePath
|
|
6237
6304
|
};
|
|
6238
|
-
const handlerResult =
|
|
6305
|
+
const handlerResult = await resolveFarmMetadataImageValue(imageModule, imageProps, {
|
|
6306
|
+
renderer: this.getMetadataImageRenderer(),
|
|
6307
|
+
component: isRendererCompiledComponent(
|
|
6308
|
+
options.image.modulePath,
|
|
6309
|
+
this.config.renderer?.componentExtensions ?? []
|
|
6310
|
+
)
|
|
6311
|
+
});
|
|
6239
6312
|
await this.writeMetadataImageResponse(req, res, handlerResult, imageModule);
|
|
6240
6313
|
}
|
|
6241
6314
|
async writeMetadataImageResponse(req, res, value, imageModule) {
|
|
@@ -6243,10 +6316,14 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6243
6316
|
const response = await createFarmMetadataImageResponse(value, imageModule, {
|
|
6244
6317
|
method: req.method,
|
|
6245
6318
|
ifNoneMatch: Array.isArray(ifNoneMatch) ? ifNoneMatch[0] : ifNoneMatch,
|
|
6246
|
-
renderer:
|
|
6319
|
+
renderer: this.getMetadataImageRenderer()
|
|
6247
6320
|
});
|
|
6248
6321
|
await sendWebResponse(res, response);
|
|
6249
6322
|
}
|
|
6323
|
+
/** The renderer that draws a metadata image: none for React, whose elements Satori reads directly. */
|
|
6324
|
+
getMetadataImageRenderer() {
|
|
6325
|
+
return isReactRenderer(this.config.renderer) ? void 0 : this.rendererRuntime;
|
|
6326
|
+
}
|
|
6250
6327
|
async writeStaticMetadataImageResponse(req, res, image) {
|
|
6251
6328
|
const method = (req.method || "GET").toUpperCase();
|
|
6252
6329
|
if (method !== "GET" && method !== "HEAD") {
|
|
@@ -6351,6 +6428,21 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6351
6428
|
return false;
|
|
6352
6429
|
}
|
|
6353
6430
|
}
|
|
6431
|
+
/**
|
|
6432
|
+
* Islands mode: a page whose route hydrates nothing as a root hydrates only islands, which hold
|
|
6433
|
+
* their own clicks, so nothing else on it is held, as in production.
|
|
6434
|
+
*/
|
|
6435
|
+
isIslandsOnlyPage(req) {
|
|
6436
|
+
return this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
|
|
6437
|
+
}
|
|
6438
|
+
/**
|
|
6439
|
+
* The head script that holds a page's clicks and submits until it hydrates, which the client
|
|
6440
|
+
* replays once it has. Production writes it into the same pages, streamed or buffered.
|
|
6441
|
+
*/
|
|
6442
|
+
renderPreHydrationHold(req, bootClient) {
|
|
6443
|
+
const hydrates = req.__FARM_IS_CLIENT_COMPONENT__ === true || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true;
|
|
6444
|
+
return hydrates && !bootClient && !this.isIslandsOnlyPage(req) ? createPreHydrationClickQueueScript() : "";
|
|
6445
|
+
}
|
|
6354
6446
|
async renderBufferedSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6355
6447
|
const startedAt = Date.now();
|
|
6356
6448
|
const route = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
@@ -6403,6 +6495,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6403
6495
|
const farmClientScript = farmScripts(
|
|
6404
6496
|
`<script type="module" src="/@farm/client.js"></script>`
|
|
6405
6497
|
);
|
|
6498
|
+
const holdScript = farmScripts(this.renderPreHydrationHold(req, false));
|
|
6406
6499
|
const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
|
|
6407
6500
|
element,
|
|
6408
6501
|
{
|
|
@@ -6461,7 +6554,8 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6461
6554
|
...this.collectDevStyleLinks(),
|
|
6462
6555
|
viteClientScript,
|
|
6463
6556
|
rendererHydrationScript,
|
|
6464
|
-
bootstrapScript
|
|
6557
|
+
bootstrapScript,
|
|
6558
|
+
holdScript
|
|
6465
6559
|
].filter(Boolean).join("\n "),
|
|
6466
6560
|
bodyFooter: [deferredScript, farmClientScript].filter(Boolean).join("\n ")
|
|
6467
6561
|
});
|
|
@@ -6481,7 +6575,8 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6481
6575
|
${l}`).join("")}
|
|
6482
6576
|
${viteClientScript}
|
|
6483
6577
|
${rendererHydrationScript}
|
|
6484
|
-
${bootstrapScript}
|
|
6578
|
+
${bootstrapScript}${holdScript ? `
|
|
6579
|
+
${holdScript}` : ""}
|
|
6485
6580
|
</head>
|
|
6486
6581
|
<body class="">
|
|
6487
6582
|
<div id="root">${content}</div>
|
|
@@ -6544,7 +6639,8 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6544
6639
|
}
|
|
6545
6640
|
}
|
|
6546
6641
|
async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6547
|
-
const
|
|
6642
|
+
const runtime = this.rendererRuntime;
|
|
6643
|
+
const renderToPipeableStream = runtime.renderToPipeableStream ?? (getFarmRendererStreamingCapabilitiesForRuntime(this.config.renderer, "node").web && runtime.renderToReadableStream ? pipeFarmRendererWebStream(runtime) : void 0);
|
|
6548
6644
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6549
6645
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
|
|
6550
6646
|
if (!renderToPipeableStream || _isFarmMarkdownPageCheck(req.headers?.[FARM_MARKDOWN_PAGE_CHECK_HEADER]) || streamDocument && (options.captureStaticShell || !isReactRenderer(this.config.renderer))) {
|
|
@@ -6620,11 +6716,12 @@ window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
|
6620
6716
|
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(getRegisteredIntegrationAPIManifest())};
|
|
6621
6717
|
window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getFarmI18nClientSnapshot()) : "null"};
|
|
6622
6718
|
</script>${renderFarmFormStateScript()}`;
|
|
6623
|
-
const islandsOnlyPage = this.
|
|
6719
|
+
const islandsOnlyPage = this.isIslandsOnlyPage(req);
|
|
6624
6720
|
const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
|
|
6625
6721
|
const waitingRoot = this.islandValues() && !islandsOnlyPage && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true && rootStrategy !== void 0 && rootStrategy !== "load" ? req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? "root" : "__farm_page__" : null;
|
|
6626
6722
|
const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && resolveFarmPlatform() !== "mobile" && canBootFarmIslandsClient(this.config);
|
|
6627
|
-
const hydrationClickQueueScript =
|
|
6723
|
+
const hydrationClickQueueScript = this.renderPreHydrationHold(req, bootClient);
|
|
6724
|
+
const rendererHydrationScript = this.rendererRuntime.generateHydrationScript?.() || "";
|
|
6628
6725
|
const {
|
|
6629
6726
|
title,
|
|
6630
6727
|
tags: metaTags,
|
|
@@ -6690,7 +6787,8 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6690
6787
|
${fontHead}
|
|
6691
6788
|
${globalStylesheetLink}${devStyleLinks.map((l) => `
|
|
6692
6789
|
${l}`).join("")}
|
|
6693
|
-
<script type="module" src="/@vite/client"></script
|
|
6790
|
+
<script type="module" src="/@vite/client"></script>${rendererHydrationScript ? `
|
|
6791
|
+
${rendererHydrationScript}` : ""}
|
|
6694
6792
|
${propsScript}
|
|
6695
6793
|
${hydrationClickQueueScript}
|
|
6696
6794
|
</head>
|
|
@@ -6744,6 +6842,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6744
6842
|
globalStylesheetLink,
|
|
6745
6843
|
...devStyleLinks,
|
|
6746
6844
|
`<script type="module" src="/@vite/client"></script>`,
|
|
6845
|
+
rendererHydrationScript,
|
|
6747
6846
|
propsScript,
|
|
6748
6847
|
hydrationClickQueueScript
|
|
6749
6848
|
].filter(Boolean).join("\n ")
|
|
@@ -7970,6 +8069,15 @@ function createFarmNavigationScript(script) {
|
|
|
7970
8069
|
freshScript.textContent = script.textContent || "";
|
|
7971
8070
|
return freshScript;
|
|
7972
8071
|
}
|
|
8072
|
+
// Readies nodes parsed outside the page (DOMParser, a <template>) for the page they move into.
|
|
8073
|
+
// Those parse as a page without scripting, so a <noscript>'s content comes out as elements, whose
|
|
8074
|
+
// images and frames would load once in the page. They become the text the page's own parser makes
|
|
8075
|
+
// of that markup.
|
|
8076
|
+
function adoptFarmParsedNodes(root) {
|
|
8077
|
+
for (const noscript of Array.from(root.querySelectorAll("noscript"))) {
|
|
8078
|
+
noscript.textContent = noscript.innerHTML;
|
|
8079
|
+
}
|
|
8080
|
+
}
|
|
7973
8081
|
// React streams Suspense content after its fallback, in a hidden segment that a reveal script
|
|
7974
8082
|
// ($RC for a boundary, $RS for a segment placeholder) moves into place. This makes the same moves
|
|
7975
8083
|
// in a parsed page, before it goes on screen, and drops the calls it made, so the islands in that
|
|
@@ -8068,7 +8176,8 @@ async function readFarmNavigationStream(body, flushToken) {
|
|
|
8068
8176
|
cancel: function() { reader.cancel().catch(function() {}); },
|
|
8069
8177
|
};
|
|
8070
8178
|
}`;
|
|
8071
|
-
var FARM_EARLY_NAVIGATION_SOURCE = `// The request the boot script sent for a link clicked before the router ran
|
|
8179
|
+
var FARM_EARLY_NAVIGATION_SOURCE = `// The request the boot script sent for a link pressed or clicked before the router ran
|
|
8180
|
+
// (islands-boot.ts).
|
|
8072
8181
|
// The next navigation request takes its response when it is the same request, and aborts it
|
|
8073
8182
|
// otherwise. The held island values may differ: a response for fewer of them carries more values,
|
|
8074
8183
|
// which fits any page. As with a prefetched page, a response sent over 30 seconds ago is not used.
|
|
@@ -8330,14 +8439,43 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
|
8330
8439
|
"@farm.js/core/query/client",
|
|
8331
8440
|
"@farm.js/core/server-fn/client",
|
|
8332
8441
|
"@farm.js/core/server-query/client",
|
|
8442
|
+
// Farm's browser entry imports these and no app file does, so Vite's scan cannot see them. In an
|
|
8443
|
+
// app that installs Farm from the registry, Vite found them on the first page request, bundled
|
|
8444
|
+
// again, and reloaded the page while it loaded.
|
|
8445
|
+
"@farm.js/core/internal/client-runtime",
|
|
8446
|
+
"@farm.js/core/internal/spa-router",
|
|
8447
|
+
"@farm.js/core/router",
|
|
8448
|
+
// The typed API client. The development server excludes the server-only `@farm.js/core/api`,
|
|
8449
|
+
// and Vite's scan skips every subpath of an excluded package, so an app's import of the client
|
|
8450
|
+
// was also found only on the first request.
|
|
8451
|
+
"@farm.js/core/api/client",
|
|
8333
8452
|
// Islands mode's browser runtime: Farm imports islx, which the app reaches only through Farm.
|
|
8334
8453
|
"@farm.js/core > @farm.js/islx/client",
|
|
8335
8454
|
"@farm.js/core > @farm.js/islx/react",
|
|
8336
|
-
"@farm.js/core > @farm.js/islx/react/client"
|
|
8455
|
+
"@farm.js/core > @farm.js/islx/react/client",
|
|
8456
|
+
// What a browser module's import of a server function compiles to on other renderers (see
|
|
8457
|
+
// `resolveFarmIslxActionsMode`). Found only when that module is first requested, it made Vite
|
|
8458
|
+
// bundle again and reload the page while it loaded.
|
|
8459
|
+
"@farm.js/core/internal/islx-actions-client"
|
|
8337
8460
|
];
|
|
8338
|
-
function
|
|
8461
|
+
function isInstalledPackage(root, specifier) {
|
|
8462
|
+
const parts = specifier.split("/");
|
|
8463
|
+
const name = specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
|
|
8464
|
+
const directory = findFarmAppPackageDir(root, name);
|
|
8465
|
+
return directory !== void 0 && directory.split(path18.sep).includes("node_modules");
|
|
8466
|
+
}
|
|
8467
|
+
function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
8339
8468
|
return Array.from(
|
|
8340
|
-
/* @__PURE__ */ new Set([
|
|
8469
|
+
/* @__PURE__ */ new Set([
|
|
8470
|
+
...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE,
|
|
8471
|
+
...renderer?.optimizeDeps || [],
|
|
8472
|
+
// Farm's browser entry imports a renderer's client module, and no app file does, so Vite's
|
|
8473
|
+
// scan never sees it and finds it only on the first page request, then bundles again. The
|
|
8474
|
+
// React entry imports `react-dom/client` instead, which is already listed. A linked
|
|
8475
|
+
// renderer stays source: pre-bundling it would copy the packages it shares with the app's
|
|
8476
|
+
// components into the bundle, so a hook would read a different copy than the renderer set.
|
|
8477
|
+
...renderer && root && !isReactRenderer(renderer) && isPackageSpecifier(renderer.client) && isInstalledPackage(root, renderer.client) ? [renderer.client] : []
|
|
8478
|
+
])
|
|
8341
8479
|
);
|
|
8342
8480
|
}
|
|
8343
8481
|
function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
@@ -8348,8 +8486,9 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
|
8348
8486
|
return `${prefix}/${FARM_CLIENT_ENTRY_PATTERN}`;
|
|
8349
8487
|
});
|
|
8350
8488
|
}
|
|
8351
|
-
function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
8489
|
+
function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
8352
8490
|
if (isFarmRendererDisabled(renderer)) return { noDiscovery: true, include: [] };
|
|
8491
|
+
const jsxImportSource = renderer ? renderer.jsxImportSource : void 0;
|
|
8353
8492
|
return {
|
|
8354
8493
|
// Keep normal application dependency discovery for CJS-only packages, but
|
|
8355
8494
|
// seed every Farm browser runtime so React is present in the first crawl.
|
|
@@ -8357,11 +8496,20 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
|
8357
8496
|
// Waiting for the crawl avoids serving a partial optimizer generation and
|
|
8358
8497
|
// then changing browser hashes while hydration is already in progress.
|
|
8359
8498
|
holdUntilCrawlEnd: true,
|
|
8360
|
-
include: getFarmClientOptimizeDepsInclude(renderer || void 0),
|
|
8499
|
+
include: getFarmClientOptimizeDepsInclude(renderer || void 0, root),
|
|
8361
8500
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
8362
8501
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
8363
8502
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
8364
|
-
...entries?.length ? { entries: [...entries] } : {}
|
|
8503
|
+
...entries?.length ? { entries: [...entries] } : {},
|
|
8504
|
+
// Vite's dependency scan compiles JSX on its own: with the app tsconfig's `jsxImportSource`
|
|
8505
|
+
// when there is one, otherwise as React, whatever the renderer's plugin set for its own
|
|
8506
|
+
// transforms. React is the default already, and naming it here would override a tsconfig
|
|
8507
|
+
// source such as Emotion's. A renderer plugin's own scan setting is merged over this one.
|
|
8508
|
+
...jsxImportSource && jsxImportSource !== "react" ? {
|
|
8509
|
+
rolldownOptions: {
|
|
8510
|
+
transform: { jsx: { runtime: "automatic", importSource: jsxImportSource } }
|
|
8511
|
+
}
|
|
8512
|
+
} : {}
|
|
8365
8513
|
};
|
|
8366
8514
|
}
|
|
8367
8515
|
function createFarmSourceAlias(projectRoot, srcDir = "src") {
|
|
@@ -8562,8 +8710,11 @@ export {
|
|
|
8562
8710
|
farmDevServerStylesheetsPlugin,
|
|
8563
8711
|
resolveFarmNotFoundComponentPath,
|
|
8564
8712
|
DEFAULT_NOT_FOUND_STYLES,
|
|
8713
|
+
isRendererCompiledComponent,
|
|
8565
8714
|
generateFarmIntegrationProviderClientCode,
|
|
8566
8715
|
generateFarmIntegrationProviderServerModules,
|
|
8716
|
+
resolveFarmIslxActionsMode,
|
|
8717
|
+
farmBrowserServerFnsEnabled,
|
|
8567
8718
|
inferFarmIslandStrategy,
|
|
8568
8719
|
invalidateFarmRouteRootInferences,
|
|
8569
8720
|
resolveFarmRouteRootStrategy,
|