Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Worked on gopherjs serve#1394

Merged
grantnelson-wf merged 2 commits intogopherjs:masterfrom
Workiva:serveUp1
Nov 4, 2025
Merged

Worked on gopherjs serve#1394
grantnelson-wf merged 2 commits intogopherjs:masterfrom
Workiva:serveUp1

Conversation

@grantnelson-wf
Copy link
Collaborator

@grantnelson-wf grantnelson-wf commented Nov 3, 2025

When I was working on the sourcemap and playground, I found that sometimes gopherjs serve couldn't find a file to serve.

For example, serving from github.com/[...]/gopherjs.github.io/playground/ would fail to find the internal/playground package (that package is in some of the ideas I've had for the playground). The requested file was github.com/[...]/gopherjs.github.io/playground/internal/playground. That file was not able to be found. I added another basic import call but would get no required module provides package [...]; to add it: go get [...]. So I added some other ways to quickly look up files without using import.

I also:

  • added some more logging for the serve so that we can see what and where it is finding these files if we set --log_level debug
  • added a method to create a sourcemapx.Filter that can be used with the playground
  • updated substr, that is deprecated, with substring. They are not one-to-one (see the substring link for details), but since we mostly use it to trim the start, with one exception that starts at 0, the difference between substr(start, length) and substring(start, end) looks like a drop in replacement for our code

@grantnelson-wf grantnelson-wf self-assigned this Nov 3, 2025
@grantnelson-wf grantnelson-wf marked this pull request as ready for review November 3, 2025 21:41
@grantnelson-wf grantnelson-wf merged commit 751ba01 into gopherjs:master Nov 4, 2025
10 checks passed
@grantnelson-wf grantnelson-wf deleted the serveUp1 branch November 4, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants