Open ceisele-r opened 1 year ago
We should try other DTS rollup tools (e.g. @microsoft/api-extractor
). rollup-plugin-dts
isn't that reliable for a complex project like Remirror.
@ocavue just wanted to ask whether there is any update on this problem as we are stuck on old remirror versions because newer versions no longer compile because of this. And I guess other Typescript users are also affected. Are different DTS rollup tools currently evaluated by you or is this something being considered? Or will this be something for v3 probably?
@ceisele-r Hi. I plan to work on this in August, but I'm not exactly sure when I can finish it. I want to use @microsoft/api-extractor
since it's likely more reliable, however, it has a big limitation now as it doesn't support multiple entry points (link). I'm trying to find a workaround for it.
In the meantime, does adding "skipLibCheck": true
in tsconfig.json
work for your project?
Hi @ocavue , thanks for the fast response. Nice to hear that you plan to work on this.
Enabling skipLibCheck
is unfortunately not an option as skipLibCheck
does unfortunately not allow to scope it to single packages and therefore it would disable type checks for all project dependencies completely.
Summary
Using
@remirror/react-core
in a typescript project causes the following typescript error to be emitted:Steps to reproduce
@remirror/react-core
in a typescript projecttsc
(v4.7.4
).Expected results
Typescript compiles
Actual results
Typescript emits the following error
Probably this is caused by the same underlying problem as #2070 in
rollup-plugin-dts
: https://github.com/Swatinem/rollup-plugin-dts/issues/266 .In the types in the resulting package(
node_modules/@remirror/react-core/dist/remirror-react-core.d.ts
), it seems that the function as well as the namespace have been renamed fromRemirror
toRemirror$1
which seems to be incorrect. The exported function is then aliased back toRemirror
in the export. So I guess only the function name should to be renamed toRemirror$1
and then aliased back toRemirror
in the export so it does not clash with the namespace (Remirror
) name.Possible Solution
Rename the exported function
Remirror
here https://github.com/remirror/remirror/blob/5a6ade6e35f5480eca1eac8b281e8a9342409a46/packages/remirror__react-core/src/react-remirror.tsx#L107 or the namespace so they don't clash.Ultimately, I think the bug mentioned above in
rollup-plugin-dts
should be fixed.Screenshot(s)
n/a