Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

@rescript/runtime package#7796

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
cknitt merged 26 commits intomasterfromruntime-package
Aug 26, 2025
Merged

@rescript/runtime package#7796

cknitt merged 26 commits intomasterfromruntime-package
Aug 26, 2025

Conversation

@cknitt
Copy link
Member

@cknittcknitt commentedAug 24, 2025
edited
Loading

This builds on@cometkim's work in#7483 to extract the runtime files from the mainrescript package into a new package@rescript/runtime, resolving a part of#6183.

Removal of@rescript/std shall be done in a separate PR.

@cknittcknittforce-pushed theruntime-package branch 2 times, most recently from9a5d72b to4d7b90dCompareAugust 24, 2025 10:17
@pkg-pr-new
Copy link

pkg-pr-newbot commentedAug 24, 2025
edited
Loading

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7796

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7796

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7796

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7796

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7796

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@7796

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7796

commit:5f4e6aa

@cknittcknitt marked this pull request as ready for reviewAugust 24, 2025 12:08
@cknittcknitt requested a review fromzthAugust 24, 2025 12:09
@nojaf
Copy link
Member

So, how would this work? I install rescript, and@rescript/runtime is installed as well?
Initial compile will do the one time compilation of the runtime?
Arescript clean never cleans the runtime?

I was expecting apackage.json inpackages/@rescript/runtime, don't we need that?

@cknitt
Copy link
MemberAuthor

So, how would this work? I install rescript, and@rescript/runtime is installed as well?

Yes, it's installed automatically as a dependency of therescript package, like the bin package for the platform.

Initial compile will do the one time compilation of the runtime? Arescript clean never cleans the runtime?

No, it is precompiled like it was before, nothing changed there. Only the artifacts (lib/ocaml, lib/es6, lib/js) are moved from therescript package to the new@rescript/runtime package.

I was expecting apackage.json inpackages/@rescript/runtime, don't we need that?

It's there:https://github.com/rescript-lang/rescript/blob/runtime-package/packages/%40rescript/runtime/package.json

@nojaf
Copy link
Member

I see, this is more of a first step in a larger plan.

@mediremi
Copy link
Member

Will not includingres(i) files in@rescript/runtime break "go to definition" for stdlib functions?

@cknitt
Copy link
MemberAuthor

Will not includingres(i) files in@rescript/runtime break "go to definition" for stdlib functions?

Maybe the commit message was not good, the last commit just prevents them from being included in the package rootin addition tolib/ocaml. They are not really required in the package root. "Go to definition" jumps to the source files inlib/ocaml.

mediremi reacted with thumbs up emoji

let files=
dirs|>StringSet.elements
|>List.map (funname ->Files.collect name isSourceFile)
|>List.map (funname ->Files.collect~maxDepth:2name isSourceFile)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Curious, why is amaxDepth needed after this PR?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This part is from@cometkim.

From what I have seen, infinite recursion can occur during module resolution without it becauserescript depends on@rescript/runtime, but@rescript/runtime also hasrescript as a dev dependency.

Maybe we should add a comment there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah a comment would be good.

Copy link
Collaborator

@cristianoccristianoc left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Just a minor Q: is "lib/ocaml" something we want to rename here, or perhaps later to keep changes self contained.
Unless it's the correct name for some legacy reason or other tooling back comp.

@cknitt
Copy link
MemberAuthor

Just a minor Q: is "lib/ocaml" something we want to rename here, or perhaps later to keep changes self contained. Unless it's the correct name for some legacy reason or other tooling back comp.

Would be nice to change the name of this folder, but I think this is outside the scope of this PR and will also most probably break some tooling.

@cknittcknitt merged commitbfec8a2 intomasterAug 26, 2025
48 of 49 checks passed
@cknittcknitt deleted the runtime-package branchAugust 26, 2025 13:47
ifFiles.exists paththenSome path
elseifFilename.dirname startPath= startPaththenNone
else resolveNodeModulePath~startPath:(Filename.dirname startPath) name
if name="@rescript/runtime"then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't remember exactly, but this is incomplete code. I think this is incompatible with theexternal-stdlib feature already.

I tried rewriting it to avoid relying on ninja's special stdlib resolution rules, but I wasn't successful. The current resolution rules still heavily rely on thenode_modules directory structure and the runtime package name, which could be broken by package managers' storage design.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, the module resolution in analysis/tools definitely has issues and should be revisited.

It does not work with workspace dependencies as can be seen here and also in#7525.

/cc@zth

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't know much about the module resolution. What's the problem? Is it problem we handle as we should elsewhere but not in analysis/tools?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@zthzthzth left review comments

@cometkimcometkimcometkim left review comments

@cristianoccristianoccristianoc approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@cknitt@nojaf@mediremi@zth@cristianoc@cometkim

[8]ページ先頭

©2009-2025 Movatter.jp