JUSTIVE / ts-belt

🔧 Fast, modern, and practical utility library for FP in TypeScript.
https://mobily.github.io/ts-belt
MIT License
3 stars 0 forks source link

Discussion: Migration to Rescript Core #10

Open ksaldana1 opened 23 hours ago

ksaldana1 commented 23 hours ago

Thanks for taking the initiative to create a fork @JUSTIVE. I wanted to start the discussion you started here regarding the migration to rescript-core.

I wanted to start breaking down that work a bit to see what you think that would look like. I am still wrapping my brain a bit around the workflow in this repo, which is a bit of my inexperience in publishing ReScript into TypeScript. The relationship between genType and the TS declarations files isn't exactly clear to me—are the gen.tsx files used or were they just used to get the initial types?

Either way I understand that we need to change the underlying Belt usages to rescript-core, but I'm wondering if you had any stronger opinions on what you think that looks like. I am curious if the rescript-core team has any interest in a light TypeScript shim over their new core library. To me, it seems like a great way to incrementally sell people on the idea of ReScript and it's FP roots, but I understand if they don't want to take that on that extra work.

JUSTIVE commented 18 hours ago

I'm also on the way to understanding the building steps of this library yet, it's a bit more than just rescript's gentype. These are the current version of understanding what I've got, in the simplest version:

  1. the rescript file's generated type goes to .gen.tsx.
  2. if you want to override some types, write it on to (module).ts files under src/(module).
  3. Some code shift works, then write it to (module)/index.ts
  4. bundle goes on

script/build.ts will give you a hint about the build process.

my original idea of the goal of migration towards rescript-core is, primarily, not to leave this library outdated. I'm more interested in fixing the glitches in the latest version(4.0.0-rc5) and some minor changes(mostly I left on the original repo's PR) now. I'm not sure the rescript-core team is interested in this, but basically, I think this project is a completely independent one.

JUSTIVE commented 13 hours ago

there are some points to concern: