rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Missing shim for `Null.t`

Open sgrove opened this issue 2 years ago • 5 comments

I suspect this is likely to show up quite a bit (and maybe there's a way to shim it in user land?), so just bringing it up.

While using pgtyped-rescript, I was experimenting with getting all the way into my typescript code from Rescript-generated code, but this is currently one of the show-stoppers:

(generated) block__sql.res:

/** 'InsertBlock' parameters type */
type insertBlockParams = {
  camel_case_name?: Null.t<string>,
  chain_id?: Null.t<string>,
  description?: Null.t<string>,
  id?: Null.t<string>,
  kind?: Null.t<string>,
  local_schema?: Null.t<string>,
  source_code?: Null.t<string>,
  title?: Null.t<string>,
}

block__sql.gen.tsx

src/sql/block__sql.gen.tsx:10:34 - error TS2307: Cannot find module './Null.gen.js' or its corresponding type declarations.

10 import type { t as Null_t } from "./Null.gen.js";

sgrove avatar Aug 20 '23 17:08 sgrove

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 02 '24 01:09 github-actions[bot]

For now, you'll have to define your own shims. But these things are all going into the compiler in v12 as Core is integrated, so we're going to make sure all of these things just work OOTB with no hassle for v12. Just bear with us.

zth avatar Sep 02 '24 06:09 zth

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 04 '25 02:09 github-actions[bot]

Not today, bot!

fhammerschmidt avatar Sep 04 '25 05:09 fhammerschmidt

This is a good reminder that we should do a round of testing with gentype and see what the current state for v12 is.

zth avatar Sep 04 '25 06:09 zth