Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate genType as 'TypeScript Interop' chapter into main docs #755

Merged

Conversation

fhammerschmidt
Copy link
Member

ryyppy commented 2 weeks ago

A few things I'd change now that we have the chance to make structural changes to the genType docs:

  1. GenType is now a builtin tool, and we should not treat this section as if it would still be a library. Maybe the Introduction should rather be something like "ReScript & TS" which would briefly mention the general concepts and philosophy, plus the setup instructions (instead of having the "Getting started" page)
  2. The general sidebar structure of genType doesn't make much sense anymore (and I regretted building it this way back then). Ideally, we'd provide more concrete sidebar items that users would be looking for when interoping with TS (as we do with "JavaScript interop". The "Usage" page for instance already has a good starting point (although some items sound a little abstract), maybe it would make sense to experiment here to branch out in different documents instead.
  • image
  1. Same feeling for supported types as in the previous point... one could provide separate sidebar items for "Bind to TS primitive values", "Bind to TS objects", "Bind variants to TS", etc with proper examples (from/to mappings) to make it copy-pastable and easy to understand.

@fhammerschmidt fhammerschmidt force-pushed the gentype-to-main-docs branch 2 times, most recently from e17925f to 2fefef8 Compare December 5, 2023 11:31
@fhammerschmidt fhammerschmidt marked this pull request as ready for review December 5, 2023 12:17
@cometkim
Copy link
Member

cometkim commented Dec 5, 2023

I built the homepage and took a quick look at the outline.

This is the feedback so far.

  • Mentions of runtime features should be removed. It should all be considered deprecated. (specifically genType.import, genType.as, shims)
  • The statement about runtime mappers is also no longer true.
  • Projects that use genType are also TypeScript projects. For better experience, the configuration guide should cover of tsconfig.json too.
  • The explanation of interop behavior feels like a bit of low-level information. I suggest adding guides/practice documents from a higher-level perspective. (examples: "Dealing with conventional differences", "Bring your own pipe", "Making it more convenient in JS/TS-side", etc)

Can you update any changes you are working on? I might submit another PR to your branch.

@fhammerschmidt
Copy link
Member Author

This new version of the PR is totally simplified since lot's of runtime conversion features were removed, FCMs do not work (according to @cometkim) and more things got deprecated.
In the future, we want to have some export=all feature for genType that we can use for the docs site and can then, in theory, show the generated TS types for every single example.

That way we would promote genType to the seamless experience it should be.

But for now I think this is the fastest path going forward. Let's merge this soon.

@fhammerschmidt fhammerschmidt merged commit a0b68b0 into rescript-lang:master Jan 12, 2024
1 of 2 checks passed
@fhammerschmidt fhammerschmidt deleted the gentype-to-main-docs branch January 12, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate genType docs into main docs as "TypeScript interop"
3 participants