Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .yarn/patches/@rescript-react-npm-0.14.0-e462ba0c5d.patch

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- Improve default argument type mismatch errors. https://github.com/rescript-lang/rescript/pull/8389
- Resolve workspace dependencies in editor analysis. https://github.com/rescript-lang/rescript/pull/8392
- Build system: Add OpenTelemetry tracing support for cli commands. https://github.com/rescript-lang/rescript/pull/8370
- Use a single vendored @rescript/react package across the repo. https://github.com/rescript-lang/rescript/pull/7525

#### :house: Internal

Expand Down
2 changes: 1 addition & 1 deletion analysis/examples/larger-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
},
"dependencies": {
"@glennsl/bs-json": "^5.0.4",
"@rescript/react": "^0.10.3"
"@rescript/react": "workspace:^"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep example dependency installable outside workspace

Switching this dependency to workspace:^ breaks standalone installs of analysis/examples/larger-project because this directory is not declared in the root workspaces list. Package managers then reject the manifest (Unsupported URL Type "workspace:"), making the example project unusable when installed on its own.

Useful? React with 👍 / 👎.

}
}
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"!**/tests/analysis_tests/**/src",
"!**/tests/build_tests/**/src",
"!**/tests/commonjs_tests/src",
"!**/tests/dependencies/**/src",
"!**/tests/docstring_tests",
"!**/tests/gentype_tests",
"**/tests/gentype_tests/typescript-react-example/**",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"tests/analysis_tests/**",
"tests/docstring_tests",
"tests/gentype_tests/**",
"tests/tests",
"tests/tools_tests",
"tests/commonjs_tests",
"scripts/res"
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"serve-bundle": "node serve-bundle.mjs"
},
"dependencies": {
"@rescript/react": "patch:@rescript/react@npm%3A0.14.0#~/.yarn/patches/@rescript-react-npm-0.14.0-e462ba0c5d.patch",
"@rescript/react": "workspace:^",
"rescript": "workspace:^"
},
"devDependencies": {
Expand Down
24 changes: 12 additions & 12 deletions tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
addTypeReference _none_:1:-1 --> ComponentAsProp.res:6:12
addTypeReference _none_:1:-1 --> ComponentAsProp.res:6:20
addTypeReference _none_:1:-1 --> ComponentAsProp.res:6:34
addValueReference ComponentAsProp.res:6:4 --> React.res:15:0
addValueReference ComponentAsProp.res:6:4 --> React.res:16:0
Scanning CreateErrorHandler1.cmt Source:CreateErrorHandler1.res
addValueDeclaration +notification CreateErrorHandler1.res:3:6 path:+CreateErrorHandler1.Error1
addValueReference CreateErrorHandler1.res:3:6 --> CreateErrorHandler1.res:3:21
Expand Down Expand Up @@ -157,7 +157,7 @@
addValueReference DeadTest.res:117:32 --> DeadTest.res:117:12
addValueReference DeadTest.res:117:19 --> React.res:7:0
addTypeReference _none_:1:-1 --> DeadTest.res:117:12
addValueReference DeadTest.res:117:4 --> React.res:15:0
addValueReference DeadTest.res:117:4 --> React.res:16:0
addValueReference DeadTest.res:119:16 --> DeadTest.res:117:4
addVariantCaseDeclaration A DeadTest.res:140:11 path:+DeadTest.WithInclude.t
addVariantCaseDeclaration A DeadTest.res:143:13 path:+DeadTest.WithInclude.T.t
Expand Down Expand Up @@ -299,10 +299,10 @@
addValueReference DynamicallyLoadedComponent.res:2:32 --> DynamicallyLoadedComponent.res:2:12
addValueReference DynamicallyLoadedComponent.res:2:19 --> React.res:7:0
addTypeReference _none_:1:-1 --> DynamicallyLoadedComponent.res:2:12
addValueReference DynamicallyLoadedComponent.res:2:4 --> React.res:15:0
addValueReference DynamicallyLoadedComponent.res:2:4 --> React.res:16:0
Scanning EmptyArray.cmt Source:EmptyArray.res
addValueDeclaration +make EmptyArray.res:5:6 path:+EmptyArray.Z
addValueReference EmptyArray.res:5:6 --> React.res:15:0
addValueReference EmptyArray.res:5:6 --> React.res:16:0
addValueReference EmptyArray.res:10:9 --> EmptyArray.res:5:6
Scanning ErrorHandler.cmt Source:ErrorHandler.res
addValueDeclaration +notify ErrorHandler.res:7:6 path:+ErrorHandler.Make
Expand Down Expand Up @@ -394,15 +394,15 @@
addValueReference Hooks.res:17:32 --> React.res:7:0
addValueReference Hooks.res:16:50 --> Hooks.res:16:32
addValueReference Hooks.res:16:37 --> React.res:7:0
addValueReference Hooks.res:16:16 --> React.res:15:0
addValueReference Hooks.res:16:16 --> React.res:16:0
addValueReference Hooks.res:19:5 --> ImportHookDefault.res:6:0
addValueReference Hooks.res:22:7 --> React.res:7:0
addValueReference Hooks.res:22:32 --> React.res:7:0
addValueReference Hooks.res:21:50 --> Hooks.res:21:32
addValueReference Hooks.res:21:37 --> React.res:7:0
addValueReference Hooks.res:21:16 --> React.res:15:0
addValueReference Hooks.res:21:16 --> React.res:16:0
addTypeReference _none_:1:-1 --> Hooks.res:4:12
addValueReference Hooks.res:4:4 --> React.res:15:0
addValueReference Hooks.res:4:4 --> React.res:16:0
addValueReference Hooks.res:28:4 --> Hooks.res:4:4
addRecordLabelDeclaration vehicle Hooks.res:32:14 path:+Hooks.Inner.props
addRecordLabelDeclaration vehicle Hooks.res:36:16 path:+Hooks.Inner.Inner2.props
Expand All @@ -414,7 +414,7 @@
addValueReference Hooks.res:32:66 --> Hooks.res:32:14
addValueReference Hooks.res:32:34 --> React.res:7:0
addTypeReference _none_:1:-1 --> Hooks.res:32:14
addValueReference Hooks.res:32:6 --> React.res:15:0
addValueReference Hooks.res:32:6 --> React.res:16:0
addRecordLabelDeclaration vehicle Hooks.res:36:16 path:+Hooks.Inner.Inner2.props
addRecordLabelDeclaration vehicle Hooks.res:36:16 path:+Hooks.Inner.Inner2.props
addTypeReference Hooks.res:36:68 --> Hooks.res:1:16
Expand All @@ -424,10 +424,10 @@
addValueReference Hooks.res:36:68 --> Hooks.res:36:16
addValueReference Hooks.res:36:36 --> React.res:7:0
addTypeReference _none_:1:-1 --> Hooks.res:36:16
addValueReference Hooks.res:36:8 --> React.res:15:0
addValueReference Hooks.res:36:8 --> React.res:16:0
addValueReference Hooks.res:42:25 --> React.res:3:0
addValueReference Hooks.res:42:25 --> React.res:3:0
addValueReference Hooks.res:42:6 --> React.res:15:0
addValueReference Hooks.res:42:6 --> React.res:16:0
addTypeReference Hooks.res:50:2 --> Hooks.res:1:16
addValueReference Hooks.res:48:4 --> Hooks.res:48:31
addTypeReference Hooks.res:50:14 --> Hooks.res:1:16
Expand All @@ -442,7 +442,7 @@
addValueReference Hooks.res:68:18 --> Hooks.res:68:18
addValueReference Hooks.res:68:4 --> Hooks.res:66:14
addTypeReference _none_:1:-1 --> Hooks.res:66:14
addValueReference Hooks.res:66:6 --> React.res:15:0
addValueReference Hooks.res:66:6 --> React.res:16:0
Scanning IgnoreInterface.cmt Source:IgnoreInterface.res
Scanning IgnoreInterface.cmti Source:IgnoreInterface.resi
Scanning ImmutableArray.cmt Source:ImmutableArray.res
Expand Down Expand Up @@ -966,7 +966,7 @@
Scanning JsxV4.cmt Source:JsxV4.res
addValueDeclaration +make JsxV4.res:4:23 path:+JsxV4.C
addValueReference JsxV4.res:4:36 --> React.res:3:0
addValueReference JsxV4.res:4:23 --> React.res:15:0
addValueReference JsxV4.res:4:23 --> React.res:16:0
addValueReference JsxV4.res:7:9 --> JsxV4.res:4:23
Scanning LetPrivate.cmt Source:LetPrivate.res
addValueDeclaration +y LetPrivate.res:7:4 path:+LetPrivate
Expand Down
2 changes: 1 addition & 1 deletion tests/analysis_tests/tests-reanalyze/deadcode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"clean": "rescript clean"
},
"dependencies": {
"@rescript/react": "link:../../../dependencies/rescript-react",
"@rescript/react": "workspace:^",
"rescript": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion tests/analysis_tests/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"clean": "rescript clean"
},
"dependencies": {
"@rescript/react": "link:../../dependencies/rescript-react",
"@rescript/react": "workspace:^",
"rescript": "workspace:^"
}
}
20 changes: 20 additions & 0 deletions tests/analysis_tests/tests/src/expected/Completion.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2054,6 +2054,26 @@ Path Res
"tags": [],
"detail": "module Result",
"documentation": null
}, {
"label": "RescriptReactErrorBoundary",
"kind": 9,
"tags": [],
"detail": "module RescriptReactErrorBoundary",
"documentation": null,
"data": {
"modulePath": "RescriptReactErrorBoundary",
"filePath": "src/Completion.res"
}
}, {
"label": "RescriptReactRouter",
"kind": 9,
"tags": [],
"detail": "module RescriptReactRouter",
"documentation": null,
"data": {
"modulePath": "RescriptReactRouter",
"filePath": "src/Completion.res"
}
}, {
"label": "RescriptTools",
"kind": 9,
Expand Down
4 changes: 2 additions & 2 deletions tests/analysis_tests/tests/src/expected/Fragment.res.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Hover src/Fragment.res 6:19
{"contents": {"kind": "markdown", "value": "```rescript\nReact.component<SectionHeader.props<React.element>>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C12%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype SectionHeader.props<'children> = {children: 'children}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Fragment.res%22%2C1%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n"}}
{"contents": {"kind": "markdown", "value": "```rescript\nReact.component<SectionHeader.props<React.element>>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype SectionHeader.props<'children> = {children: 'children}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Fragment.res%22%2C1%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n"}}

Hover src/Fragment.res 9:56
{"contents": {"kind": "markdown", "value": "```rescript\nReact.component<React.fragmentProps>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C12%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.fragmentProps = {children?: element}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C41%2C0%5D)\n"}}
{"contents": {"kind": "markdown", "value": "```rescript\nReact.component<React.fragmentProps>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.fragmentProps = {children?: element}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C42%2C0%5D)\n"}}

2 changes: 1 addition & 1 deletion tests/analysis_tests/tests/src/expected/JsxV4.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Path M4.make
}]

