Skip to content

Update to Go 1.20 and React with line numbers#80

Open
grantnelson-wf wants to merge 3 commits intogopherjs:masterfrom
grantnelson-wf:updateTo1_19
Open

Update to Go 1.20 and React with line numbers#80
grantnelson-wf wants to merge 3 commits intogopherjs:masterfrom
grantnelson-wf:updateTo1_19

Conversation

@grantnelson-wf
Copy link
Copy Markdown

@grantnelson-wf grantnelson-wf commented Dec 9, 2025

I'm doing a lot of experimentation and improvements to the GopherJS playground.

@grantnelson-wf grantnelson-wf changed the title [WIP] Update to Go 1.19 and React with line numbers [WIP] Update to Go 1.20 and React with line numbers Jan 16, 2026
@grantnelson-wf grantnelson-wf force-pushed the updateTo1_19 branch 5 times, most recently from 378a7c1 to e9dfcbe Compare March 24, 2026 22:22
@grantnelson-wf grantnelson-wf changed the title [WIP] Update to Go 1.20 and React with line numbers Update to Go 1.20 and React with line numbers Mar 24, 2026
@grantnelson-wf grantnelson-wf marked this pull request as ready for review March 24, 2026 22:33
Copy link
Copy Markdown
Member

@nevkontakte nevkontakte left a comment

Choose a reason for hiding this comment

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

I'll be honest and admit that I gave a cursory look to most of the code here.

Personally, I feel like React is a bit of an overkill for what Playground is, but it's an iprovement over the status quo, and if nothing else a pretty useful tech demo, so I have no real objection.

Thanks!

}

// Run load synchronously to await for the package to be available.
srcs, _, err := r.cache.Load(path)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Shadowing here makes recursion a bit more confusing than necessary.

Copy link
Copy Markdown
Author

@grantnelson-wf grantnelson-wf Apr 29, 2026

Choose a reason for hiding this comment

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

I wasn't quite sure how to make that work so that we didn't send multiple network requests but could block on multiple asks for the same import. Although, just now, thinking about it, the browser itself typically has a debounce for multiple network requests of the same thing. So this probably can be simplified, I just hadn't thought of using the browser's network tools to see if I could simplify it. (Problem with tinkering on this on the side, I sometimes got something working and didn't leave TODOs nor remember to go back and make it work better.)

@grantnelson-wf
Copy link
Copy Markdown
Author

grantnelson-wf commented Apr 29, 2026

Personally, I feel like React is a bit of an overkill for what Playground is, but it's an iprovement over the status quo, and if nothing else a pretty useful tech demo, so I have no real objection.

Yeah, React is a little overkill. This totally was totally a tech demo (I wanted it in as much Go as possible) and a learning tool for me to try out things I haven't done much of before, and I probably went overboard since I was having fun. I tinkered on this project on the side for several months while waiting for some CI to finish, between meetings, and even during very slow boring meetings. It has lots of room for improvement and I hope many people add to it.

Note: I did find one bug but haven't gotten back around to fix it. If you have no imports the compiler doesn't automatically add runtime so it fails to compile. Should be an easy fix.

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

Labels

None yet

Projects

None yet

2 participants