Skip to content

Commit

Permalink
Move to the forked Sobek code
Browse files Browse the repository at this point in the history
There are still some leftover comments and names referencing goja that
need to be updated, but this compiles.

This closes #3772 and closes #3773
  • Loading branch information
mstoykov committed Jun 26, 2024
1 parent 20f8feb commit ccdf673
Show file tree
Hide file tree
Showing 96 changed files with 489 additions and 660 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ require (
github.com/PuerkitoBio/goquery v1.9.1
github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5
github.com/andybalholm/brotli v1.1.0
github.com/dop251/goja v0.0.0-20240610225006-393f6d42497b
github.com/evanw/esbuild v0.21.2
github.com/fatih/color v1.16.0
github.com/go-sourcemap/sourcemap v2.1.4+incompatible
github.com/golang/protobuf v1.5.4
github.com/gorilla/websocket v1.5.1
github.com/grafana/sobek v0.0.0-20240613124309-cb36746e8fee
github.com/grafana/sobek v0.0.0-20240611084759-1a77bdaf1a4a
github.com/grafana/xk6-browser v1.6.0
github.com/grafana/xk6-dashboard v0.7.4
github.com/grafana/xk6-output-prometheus-remote v0.4.0
Expand Down
7 changes: 3 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/dlclark/regexp2 v1.9.0 h1:pTK/l/3qYIKaRXuHnEnIf7Y5NxfRPfpb7dis6/gdlVI=
github.com/dlclark/regexp2 v1.9.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dop251/goja v0.0.0-20240610225006-393f6d42497b h1:fMKDnOAKCGXSZBphY/ilLtu7cmwMnjqE+xJxUkfkpCY=
github.com/dop251/goja v0.0.0-20240610225006-393f6d42497b/go.mod h1:o31y53rb/qiIAONF7w3FHJZRqqP3fzHUr1HqanthByw=
github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2 h1:OFTHt+yJDo/uaIKMGjEKzc3DGhrpQZoqvMUIloZv6ZY=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
Expand Down Expand Up @@ -83,8 +82,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/grafana/sobek v0.0.0-20240613124309-cb36746e8fee h1:KjQPRiLoSZMz+oMdEyh8fE/rurMpx3lpRH8PIR66nzo=
github.com/grafana/sobek v0.0.0-20240613124309-cb36746e8fee/go.mod h1:4uA93vCOP7fFfkAEByuRieuU72pAc5DH05b71yCIVsQ=
github.com/grafana/sobek v0.0.0-20240611084759-1a77bdaf1a4a h1:RE9WtCdu6yQ5kfHA5ophYdf2FSchssXt85USln9eks0=
github.com/grafana/sobek v0.0.0-20240611084759-1a77bdaf1a4a/go.mod h1:tUEHKWaMrxFGrMgjeAH85OEceCGQiSl6a/6Wckj/Vf4=
github.com/grafana/xk6-browser v1.6.0 h1:x8ZfBwiUJRRKNEw+Asr5ae9o2gFvYU1Ll/4dDMNIPZ8=
github.com/grafana/xk6-browser v1.6.0/go.mod h1:xLaGGhTMHIRsMvkVWFYh9RPy87kG2n4L4Or6DeI8U+o=
github.com/grafana/xk6-dashboard v0.7.4 h1:0ZRPTAXW+6A3Xqq/a/OaIZhxUt1SOMwUFff0IPwBHrs=
Expand Down
2 changes: 1 addition & 1 deletion js/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ BigInt(1231412444)`,
Expr, Error string
}{
"Array": {`[]`, "json: cannot unmarshal array into Go value of type lib.Options"},
"Function": {`function(){}`, "error parsing script options: json: unsupported type: func(goja.FunctionCall) goja.Value"},
"Function": {`function(){}`, "error parsing script options: json: unsupported type: func(sobek.FunctionCall) sobek.Value"},
}
for name, data := range invalidOptions {
t.Run(name, func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion js/compiler/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"sync"
"time"

"github.com/dop251/goja/parser"
"github.com/go-sourcemap/sourcemap"
"github.com/grafana/sobek"
"github.com/grafana/sobek/parser"
"github.com/sirupsen/logrus"

"go.k6.io/k6/lib"
Expand Down
4 changes: 2 additions & 2 deletions js/compiler/enhanced.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package compiler
import (
"path/filepath"

"github.com/dop251/goja/file"
"github.com/dop251/goja/parser"
"github.com/evanw/esbuild/pkg/api"
"github.com/grafana/sobek/file"
"github.com/grafana/sobek/parser"
)

func esbuildTransform(src, filename string) (code string, srcMap []byte, err error) {
Expand Down
2 changes: 1 addition & 1 deletion js/compiler/enhanced_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"testing"

"github.com/dop251/goja/parser"
"github.com/grafana/sobek"
"github.com/grafana/sobek/parser"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.k6.io/k6/lib"
Expand Down
2 changes: 1 addition & 1 deletion js/tc39/tc39_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"testing"
"time"

"github.com/dop251/goja/parser"
"github.com/grafana/sobek"
"github.com/grafana/sobek/parser"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.k6.io/k6/js/compiler"
Expand Down
15 changes: 0 additions & 15 deletions vendor/github.com/dop251/goja/LICENSE

This file was deleted.

Loading

0 comments on commit ccdf673

Please sign in to comment.