-
Notifications
You must be signed in to change notification settings - Fork 471
Convert test sources from .re to .res #5678
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conversion looks good.
Left a bunch of comments about stale tests or tests with unclear utility. How about creating a separate issue as a reminder for these?
@@ -0,0 +1 @@ | |||
Js.log("Hello, ReScript!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate question: should we drop templates?
They're clearly several years stale, and probably add only negative value at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation suggests this: https://rescript-lang.org/docs/manual/latest/installation#new-project
and does not even mention the templates anymore.
So I'd say yes, let's remove them.
}]; | ||
*/ | ||
@react.component | ||
let rec make = (~foo, ()) => React.createElement(make, makeProps(~foo, ())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate question: this is not really testing the ppx. So not clear what this is testing here.
CC @mattdamon108 what kinds of JSX tests should be have here instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late.
I think we can put the js output test here. The JSX can be presumably tested by the js output either. In order to do that, some of the rescript-react modules need to be put here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe enough with tests in the syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax does not check that it type checks, or that the generated code does not change. So just adding a few .res
files here (and checking in the output) should be enough for the purpose of JSX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Correct. The tests are going to be type checked. It seems worthy. I'll put some needful tests here.
external setDisplayName: (component<'props>, string) => unit = "displayName" | ||
|
||
@get @return(nullable) | ||
external displayName: component<'props> => option<string> = "displayName" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate question: this is probably stale?
Also, what is it testing?
|
||
@val | ||
external unsafeAddStyle: (@as(json`{}`) _, style, {..}) => style = "Object.assign" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange to have such a large file in tests which are perf critical.
|
||
@module("react") external fragment: 'a = "Fragment" | ||
|
||
module Router = ReasonReactRouter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably stale too?
|
||
let createClass = | ||
factory(. reactComponent, reactIsValidElement, reactNoopUpdateQueue); | ||
let createClass = factory(. reactComponent, reactIsValidElement, reactNoopUpdateQueue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely very stale.
Tests in .ml syntax were not converted to .res yet.