mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
With this PR we are restructuring how the Next.js compiler transforms server function modules (`'use server'` or `'use cache'` directive at the top of the file). The workaround for skipping the registration of exported `'use cache'` functions is removed. All exported server functions are now properly registered during visitor traversal, which fixes incorrect server reference information bytes in server reference IDs in some circumstances (see #86292 for example). We're also adding support for string literal exports, e.g.: ```js 'use server' async function foo() {} export { foo as '📙' } ```
5 lines
62 B
JavaScript
5 lines
62 B
JavaScript
'use cache'
|
|
|
|
async function foo() {}
|
|
export { foo as '📙' }
|