Open ksaldana1 opened 2 months 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:
.gen.tsx
. (module).ts
files under src/(module)
. (module)/index.ts
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.
there are some points to concern:
about the backward compatibility, maybe we can let both(Belt and core) exist, while migrating. Each modules must be in a flat hierarchy for tree-shasking, so here's a my inital idea is like, for Array module:
A(for Belt.Array, no prefixes for backward compatiblity) cA(for Core.Array, prefix c stands for core).
higher module like Core.A or C.A will hurt tree shaking.
about the backward compatibility, maybe we can let both(Belt and core) exist, while migrating. Each modules must be in a flat hierarchy for tree-shasking, so here's a my inital idea is like, for Array module:
A(for Belt.Array, no prefixes for backward compatiblity) cA(for Core.Array, prefix c stands for core).
higher module like Core.A or C.A will hurt tree shaking.
I like the idea of reaching parity incrementally by having separate modules for Belt vs core. That would make it a bit easier to continue to fix some of the outstanding bugs that currently exist. Can track how well the core-backed APIs match up with the existing test suite to determine when the migration is done.
I think the goal of 1:1 backwards compatibility depends a bit on your goals with this fork. Is the ReScript library backing the API an implementation detail, or is the goal to just be a straight copy of its underlying ReScript API? As a fan of ReScript I like the idea of being closely tied to the underlying API, since I like seeing this library as a stepping stone, but I understand the trade-offs here and think either approach works.
Curried functions are needed for the pipe
API right? What would the alternative be to maintain this functionality?
I'm not sure about the goal of this library at this point. As I said above, my imminent goal is fixing the current version's API and the core migration. For the goal, I have two separate Ideas for it:
the current version of ts-belt APIs is not paired with Belt's already. Some modules got more, some had less. should we deprecate unpaired functions that rescript doesn't have at this point?
We can leave this conversation open so that others come here and leave more ideas.
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 thegen.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 torescript-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.