Skip to content

Codemod loses React DOM preloads from direct React Intl formatter calls during native SSR #2507

Closed

Description

@domgan-oai

Reproduction

Build the codemod from 3778ae73d39544b9c17a9185703aae6af94ffb29 and install Octane 0.16.7, React and React DOM 19.2.7, and React Intl 7.1.14 in a fixture project. Migrate this exported component with octane-codemod --strong --svg-paths Case.tsx. Preview reports clean Strong output with compiler verification enabled.

import { useIntl } from 'react-intl';

export function Case() {
  const intl = useIntl();
  return <p title={intl.formatMessage({ id: 'label', defaultMessage: 'Ready' })}>status</p>;
}

Create an Intl value with a custom formatter outside the selected migration input.

import { preload } from 'react-dom';
import { createIntl } from 'react-intl';

const intl = createIntl({ locale: 'en', messages: { label: 'Ready' } });
const formatMessage = intl.formatMessage;
intl.formatMessage = function (...args) {
  preload('/title.css', { as: 'style' });
  return formatMessage(...args);
};

Render the original with production react-dom/server renderToString, using React Intl's RawIntlProvider with value={intl}. Prerender the generated component with production octane/static, passing the same value through RawIntlProvider from the generated octane-react-intl.tsrx helper.

Observed and expected output

Both renders call the same formatter once with the same receiver and emit title="Ready". React additionally emits <link rel="preload" href="/title.css" as="style"/>. Octane omits the link. With the stock formatter, both render the same paragraph.

The generated component evaluates the method in native SSR. A scalar result establishes that the host attribute accepts the value. The formatter's resource work still needs its React request. A supported migration should preserve that work or report a blocking diagnostic when the codemod cannot establish the formatter's ownership. A blanket provider guard also blocks existing migrations that use ordinary stock providers outside the selected file.

Related to #2497, which covers work evaluated inside a generated React island, and #2444, which covers a custom locale getter. This case uses a direct native attribute and generates no island.

Codex task · Host com-79386

Activity

  1. added
    bug
    agent-authored
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-authoredbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions