You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compiler treats a shadowed createPortal as Octane’s portal builtin #2587
Reproduced with the compiler and runtime built from Octane main c34035d7d1474b266127382bb0c6bebc22bb6fc6 in production mode. The compiler replaces calls based on the local name createPortal, even when the binding is an ordinary parameter.
Both components should call the supplied function once and render AUTHORED. Server rendering uses octane/server.renderToString(Component, props), and client rendering uses createRoot(container).render(Component, props).
Component
Server
Client
Host
Empty portal placeholder, 0 calls
Empty <main>, 0 calls
Fragment
Empty portal placeholder, 0 calls
AUTHORED, 1 call
An equivalent ordinary helper with a different name renders normally. Genuine Octane portals using either the direct import or import { createPortal as mount } from 'octane' both mounted a simple control into the target on the client. The server emitted placeholders for both.
The same spelling check also affects callable template arguments. In a template setup, const createPortal = (render) => render(); const result = createPortal(() => @{ <b>child</b> }); currently throws on the client when rendering result, because the compiler treats the argument as a runtime-owned template body. The same setup renders on the server.
The client and server portal lowering and the template-argument exemption should use the call's resolved Octane import binding. See the SSR portal branch and the template-argument exemption.
Activity