9be387c7f4
Previous to this change, getServerSideProps could only return plain objects for props, e.g.: ```javascript export async function getServerSideProps() { return { props: { text: 'some value', } } } ``` With this commit, the props object can also be a Promise, e.g. ```javascript export async function getServerSideProps() { return { props: (async function () { return { text: 'promise value', } })(), } } ``` For now, the framework simply waits for the results of the props Promise to resolve, but this small change sets the groundwork for later allowing props to be streamed (cc @devknoll). ## Feature - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. -- *This is part of @devknoll's ongoing work to support streaming.* - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [x] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. *not sure if this applies here* - [ ] Errors have helpful link attached, see `contributing.md` |
||
---|---|---|
.. | ||
dev | ||
lib | ||
api-utils.ts | ||
config-shared.ts | ||
config-utils-worker.ts | ||
config-utils.ts | ||
config.ts | ||
crypto-utils.ts | ||
denormalize-page-path.ts | ||
font-utils.ts | ||
get-page-files.ts | ||
get-route-from-entrypoint.ts | ||
htmlescape.ts | ||
image-config.ts | ||
image-optimizer.ts | ||
incremental-cache.ts | ||
load-components.ts | ||
next-server.ts | ||
next.ts | ||
node-polyfill-fetch.js | ||
normalize-page-path.ts | ||
optimize-amp.ts | ||
render.tsx | ||
require.ts | ||
response-cache.ts | ||
router.ts | ||
send-payload.ts | ||
serve-static.ts | ||
utils.ts |