JSX preserve mode: unused import of "react/jsx-runtime"
When JSX preserve mode is active, the import statement
import * as JsxRuntime from "react/jsx-runtime";
is still emitted to the JS output, but is unused there.
@cristianoc do you have any ideas when the import * line is constructed?
In which phase would that happen? I think tackling it there might be the safer than avoid it in js_dump (since other code might need it).
Do we really need to care about this for v12? Bundlers will just remove it because it's dead anyway.
@cristianoc do you have any ideas when the
import *line is constructed? In which phase would that happen? I think tackling it there might be the safer than avoid it injs_dump(since other code might need it).
Looks like it's coming from a react external. I guess the code is generated that makes use of jsx runtime, but later on dump is customised to emit preserve mode so it appears to be unused (but it was used, before dumping).
Yes, I'm aware of that, it makes sense why it is there. I'm just wondering, where in the codebase it will organize the imports and how that part works?
Yes, I'm aware of that, it makes sense why it is there. I'm just wondering, where in the codebase it will organize the imports and how that part works?
I think it's in Lam_compile_main.compile, which does the last phase of compilation and determines dependencies.
Do we really need to care about this for v12? Bundlers will just remove it because it's dead anyway.
Certainly not a blocker, but still a bit weird to emit unused imports, we never did that before.