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

WIP: Move core typedefs out of Js modules #7129

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented Oct 25, 2024

No description provided.

@cknitt cknitt force-pushed the core-typedefs branch 4 times, most recently from 830ec22 to 5828460 Compare October 25, 2024 14:50
@cknitt cknitt changed the title WIP: Move typedefs from Js modules to core modules WIP: Move core typedefs out of Js modules Oct 25, 2024
@cknitt
Copy link
Member Author

cknitt commented Oct 26, 2024

The approach in this PR works fine for me. As mentioned, I had issues when putting the typedefs directly into the individual Core modules, see #7126 (comment).

Done so far for date and regExp, shall I continue this way for the other types @cristianoc @zth ?

@cristianoc
Copy link
Collaborator

The approach in this PR works fine for me. As mentioned, I had issues when putting the typedefs directly into the individual Core modules, see #7126 (comment).

Done so far for date and regExp, shall I continue this way for the other types @cristianoc @zth ?

The questions is what we want to expose to the user when hovering. @zth ?

@cknitt
Copy link
Member Author

cknitt commented Oct 26, 2024

The questions is what we want to expose to the user when hovering. @zth ?

@cristianoc @zth Hover would currently look like this:

Bildschirmfoto 2024-10-26 um 13 00 48

Bildschirmfoto 2024-10-26 um 13 01 25

@zth
Copy link
Collaborator

zth commented Oct 27, 2024

Probably something we'll have to make look artificially better in the editor tooling anyway. So I'm fine with this.

Ideally from my POV, the first hover should just be date and not include type Pervasives.date = CoreTypes.date. And the second one just be Type Date.t = date. So, in other words, always hide CoreTypes and Pervasives. Half baked though maybe, but that's what I think at a glance.

@cristianoc
Copy link
Collaborator

We can separately think about what is the ideal way of expressing a type.
And the editor should nudge towards that way.

Btw gentype currently has the issue that work worse for code included in the compiler than for user code. (When looking for where a type is defined, as well as shipping .tsx files).
This will be addressed when it is revamped. And for now it's necessary to hard code all the possible paths as in this PR.

Let's go with this.

@cknitt cknitt marked this pull request as ready for review October 27, 2024 11:21
@cknitt cknitt marked this pull request as draft October 27, 2024 11:21
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.

4 participants