remix icon indicating copy to clipboard operation
remix copied to clipboard

JsonFunction not exported from remix-node as type

Open SeanLatimer opened this issue 3 years ago • 4 comments
trafficstars

What version of Remix are you using?

1.7.2

Steps to Reproduce

npm install @remix-run/node

Expected Behavior

JsonFunction should be exported as a type from @remix-run/node

Actual Behavior

As you can see here remix-node/index.ts#L44, JsonFunction is not exported as a type.

SeanLatimer avatar Oct 17 '22 16:10 SeanLatimer

Out of curiosity: What's your use case for having it exported?

machour avatar Oct 18 '22 08:10 machour

I personally don't need it exported. The fact that it's a type not being exported as a type is causing TypeScript errors with some code generation from rmx-cli that re-exports some stuff from remix packages.

SeanLatimer avatar Oct 18 '22 20:10 SeanLatimer

@kiliman would it make sense to have it exported?

machour avatar Oct 18 '22 21:10 machour

I see. The issue is that Remix is exporting JsonFunction, but it's not exporting as a type. That's why you get a warning with the generator since it creates separate re-exports for types and non-types. That should just be moved to the export type block.

https://github.com/remix-run/remix/blob/416742725f4d454acff48e4654756a5949a5a742/packages/remix-node/index.ts#L38-L50

kiliman avatar Oct 18 '22 21:10 kiliman

Fixed by #5204

pcattori avatar Jan 23 '23 21:01 pcattori

🤖 Hello there,

We just published version v0.0.0-nightly-8346ace-20230124 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

github-actions[bot] avatar Jan 24 '23 07:01 github-actions[bot]

🤖 Hello there,

We just published version 1.12.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

github-actions[bot] avatar Jan 30 '23 23:01 github-actions[bot]