Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of WebAssembly version of Pixlet UI #1070

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading