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

Improving the Playground #970

Merged
merged 1 commit into from
Feb 28, 2025
Merged
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
11 changes: 5 additions & 6 deletions src/Playground.res
Original file line number Diff line number Diff line change
Expand Up @@ -1315,9 +1315,7 @@ module InitialContent = {
}
`

let since_10_1 = `@@jsxConfig({ version: 4, mode: "automatic" })
module CounterMessage = {
let since_10_1 = `module CounterMessage = {
Copy link
Contributor Author

@LeoLeBras LeoLeBras Feb 28, 2025

Choose a reason for hiding this comment

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

This is not straightforward for a beginner to understand @@jsxConfig({ version: 4, mode: "automatic" }). I don’t think it introduces any regressions, but could you confirm that @tsnobip ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, remove it.

@react.component
let make = (~count, ~username=?) => {
let times = switch count {
Expand Down Expand Up @@ -1347,9 +1345,10 @@ module App = {
<input
type_="text"
value={username}
onChange={evt => {
evt->ReactEvent.Form.preventDefault
let username = (evt->ReactEvent.Form.target)["value"]
onChange={event => {
event->ReactEvent.Form.preventDefault
let eventTarget = event->ReactEvent.Form.target
let username = eventTarget["value"]
setUsername(_prev => username)
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/common/EvalIFrame.res
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let css = `body {
background-color: inherit;
color: CanvasText;
color-scheme: light dark;
color-scheme: dark;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

works like a charm

Screen.Recording.2025-02-28.at.09.40.18.mov

Copy link
Member

Choose a reason for hiding this comment

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

Nice.

}`

let reactVersion = "18.2.0"
Expand Down