DanSnow / astexplorer-go

23 stars 3 forks source link

upgrade to golang 1.18 #2

Open gengjiawen opened 3 years ago

gengjiawen commented 3 years ago

RT

DanSnow commented 3 years ago

Is there any new syntax in Golang 1.17?

TeddyDD commented 2 years ago

There are in 1.18. Bump :)

StevenACoffman commented 2 days ago

Already upgraded to Go 1.22

StevenACoffman commented 2 days ago

Thank you for contributing this!

@DanSnow it looks like you haven't published the 1.1.0 release to npm https://www.npmjs.com/package/astexplorer-go as 1.0.0 is latest there and in https://registry.yarnpkg.com/astexplorer-go/

Also Go 1.23 allows range over function and iterables.

StevenACoffman commented 2 days ago

For reference, this is where this package was added to astexplorer: https://github.com/fkling/astexplorer/pull/459

DanSnow commented 2 days ago

Hi @StevenACoffman,

Thanks for reminding me. I have upgraded the go version to 1.23 and released the 1.1.0. Would you like to test it and create a PR on the astexplorer side?

StevenACoffman commented 2 days ago

Done! https://github.com/fkling/astexplorer/pull/727

Thanks so much!

StevenACoffman commented 1 day ago

@DanSnow Using https://github.com/fkling/astexplorer/pull/727, when I try to run astexplorer locally I get an error:

ERROR in ./node_modules/astexplorer-go/parser.wasm
Module not found: Error: Can't resolve 'gojs' in '/Users/steve/Documents/git/astexplorer/website/node_modules/astexplorer-go'
 @ ./node_modules/astexplorer-go/parser.wasm
 @ ./node_modules/astexplorer-go/index.js
 @ ./src/parsers/go/go.js
 @ ./src/parsers sync ^\.\/(?!utils|transpilers)[^/]+\/(transformers\/([^/]+)\/)?(codeExample\.txt|[^/]+?\.js)$
 @ ./src/parsers/index.js
 @ ./src/storage/parse.js
 @ ./src/app.js

This is using Node 16 (since that is still max version supported for astexplorer). Steps to reproduce:

git clone git@github.com:StevenACoffman/astexplorer.git
cd astexplorer/website
yarn install
yarn build
StevenACoffman commented 1 day ago

It looks like when you changed the wasm_exec.js you didn't add the new https://github.com/golang/go/blob/go1.23.3/misc/wasm/wasm_exec_node.js file from when they split those into two files.

Dropping the wasm_exec_node.js file into my local astexplorer/website/node_modules/ doesn't fix it though. I'm not sure if index.js or go.js need to be updated, or the parser.wasm needs to be rebuilt or what.

BTW the Go 1.23.3 uses an identical https://github.com/golang/go/blob/go1.23.3/misc/wasm/wasm_exec.js as your current (and it looks like it's moving for Go 1.24 to https://github.com/golang/go/blob/master/lib/wasm/wasm_exec.js anyway)