Hover src/JsxV4.res 14:9
{"contents": {"kind": "markdown", "value": "```rescript\nReact.component<M4.props<string, string, string>>\n```\n---\n Doc Comment For M4 \n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C12%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype M4.props<'first, 'fun, 'second> = {\n first: 'first,\n fun?: 'fun,\n second?: 'second,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxV4.res%22%2C3%2C2%5D)\n"}}
{"contents": {"kind": "markdown", "value": "```rescript\nReact.component<M4.props<string, string, string>>\n```\n---\n Doc Comment For M4 \n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype M4.props<'first, 'fun, 'second> = {\n first: 'first,\n fun?: 'fun,\n second?: 'second,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxV4.res%22%2C3%2C2%5D)\n"}}

Create Interface src/JsxV4.res
module M4: {
Expand Down
20 changes: 20 additions & 0 deletions tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ Path Res
"tags": [],
"detail": "module Result",
"documentation": null
}, {
"label": "RescriptReactErrorBoundary",
"kind": 9,
"tags": [],
"detail": "module RescriptReactErrorBoundary",
"documentation": null,
"data": {
"modulePath": "RescriptReactErrorBoundary",
"filePath": "src/RecoveryOnProp.res"
}
}, {
"label": "RescriptReactRouter",
"kind": 9,
"tags": [],
"detail": "module RescriptReactRouter",
"documentation": null,
"data": {
"modulePath": "RescriptReactRouter",
"filePath": "src/RecoveryOnProp.res"
}
}, {
"label": "RescriptTools",
"kind": 9,
Expand Down
2 changes: 2 additions & 0 deletions tests/dependencies/rescript-react/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.js
*.mjs
32 changes: 5 additions & 27 deletions tests/dependencies/rescript-react/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
{
"name": "@rescript/react",
"version": "0.14.0",
"private": true,
"version": "13.0.0-alpha.5",
"homepage": "https://rescript-lang.org",
"bugs": "https://github.com/rescript-lang/rescript/issues",
"repository": {
"type": "git",
"url": "git+https://github.com/rescript-lang/rescript.git"
},
"author": {
"name": "Hongbo Zhang",
"email": "bobzhang1988@gmail.com"
},
"maintainers": [
"Christoph Knittel (https://github.com/cknitt)",
"Cristiano Calcagno (https://github.com/cristianoc)",
"Dmitry Zakharov (https://github.com/DZakh)",
"Florian Hammerschmidt (https://github.com/fhammerschmidt)",
"Florian Verdonck (https://github.com/nojaf)",
"Gabriel Nordeborn (https://github.com/zth)",
"Hyeseong Kim (https://github.com/cometkim)",
"Jaap Frolich (https://github.com/jfrolich)",
"Matthias Le Brun (https://github.com/bloodyowl)",
"Patrick Ecker (https://github.com/ryyppy)",
"Paul Tsnobiladzé (https://github.com/tsnobip)",
"Shulhi Sapli (https://github.com/shulhi)",
"Woonki Moon (https://github.com/mununki)"
],
"preferUnplugged": true
"description": "React bindings for ReScript",
"dependencies": {
"rescript": "workspace:^"
}
}
Loading