Skip to content

Commit

Permalink
Get rid of WebAssembly version of Pixlet UI
Browse files Browse the repository at this point in the history
This was added in #784, but was no longer being used or maintained. We may
build a WASM version Pixlet again in the future, but it would probably just be
the Starlark runtime.
  • Loading branch information
rohansingh committed May 6, 2024
1 parent 01442a4 commit 9746d09
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 480 deletions.
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else
TAGS =
endif

all: build wasm
all: build

test:
go test $(TAGS) -v -cover ./...
Expand Down Expand Up @@ -50,10 +50,4 @@ lint:
@ buildifier --version >/dev/null 2>&1 || $(MAKE) install-buildifier
buildifier -r ./

format: lint

wasm:
GOOS=js GOARCH=wasm go build -trimpath -ldflags="-s -w" -o ./src/pixlet.wasm tidbyt.dev/pixlet
mkdir -p ./src/go
cp -f $(shell go env GOROOT)/misc/wasm/wasm_exec.js ./src/go/wasm_exec.js
cp -f $(shell go list -m -f '{{.Dir}}' github.com/nlepage/go-wasm-http-server)/sw.js ./src/go/sw.js
format: lint
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ require (
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20220510032225-4f9f17eaec4c
github.com/nlepage/go-tarfs v1.2.1
github.com/nlepage/go-wasm-http-server v1.1.0
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/qri-io/starlib v0.5.1-0.20220611014110-7fb7ff9ec804
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
Expand Down Expand Up @@ -80,7 +79,6 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nlepage/go-js-promise v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,8 @@ github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20220510032225-4f9f17eaec4c h1:4RYnE0ISVwRxm9Dfo7utw1dh0kdRDEmVYq2MFVLy5zI=
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20220510032225-4f9f17eaec4c/go.mod h1:DvuJJ/w1Y59rG8UTDxsMk5U+UJXJwuvUgbiJSm9yhX8=
github.com/nlepage/go-js-promise v1.0.0 h1:K7OmJ3+0BgWJ2LfXchg2sI6RDr7AW/KWR8182epFwGQ=
github.com/nlepage/go-js-promise v1.0.0/go.mod h1:bdOP0wObXu34euibyK39K1hoBCtlgTKXGc56AGflaRo=
github.com/nlepage/go-tarfs v1.2.1 h1:o37+JPA+ajllGKSPfy5+YpsNHDjZnAoyfvf5GsUa+Ks=
github.com/nlepage/go-tarfs v1.2.1/go.mod h1:rno18mpMy9aEH1IiJVftFsqPyIpwqSUiAOpJYjlV2NA=
github.com/nlepage/go-wasm-http-server v1.1.0 h1:phw2NtSp71m/6NmGjE2veQ41PBPzWFcnE614cKucy5M=
github.com/nlepage/go-wasm-http-server v1.1.0/go.mod h1:xpffUeN97vuv8CTlMJ2oC5tPsftfPoG9HkAgI9gkiPI=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
},
"scripts": {
"start": "webpack serve --config webpack.dev.js",
"start:wasm": "make wasm && PIXLET_BACKEND=wasm webpack serve --config webpack.dev.js",
"build": "webpack --config webpack.prod.js",
"build:wasm": "make wasm && PIXLET_BACKEND=wasm webpack --config webpack.prod.js",
"clean": "rm -rf dist/static/ && git restore dist/",
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down Expand Up @@ -71,4 +69,4 @@
"react-router-dom": "6.23.0",
"react-simple-oauth2-login": "0.5.4"
}
}
}
14 changes: 0 additions & 14 deletions server/browser/serve_js.go

This file was deleted.

36 changes: 0 additions & 36 deletions src/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,6 @@ export default function Main() {
size = 8;
}

function iOS() {
return [
'iPad Simulator',
'iPhone Simulator',
'iPod Simulator',
'iPad',
'iPhone',
'iPod'
].includes(navigator.platform)
};

if (PIXLET_WASM && iOS()) {
return (
<ErrorSnackbar >
<AppBar />
<Container maxWidth='xl' sx={{ marginTop: '32px' }}>
<Box sx={{ flexGrow: 1 }}>
<Grid container spacing={4}>
<Grid item xs={12} lg={12}>
<Typography variant='h4' sx={{ textAlign: 'center' }} color='text.secondary'>
Sorry, iOS is not supported.
</Typography>
</Grid>
<Grid item xs={12} lg={12}>
<Typography sx={{ textAlign: 'center' }} color='text.secondary'>
Please try again on a desktop browser.
</Typography>
</Grid>
</Grid>
</Box>
</Container>
</ErrorSnackbar>
);
}


return (
<ErrorSnackbar >
<ParamSetter />
Expand Down
Loading

0 comments on commit 9746d09

Please sign in to comment.