logto-io / logto

🧑‍🚀 The better identity infrastructure for developers and the open-source alternative to Auth0.
https://logto.io
Mozilla Public License 2.0
8.15k stars 395 forks source link

refactor: experience ssr #6229

Closed gao-sun closed 1 month ago

gao-sun commented 1 month ago

Summary

support experience data server-side rendering and fall back to network fetching if needed.

Testing

locally tested and ⬇️

Checklist

github-actions[bot] commented 1 month ago

COMPARE TO master

Total Size Diff :warning: :chart_with_upwards_trend: +13.15 KB

Diff by File |Name|Diff| |---|---| |.changeset/shy-baboons-occur.md|:chart_with_upwards_trend: +492 Bytes| |packages/core/src/middleware/koa-experience-ssr.test.ts|:chart_with_upwards_trend: +2.58 KB| |packages/core/src/middleware/koa-experience-ssr.ts|:chart_with_upwards_trend: +2.18 KB| |packages/core/src/middleware/koa-serve-static.ts|:chart_with_upwards_trend: +243 Bytes| |packages/core/src/oidc/init.ts|:chart_with_upwards_trend: +138 Bytes| |packages/core/src/oidc/utils.ts|:chart_with_upwards_trend: +75 Bytes| |packages/core/src/routes/well-known.ts|:chart_with_upwards_trend: +398 Bytes| |packages/core/src/tenants/Tenant.ts|:chart_with_upwards_trend: +128 Bytes| |packages/core/src/utils/i18n.ts|:chart_with_upwards_trend: +991 Bytes| |packages/experience/src/i18n/utils.ts|:chart_with_upwards_trend: +421 Bytes| |packages/experience/src/include.d/global.d.ts|:chart_with_upwards_trend: +227 Bytes| |packages/experience/src/index.html|:chart_with_upwards_trend: +433 Bytes| |packages/experience/src/jest.setup.ts|:chart_with_upwards_trend: +183 Bytes| |packages/experience/src/utils/search-parameters.ts|:chart_with_upwards_trend: +201 Bytes| |packages/experience/src/utils/sign-in-experience.ts|:chart_with_upwards_trend: +499 Bytes| |packages/integration-tests/src/include.d/global.d.ts|:chart_with_upwards_trend: +86 Bytes| |packages/integration-tests/src/tests/experience/server-side-rendering.test.ts|:chart_with_upwards_trend: +4.84 KB| |packages/schemas/src/types/cookie.ts|:chart_with_upwards_trend: +145 Bytes| |packages/schemas/src/types/index.ts|:chart_with_upwards_trend: +26 Bytes| |packages/schemas/src/types/sign-in-experience.ts|0 Bytes| |packages/schemas/src/types/ssr.ts|:chart_with_upwards_trend: +751 Bytes|