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
Codemod guesses local Context.Provider ownership from export names #2608
The codemod reports Strong with no findings and changes const provide = Badge.Provider to const provide = Badge. Production React SSR and the browser render the title original. Octane SSR and the client throw because the rewritten value is an object. Selecting both files through a TypeScript path alias reproduces the same mistake.
The inverse occurs for a real context exported under an ordinary name. If both modules are selected and a TypeScript alias resolves to export const Shade = createContext('default'), the migrated consumer retains <Shade.Provider> even though the exporter now produces an Octane context. The equivalent relative import is rewritten correctly.
Expected behavior
Use the selected export and project resolution to recognize a migrated local context. Keep ordinary provider members and unselected local modules intact. An unselected React context still needs a renderer ownership decision before native consumers can read it.
#2610 addresses the name-based rewrite of ordinary local provider members. The newly recognized genuine alias remains open.
A stable declaration and a correctly resolved module do not establish that the original React .Provider member is unchanged. In a synthetic production check, an unselected module imported the same genuine context and installed a getter on .Provider. React SSR and the client rendered the replacement. Rewriting the selected caller from <Shade.Provider> to <Shade> bypassed the getter and rendered the original value.
The positive rewrite needs either a proof that the original member cannot be replaced through a reachable caller or an explicit producer contract. The selected-module test keeps the existing relative and suffix-alias cases while avoiding new alias rewrites.
Activity
domgan-oai commentedon Nov 13, 2026
#2610 addresses the name-based rewrite of ordinary local provider members. The newly recognized genuine alias remains open.
A stable declaration and a correctly resolved module do not establish that the original React
.Providermember is unchanged. In a synthetic production check, an unselected module imported the same genuine context and installed a getter on.Provider. React SSR and the client rendered the replacement. Rewriting the selected caller from<Shade.Provider>to<Shade>bypassed the getter and rendered the original value.The positive rewrite needs either a proof that the original member cannot be replaced through a reachable caller or an explicit producer contract. The selected-module test keeps the existing relative and suffix-alias cases while avoiding new alias rewrites.