Compare commits

...

4 Commits

Author SHA1 Message Date
3541ce7492 1.8.1 2019-06-19 12:25:18 +01:00
b6fae0eb4c Hqx fix (#629)
* Optimising wasm so it doesn't break Chrome

* Simpler dockerfile (thanks surma!)
2019-06-19 12:24:24 +01:00
fbaa282f07 Update dependency ts-loader to v6.0.3 (#627)
Update dependency ts-loader to v6.0.3
2019-06-18 12:56:24 +01:00
6136ae7411 Update dependency ts-loader to v6.0.3 2019-06-18 11:30:57 +00:00
6 changed files with 45 additions and 33 deletions

View File

@ -1,7 +1,8 @@
FROM ubuntu
RUN apt-get update && \
apt-get install -qqy git build-essential cmake python2.7
RUN git clone --recursive https://github.com/WebAssembly/wabt /usr/src/wabt
RUN git clone --depth 1 --recursive https://github.com/WebAssembly/wabt /usr/src/wabt
RUN mkdir -p /usr/src/wabt/build
WORKDIR /usr/src/wabt/build
RUN cmake .. -DCMAKE_INSTALL_PREFIX=/opt/wabt && \
@ -14,5 +15,7 @@ RUN rustup install nightly && \
cargo install wasm-pack
COPY --from=0 /opt/wabt /opt/wabt
ENV PATH="/opt/wabt/bin:${PATH}"
RUN mkdir /opt/binaryen && \
curl -L https://github.com/WebAssembly/binaryen/releases/download/1.38.32/binaryen-1.38.32-x86-linux.tar.gz | tar -xzf - -C /opt/binaryen --strip 1
ENV PATH="/opt/binaryen:/opt/wabt/bin:${PATH}"
WORKDIR /src

View File

@ -9,6 +9,9 @@ echo "============================================="
rustup run nightly \
wasm-pack build --target no-modules
wasm-strip pkg/squooshhqx_bg.wasm
echo "Optimising WASM so it doesn't break Chrome (this takes like 10-15mins. get a cup of tea)"
echo "Once https://bugs.chromium.org/p/chromium/issues/detail?id=97480 is fixed, we can remove this step"
wasm-opt -Os --no-validation -o pkg/squooshhqx_bg.wasm pkg/squooshhqx_bg.wasm
rm pkg/.gitignore
)
echo "============================================="

Binary file not shown.

49
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "squoosh",
"version": "1.8.0",
"version": "1.8.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -5465,7 +5465,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -5486,12 +5487,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -5506,17 +5509,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -5633,7 +5639,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -5645,6 +5652,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -5659,6 +5667,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -5666,12 +5675,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -5690,6 +5701,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -5770,7 +5782,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -5782,6 +5795,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -5867,7 +5881,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -5903,6 +5918,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -5922,6 +5938,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -5965,12 +5982,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
@ -14164,9 +14183,9 @@
"dev": true
},
"ts-loader": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-6.0.2.tgz",
"integrity": "sha512-kkF3sGf3oBUehlvXI9fkbItbFTnNgGkYAz91vtWnsKAU4m+LAmQjuby7uTZNo3As+/zHLuyB052SkQDY6vLXtg==",
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-6.0.3.tgz",
"integrity": "sha512-iICBD4PryhnGNdtaDva49UGODHFVcuK7p4+G8CP1TVcUhTC4hkcy4MC2dzWwALSnpOzfUfA/4u8B2F64wsMgjQ==",
"dev": true,
"requires": {
"chalk": "^2.3.0",

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "squoosh",
"version": "1.8.0",
"version": "1.8.1",
"license": "apache-2.0",
"scripts": {
"start": "webpack-dev-server --host 0.0.0.0 --hot",
@ -59,7 +59,7 @@
"style-loader": "0.23.1",
"terser-webpack-plugin": "1.3.0",
"travis-size-report": "1.0.1",
"ts-loader": "6.0.2",
"ts-loader": "6.0.3",
"tslint": "5.17.0",
"tslint-config-airbnb": "5.11.1",
"tslint-config-semistandard": "8.0.1",

View File

@ -24,19 +24,6 @@ interface State {
const sizePresets = [0.25, 0.3333, 0.5, 1, 2, 3, 4];
/**
* Should we allow the user to select hqx? Chrome currently has a wasm bug, so we currently avoid it
* there, unless overridden.
* crbug.com/974804
*/
const allowHqx: boolean = (() => {
const url = new URL(location.href);
return url.searchParams.has('allow-hqx')
// Yep. UA sniffing. Let's hope we can remove this soon.
// Block browsers with Chrome/, unless they also have Edge/ (since the Edge UA includes Chrome/)
|| !navigator.userAgent.includes('Chrome/') || navigator.userAgent.includes('Edge/');
})();
export default class ResizerOptions extends Component<Props, State> {
state: State = {
maintainAspect: true,
@ -163,7 +150,7 @@ export default class ResizerOptions extends Component<Props, State> {
<option value="mitchell">Mitchell</option>
<option value="catrom">Catmull-Rom</option>
<option value="triangle">Triangle (bilinear)</option>
{allowHqx && <option value="hqx">hqx (pixel art)</option>}
<option value="hqx">hqx (pixel art)</option>
<option value="browser-pixelated">Browser pixelated</option>
<option value="browser-low">Browser low quality</option>
<option value="browser-medium">Browser medium quality</option>