Merge remote-tracking branch 'origin/develop' into release/2023-02-01

This commit is contained in:
tomlum 2023-02-01 20:39:04 +00:00
commit 6d655b48bf
17 changed files with 150 additions and 351 deletions

View file

@ -165,7 +165,6 @@ the beginning of the command, before `npm start`:
| `ASSET_HOST` | `https://assets.scratch.mit.edu` | Hostname for asset requests |
| `BACKPACK_HOST` | `https://backpack.scratch.mit.edu` | Hostname for backpack requests |
| `PROJECT_HOST` | `https://projects.scratch.mit.edu` | Hostname for project requests |
| `SENTRY_DSN` | `''` | DSN for Sentry |
| `FALLBACK` | `''` | Pass-through location for old site |
| `GA_TRACKER` | `''` | Where to log Google Analytics data |
| `NODE_ENV` | `null` | If not `production`, app acts like development |

286
package-lock.json generated
View file

@ -9,7 +9,6 @@
"version": "1.0.0",
"license": "BSD-3-Clause",
"dependencies": {
"@sentry/browser": "4.4.2",
"bunyan": "1.8.15",
"clipboard-copy": "2.0.1",
"express": "4.16.1",
@ -93,14 +92,15 @@
"react-slick": "0.16.0",
"react-string-replace": "0.4.1",
"react-telephone-input": "4.3.4",
"react-test-renderer": "16.14.0",
"redux": "3.5.2",
"redux-mock-store": "1.5.4",
"redux-thunk": "2.0.1",
"regenerator-runtime": "0.13.9",
"sass": "1.49.7",
"sass-loader": "10.2.1",
"scratch-gui": "1.3.5",
"scratch-l10n": "3.15.20230110032123",
"scratch-gui": "1.3.10",
"scratch-l10n": "3.15.20230130032254",
"selenium-webdriver": "4.1.0",
"slick-carousel": "1.6.0",
"style-loader": "0.12.3",
@ -1645,81 +1645,6 @@
"node": ">=8.0.0"
}
},
"node_modules/@sentry/browser": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-4.4.2.tgz",
"integrity": "sha512-km5p3hPz+aoY4UiEvYxAdRJAbIK30urZSuMs/3zAUVe+8Zij0IHjHmdi9JtrMqpn+rAcWCxtRmFSYlkiKjdSUg==",
"dependencies": {
"@sentry/core": "4.4.2",
"@sentry/types": "4.4.2",
"@sentry/utils": "4.4.2",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/core": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-4.4.2.tgz",
"integrity": "sha512-hJyAodTCf4sZfVdf41Rtuzj4EsyzYq5rdMZ+zc2Vinwdf8D0/brHe91fHeO0CKXEb2P0wJsrjwMidG/ccq/M8A==",
"dependencies": {
"@sentry/hub": "4.4.2",
"@sentry/minimal": "4.4.2",
"@sentry/types": "4.4.2",
"@sentry/utils": "4.4.2",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/hub": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-4.4.2.tgz",
"integrity": "sha512-oe9ytXkTWyD+QmOpVzHAqTbRV4Hc0ee2Nt6HvrDtRmlXzQxfvTWG2F8KYT6w8kzqg5klnuRpnsmgTTV3KuNBVQ==",
"dependencies": {
"@sentry/types": "4.4.2",
"@sentry/utils": "4.4.2",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/minimal": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-4.4.2.tgz",
"integrity": "sha512-GEZZiNvVgqFAESZhAe3vjwTInn13lI2bSI3ItQN4RUWKL/W4n/fwVoDJbkb1U8aWxanuMnRDEpKwyQv6zYTZfw==",
"dependencies": {
"@sentry/hub": "4.4.2",
"@sentry/types": "4.4.2",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/types": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-4.4.2.tgz",
"integrity": "sha512-QyQd6PKKIyjJgaq/RQjsxPJEWbXcuiWZ9RvSnhBjS5jj53HEzkM1qkbAFqlYHJ1DTJJ1EuOM4+aTmGzHe93zuA==",
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/utils": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-4.4.2.tgz",
"integrity": "sha512-j/Ad8G1abHlJdD2q7aWWbSOSeWB5M5v1R1VKL8YPlwEbSvvmEQWePhBKFI0qlnKd2ObdUQsj86pHEXJRSFNfCw==",
"dependencies": {
"@sentry/types": "4.4.2",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sindresorhus/is": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
@ -20568,15 +20493,6 @@
"react-is": "^16.8.1"
}
},
"node_modules/react-test-renderer/node_modules/scheduler": {
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz",
"integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==",
"dependencies": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
}
},
"node_modules/react-tooltip": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-3.8.0.tgz",
@ -23084,21 +23000,39 @@
}
},
"node_modules/scratch-blocks": {
"version": "0.1.0-prerelease.20230110085824",
"resolved": "https://registry.npmjs.org/scratch-blocks/-/scratch-blocks-0.1.0-prerelease.20230110085824.tgz",
"integrity": "sha512-GHoE6UH67bB5OLRrPFl/cMHiq7fed0R111sS2QtjxRPLz40uXAvKYE6xphFxYY4z2bvOz1KM0Ya1sg0zsBYMIw==",
"version": "0.1.0-prerelease.20230113103241",
"resolved": "https://registry.npmjs.org/scratch-blocks/-/scratch-blocks-0.1.0-prerelease.20230113103241.tgz",
"integrity": "sha512-bQgjkm54gr820GLZ4E9mYlKYTVdDnt5DcA6BOImiFgyBScdKfRnycuh0cMGJnJeQ1JcyVEX1uezre8Wix91mWQ==",
"dev": true,
"dependencies": {
"exports-loader": "0.7.0",
"google-closure-library": "20190301.0.0",
"imports-loader": "0.8.0",
"scratch-l10n": "3.15.20230110032123"
"scratch-l10n": "3.15.20230113032113"
}
},
"node_modules/scratch-blocks/node_modules/scratch-l10n": {
"version": "3.15.20230113032113",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.15.20230113032113.tgz",
"integrity": "sha512-q5//oIbED4o3VznMCFnbJH1vEtJwXUgWhEEHqdGGrysl/kp90X/F82YznCpCb042XpZy6FfS1X/YfcGvLRz6bA==",
"dev": true,
"dependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@transifex/api": "4.2.5",
"babel-plugin-react-intl": "^3.0.1",
"download": "^8.0.0",
"transifex": "1.6.6"
},
"bin": {
"build-i18n-src": "scripts/build-i18n-src.js",
"tx-push-src": "scripts/tx-push-src.js"
}
},
"node_modules/scratch-gui": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-1.3.5.tgz",
"integrity": "sha512-EOgNxudEtwNm9USdou9uWvrPlhUXffctEvRyScGxmkvtkhag4sA1zxFuJEAldUj0TDcUbFwKDaIzqZsmvNcHTg==",
"version": "1.3.10",
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-1.3.10.tgz",
"integrity": "sha512-mtPpJ8PP1M0uuLqA0SU+7hTP21uYm/mK7ixuqNPeaFgLjVTxLm7q9w8PKIetmYeRr6hiQXrqZOQ8YSAPp2NH3A==",
"dev": true,
"dependencies": {
"arraybuffer-loader": "^1.0.6",
@ -23149,14 +23083,14 @@
"redux": "3.7.2",
"redux-throttle": "0.1.1",
"scratch-audio": "0.1.0-prerelease.20221123180128",
"scratch-blocks": "0.1.0-prerelease.20230110085824",
"scratch-l10n": "3.15.20230110032123",
"scratch-blocks": "0.1.0-prerelease.20230113103241",
"scratch-l10n": "3.15.20230113032113",
"scratch-paint": "1.1.31",
"scratch-render": "0.1.0-prerelease.20221121051603",
"scratch-render-fonts": "1.0.0-prerelease.20221102164332",
"scratch-storage": "2.0.2",
"scratch-svg-renderer": "0.2.0-prerelease.20221120235613",
"scratch-vm": "1.3.14",
"scratch-vm": "1.3.18",
"startaudiocontext": "1.2.1",
"style-loader": "^0.23.0",
"text-encoding": "0.7.0",
@ -23433,6 +23367,24 @@
"symbol-observable": "^1.0.3"
}
},
"node_modules/scratch-gui/node_modules/scratch-l10n": {
"version": "3.15.20230113032113",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.15.20230113032113.tgz",
"integrity": "sha512-q5//oIbED4o3VznMCFnbJH1vEtJwXUgWhEEHqdGGrysl/kp90X/F82YznCpCb042XpZy6FfS1X/YfcGvLRz6bA==",
"dev": true,
"dependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@transifex/api": "4.2.5",
"babel-plugin-react-intl": "^3.0.1",
"download": "^8.0.0",
"transifex": "1.6.6"
},
"bin": {
"build-i18n-src": "scripts/build-i18n-src.js",
"tx-push-src": "scripts/tx-push-src.js"
}
},
"node_modules/scratch-gui/node_modules/scratch-paint": {
"version": "1.1.31",
"resolved": "https://registry.npmjs.org/scratch-paint/-/scratch-paint-1.1.31.tgz",
@ -23515,9 +23467,9 @@
}
},
"node_modules/scratch-l10n": {
"version": "3.15.20230110032123",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.15.20230110032123.tgz",
"integrity": "sha512-YSIKWDeuz/Dx1k6NiPcu7No9iq0LaVBIBSGFoIhuYTMl0ew0kUFymdMVACCuHsvI/W24s9RR5sW/hRXZlksrYQ==",
"version": "3.15.20230130032254",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.15.20230130032254.tgz",
"integrity": "sha512-VplV2dRwy5kvL49Nl5m2pPqpRipZpHwy9d+aCyc/Od5uhgYO7uofGhXy3pWq5FcLnlanJUMoZd8qQcpjv0h+lg==",
"dev": true,
"dependencies": {
"@babel/cli": "^7.1.2",
@ -23715,9 +23667,9 @@
"dev": true
},
"node_modules/scratch-vm": {
"version": "1.3.14",
"resolved": "https://registry.npmjs.org/scratch-vm/-/scratch-vm-1.3.14.tgz",
"integrity": "sha512-P1l6oFzEObNP2WoO8N9bs2BqZ3ZvY/YrvzHeq14OC2i4l6BTbGX3tZiuPAAeVXTCodZKrssO/ny027jKYTqfkg==",
"version": "1.3.18",
"resolved": "https://registry.npmjs.org/scratch-vm/-/scratch-vm-1.3.18.tgz",
"integrity": "sha512-qL/WYZqsvVPc2vXTjdQOxXfuXwm5eY9989yC2jw1JWYvU6WkOr2oCbu0BHaY9FLP2A0XYJ+i8CEPju+zeay2RA==",
"dev": true,
"dependencies": {
"@vernier/godirect": "1.5.0",
@ -33018,63 +32970,6 @@
"integrity": "sha512-cphYw/y/l36UJ8fv/LXyK+lHlxMXtoydJUsgA4u5QnaUaSZYepuSHik6PewJGT4qvaPwT5ImvHWwX2kElWXvoQ==",
"dev": true
},
"@sentry/browser": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-4.4.2.tgz",
"integrity": "sha512-km5p3hPz+aoY4UiEvYxAdRJAbIK30urZSuMs/3zAUVe+8Zij0IHjHmdi9JtrMqpn+rAcWCxtRmFSYlkiKjdSUg==",
"requires": {
"@sentry/core": "4.4.2",
"@sentry/types": "4.4.2",
"@sentry/utils": "4.4.2",
"tslib": "^1.9.3"
}
},
"@sentry/core": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-4.4.2.tgz",
"integrity": "sha512-hJyAodTCf4sZfVdf41Rtuzj4EsyzYq5rdMZ+zc2Vinwdf8D0/brHe91fHeO0CKXEb2P0wJsrjwMidG/ccq/M8A==",
"requires": {
"@sentry/hub": "4.4.2",
"@sentry/minimal": "4.4.2",
"@sentry/types": "4.4.2",
"@sentry/utils": "4.4.2",
"tslib": "^1.9.3"
}
},
"@sentry/hub": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-4.4.2.tgz",
"integrity": "sha512-oe9ytXkTWyD+QmOpVzHAqTbRV4Hc0ee2Nt6HvrDtRmlXzQxfvTWG2F8KYT6w8kzqg5klnuRpnsmgTTV3KuNBVQ==",
"requires": {
"@sentry/types": "4.4.2",
"@sentry/utils": "4.4.2",
"tslib": "^1.9.3"
}
},
"@sentry/minimal": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-4.4.2.tgz",
"integrity": "sha512-GEZZiNvVgqFAESZhAe3vjwTInn13lI2bSI3ItQN4RUWKL/W4n/fwVoDJbkb1U8aWxanuMnRDEpKwyQv6zYTZfw==",
"requires": {
"@sentry/hub": "4.4.2",
"@sentry/types": "4.4.2",
"tslib": "^1.9.3"
}
},
"@sentry/types": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-4.4.2.tgz",
"integrity": "sha512-QyQd6PKKIyjJgaq/RQjsxPJEWbXcuiWZ9RvSnhBjS5jj53HEzkM1qkbAFqlYHJ1DTJJ1EuOM4+aTmGzHe93zuA=="
},
"@sentry/utils": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-4.4.2.tgz",
"integrity": "sha512-j/Ad8G1abHlJdD2q7aWWbSOSeWB5M5v1R1VKL8YPlwEbSvvmEQWePhBKFI0qlnKd2ObdUQsj86pHEXJRSFNfCw==",
"requires": {
"@sentry/types": "4.4.2",
"tslib": "^1.9.3"
}
},
"@sindresorhus/is": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
@ -49072,15 +48967,6 @@
"object-assign": "^4.1.1",
"react-is": "^16.8.1"
}
},
"scheduler": {
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz",
"integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
}
}
}
},
@ -51097,21 +50983,37 @@
}
},
"scratch-blocks": {
"version": "0.1.0-prerelease.20230110085824",
"resolved": "https://registry.npmjs.org/scratch-blocks/-/scratch-blocks-0.1.0-prerelease.20230110085824.tgz",
"integrity": "sha512-GHoE6UH67bB5OLRrPFl/cMHiq7fed0R111sS2QtjxRPLz40uXAvKYE6xphFxYY4z2bvOz1KM0Ya1sg0zsBYMIw==",
"version": "0.1.0-prerelease.20230113103241",
"resolved": "https://registry.npmjs.org/scratch-blocks/-/scratch-blocks-0.1.0-prerelease.20230113103241.tgz",
"integrity": "sha512-bQgjkm54gr820GLZ4E9mYlKYTVdDnt5DcA6BOImiFgyBScdKfRnycuh0cMGJnJeQ1JcyVEX1uezre8Wix91mWQ==",
"dev": true,
"requires": {
"exports-loader": "0.7.0",
"google-closure-library": "20190301.0.0",
"imports-loader": "0.8.0",
"scratch-l10n": "3.15.20230110032123"
"scratch-l10n": "3.15.20230113032113"
},
"dependencies": {
"scratch-l10n": {
"version": "3.15.20230113032113",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.15.20230113032113.tgz",
"integrity": "sha512-q5//oIbED4o3VznMCFnbJH1vEtJwXUgWhEEHqdGGrysl/kp90X/F82YznCpCb042XpZy6FfS1X/YfcGvLRz6bA==",
"dev": true,
"requires": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@transifex/api": "4.2.5",
"babel-plugin-react-intl": "^3.0.1",
"download": "^8.0.0",
"transifex": "1.6.6"
}
}
}
},
"scratch-gui": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-1.3.5.tgz",
"integrity": "sha512-EOgNxudEtwNm9USdou9uWvrPlhUXffctEvRyScGxmkvtkhag4sA1zxFuJEAldUj0TDcUbFwKDaIzqZsmvNcHTg==",
"version": "1.3.10",
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-1.3.10.tgz",
"integrity": "sha512-mtPpJ8PP1M0uuLqA0SU+7hTP21uYm/mK7ixuqNPeaFgLjVTxLm7q9w8PKIetmYeRr6hiQXrqZOQ8YSAPp2NH3A==",
"dev": true,
"requires": {
"arraybuffer-loader": "^1.0.6",
@ -51162,14 +51064,14 @@
"redux": "3.7.2",
"redux-throttle": "0.1.1",
"scratch-audio": "0.1.0-prerelease.20221123180128",
"scratch-blocks": "0.1.0-prerelease.20230110085824",
"scratch-l10n": "3.15.20230110032123",
"scratch-blocks": "0.1.0-prerelease.20230113103241",
"scratch-l10n": "3.15.20230113032113",
"scratch-paint": "1.1.31",
"scratch-render": "0.1.0-prerelease.20221121051603",
"scratch-render-fonts": "1.0.0-prerelease.20221102164332",
"scratch-storage": "2.0.2",
"scratch-svg-renderer": "0.2.0-prerelease.20221120235613",
"scratch-vm": "1.3.14",
"scratch-vm": "1.3.18",
"startaudiocontext": "1.2.1",
"style-loader": "^0.23.0",
"text-encoding": "0.7.0",
@ -51392,6 +51294,20 @@
"symbol-observable": "^1.0.3"
}
},
"scratch-l10n": {
"version": "3.15.20230113032113",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.15.20230113032113.tgz",
"integrity": "sha512-q5//oIbED4o3VznMCFnbJH1vEtJwXUgWhEEHqdGGrysl/kp90X/F82YznCpCb042XpZy6FfS1X/YfcGvLRz6bA==",
"dev": true,
"requires": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@transifex/api": "4.2.5",
"babel-plugin-react-intl": "^3.0.1",
"download": "^8.0.0",
"transifex": "1.6.6"
}
},
"scratch-paint": {
"version": "1.1.31",
"resolved": "https://registry.npmjs.org/scratch-paint/-/scratch-paint-1.1.31.tgz",
@ -51456,9 +51372,9 @@
}
},
"scratch-l10n": {
"version": "3.15.20230110032123",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.15.20230110032123.tgz",
"integrity": "sha512-YSIKWDeuz/Dx1k6NiPcu7No9iq0LaVBIBSGFoIhuYTMl0ew0kUFymdMVACCuHsvI/W24s9RR5sW/hRXZlksrYQ==",
"version": "3.15.20230130032254",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.15.20230130032254.tgz",
"integrity": "sha512-VplV2dRwy5kvL49Nl5m2pPqpRipZpHwy9d+aCyc/Od5uhgYO7uofGhXy3pWq5FcLnlanJUMoZd8qQcpjv0h+lg==",
"dev": true,
"requires": {
"@babel/cli": "^7.1.2",
@ -51653,9 +51569,9 @@
"dev": true
},
"scratch-vm": {
"version": "1.3.14",
"resolved": "https://registry.npmjs.org/scratch-vm/-/scratch-vm-1.3.14.tgz",
"integrity": "sha512-P1l6oFzEObNP2WoO8N9bs2BqZ3ZvY/YrvzHeq14OC2i4l6BTbGX3tZiuPAAeVXTCodZKrssO/ny027jKYTqfkg==",
"version": "1.3.18",
"resolved": "https://registry.npmjs.org/scratch-vm/-/scratch-vm-1.3.18.tgz",
"integrity": "sha512-qL/WYZqsvVPc2vXTjdQOxXfuXwm5eY9989yC2jw1JWYvU6WkOr2oCbu0BHaY9FLP2A0XYJ+i8CEPju+zeay2RA==",
"dev": true,
"requires": {
"@vernier/godirect": "1.5.0",

View file

@ -44,7 +44,6 @@
},
"homepage": "https://github.com/llk/scratch-www#readme",
"dependencies": {
"@sentry/browser": "4.4.2",
"bunyan": "1.8.15",
"clipboard-copy": "2.0.1",
"express": "4.16.1",
@ -128,14 +127,15 @@
"react-slick": "0.16.0",
"react-string-replace": "0.4.1",
"react-telephone-input": "4.3.4",
"react-test-renderer": "16.14.0",
"redux": "3.5.2",
"redux-mock-store": "1.5.4",
"redux-thunk": "2.0.1",
"regenerator-runtime": "0.13.9",
"sass": "1.49.7",
"sass-loader": "10.2.1",
"scratch-gui": "1.3.5",
"scratch-l10n": "3.15.20230110032123",
"scratch-gui": "1.3.10",
"scratch-l10n": "3.15.20230130032254",
"selenium-webdriver": "4.1.0",
"slick-carousel": "1.6.0",
"style-loader": "0.12.3",

View file

@ -1,6 +1,5 @@
const PropTypes = require('prop-types');
const React = require('react');
const Sentry = require('@sentry/browser');
const CrashMessageComponent = require('../crashmessage/crashmessage.jsx');
import log from '../../lib/log.js';
@ -9,28 +8,37 @@ class ErrorBoundary extends React.Component {
constructor (props) {
super(props);
this.state = {
hasError: false,
errorId: null
error: null,
errorInfo: null
};
}
/**
* Handle an error caught by this ErrorBoundary component.
* @param {Error} error - the error that was caught.
* @param {React.ErrorInfo} errorInfo - the React error info associated with the error.
*/
componentDidCatch (error, errorInfo) {
// Display fallback UI
Sentry.withScope(scope => {
scope.setTag('project', 'scratch-www');
if (this.props.componentName) {
scope.setTag('component', this.props.componentName);
}
Object.keys(errorInfo).forEach(key => {
scope.setExtra(key, errorInfo[key]);
error = error || {
stack: 'Unknown stack',
message: 'Unknown error'
};
errorInfo = errorInfo || {
componentStack: 'Unknown component stack'
};
// only remember the first error: later errors might just be side effects of that first one
if (!this.state.error) {
// store error & errorInfo for debugging
this.setState({
error,
errorInfo
});
Sentry.captureException(error);
});
this.setState({
hasError: true,
errorId: Sentry.lastEventId()
});
log.error(`Unhandled Error: ${error}, info: ${errorInfo}`);
}
// report every error in the console
const componentInfo = this.props.componentName ? ` in ${this.props.componentName}` : '';
log.error(`Unhandled Error${componentInfo}: ${error.stack}\nComponent stack: ${errorInfo.componentStack}`);
}
handleBack () {
@ -38,10 +46,9 @@ class ErrorBoundary extends React.Component {
}
render () {
if (this.state.hasError) {
if (this.state.error) {
return (
<CrashMessageComponent
eventId={this.state.errorId}
onBack={this.handleBack}
/>
);

View file

@ -106,6 +106,7 @@
display: flex;
margin-bottom: 2rem;
color: $ui-white;
width: 100%;
img {
padding-right: .5rem;

View file

@ -1,18 +0,0 @@
const initSentry = () => {
// initialize Sentry instance, making sure it hasn't been initialized already
if (!window.Sentry && `${process.env.SENTRY_DSN}` !== '') {
const Sentry = require('@sentry/browser');
Sentry.init({
dsn: `${process.env.SENTRY_DSN}`,
// Do not collect global onerror, only collect specifically from React error boundaries.
// TryCatch plugin also includes errors from setTimeouts (i.e. the VM)
integrations: integrations => integrations.filter(i =>
!(i.name === 'GlobalHandlers' || i.name === 'TryCatch'))
});
window.Sentry = Sentry; // Allow GUI access to Sentry via window
}
};
module.exports = initSentry;

View file

@ -39,7 +39,7 @@ class EV3 extends ExtensionLanding {
renderCopy={
<FlexRow className="column extension-copy">
<h1><img
alt=""
alt="ev3.svg"
src="/images/ev3/ev3.svg"
/>LEGO MINDSTORMS EV3</h1>
<FormattedMessage

View file

@ -3,9 +3,6 @@ const render = require('../../lib/render.jsx');
const Scratch3Registration = require('../../components/registration/scratch3-registration.jsx');
const ErrorBoundary = require('../../components/errorboundary/errorboundary.jsx');
const initSentry = require('../../lib/sentry.js');
initSentry();
require('./join.scss');
const Register = () => (
<ErrorBoundary componentName="Join">

View file

@ -14,9 +14,6 @@ const previewActions = require('../../redux/preview.js');
const GUI = require('scratch-gui');
const IntlGUI = injectIntl(GUI.default);
const initSentry = require('../../lib/sentry.js');
initSentry();
class EmbedView extends React.Component {
constructor (props) {
super(props);

View file

@ -39,9 +39,7 @@ const IntlGUI = injectIntl(GUI.default);
const localStorageAvailable = 'localStorage' in window && window.localStorage !== null;
const initSentry = require('../../lib/sentry.js');
const xhr = require('xhr');
initSentry();
class Preview extends React.Component {
constructor (props) {

View file

@ -55,7 +55,6 @@
cursor: pointer;
&:before {
opacity: .5;
background-image: url("/svgs/project/love-gray.svg");
}
}
@ -63,7 +62,6 @@
.project-loves.loved {
&:before {
opacity: 1;
background-image: url("/svgs/project/love-red.svg");
}
}
@ -73,7 +71,6 @@
cursor: pointer;
&:before {
opacity: .5;
background-image: url("/svgs/project/fav-gray.svg");
}
}
@ -81,7 +78,6 @@
.project-favorites.favorited {
&:before {
opacity: 1;
background-image: url("/svgs/project/fav-yellow.svg");
}
}
@ -89,7 +85,6 @@
.project-remixes {
&:before {
opacity: .5;
background-image: url("/svgs/project/remix-gray.svg");
}
}
@ -97,7 +92,6 @@
.project-views {
&:before {
opacity: .5;
background-image: url("/svgs/project/views-gray.svg");
}
}

View file

@ -1,10 +1 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>fav-gray</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="fav-gray" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M11.3692316,3.18046683 L13.0137079,6.51146221 L16.6906559,7.04720832 C17.943533,7.22859321 18.4432423,8.76736172 17.5375191,9.65146291 L14.8756057,12.2449065 L15.5038461,15.9074398 C15.7176641,17.1543108 14.4083294,18.1056805 13.2887883,17.5170806 L9.99983573,15.7873174 L6.7108832,17.5170806 C5.59014079,18.1056805 4.28200737,17.1543108 4.4946241,15.9074398 L5.12406571,12.2449065 L2.46335357,9.65146291 C1.55642911,8.76736172 2.05613848,7.22859321 3.30901557,7.04720832 L6.98716482,6.51146221 L8.63043986,3.18046683 C9.19141168,2.04651095 10.8082598,2.04651095 11.3692316,3.18046683" id="Fill-1" fill="#575E75"></path>
</g>
</svg>
<svg width="20px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M11.4 3.2L13 6.5l3.7.5c1.3.2 1.8 1.7.8 2.6l-2.7 2.6.6 3.7c.2 1.2-1.1 2.2-2.2 1.6L10 15.8l-3.3 1.7c-1.1.6-2.4-.4-2.2-1.6l.6-3.7-2.6-2.5c-.9-.9-.4-2.5.8-2.7L7 6.5l1.6-3.3c.6-1.2 2.2-1.2 2.8 0" fill-rule="evenodd" clip-rule="evenodd" opacity=".15"/><path d="M11.4 3.2L13 6.5l3.7.5c1.3.2 1.8 1.7.8 2.6l-2.7 2.6.6 3.7c.2 1.2-1.1 2.2-2.2 1.6L10 15.8l-3.3 1.7c-1.1.6-2.4-.4-2.2-1.6l.6-3.7-2.6-2.5c-.9-.9-.4-2.5.8-2.7L7 6.5l1.6-3.3c.6-1.2 2.2-1.2 2.8 0" fill="none" stroke="#575757" stroke-linejoin="round" stroke-miterlimit="10"/></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 625 B

View file

@ -1,10 +1 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>love-gray</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="love-gray" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M17.9740815,8.16524321 C17.506512,13.4513048 11.5192871,17.6086957 10.0005184,17.6086957 C8.48174963,17.6086957 2.49348798,13.4513048 2.02695523,8.16524321 C2.01347761,7.99279306 2,7.82034292 2,7.64789278 C2,5.08489125 4.09317696,3 6.66740102,3 C7.97369274,3 9.16075941,3.53077469 10.0005184,4.40748231 C10.8402773,3.53077469 12.027344,3 13.3336357,3 C15.906823,3 18,5.08489125 18,7.64789278 C18,7.82034292 17.9865224,7.99279306 17.9740815,8.16524321 Z" id="Fill-1" fill="#575E75"></path>
</g>
</svg>
<svg width="20px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M18 8.2c-.5 5.3-6.5 9.4-8 9.4s-7.5-4.2-8-9.4v-.6C2 5.1 4.1 3 6.7 3 8 3 9.2 3.5 10 4.4c.8-.9 2-1.4 3.3-1.4C15.9 3 18 5.1 18 7.6v.6z" fill-rule="evenodd" clip-rule="evenodd" opacity=".15"/><path d="M18 8.2c-.5 5.3-6.5 9.4-8 9.4s-7.5-4.2-8-9.4v-.6C2 5.1 4.1 3 6.7 3 8 3 9.2 3.5 10 4.4c.8-.9 2-1.4 3.3-1.4C15.9 3 18 5.1 18 7.6v.6z" fill-rule="evenodd" clip-rule="evenodd" fill="#d8dadf"/><path d="M18 8.2c-.5 5.3-6.5 9.4-8 9.4s-7.5-4.2-8-9.4v-.6C2 5.1 4.1 3 6.7 3 8 3 9.2 3.5 10 4.4c.8-.9 2-1.4 3.3-1.4C15.9 3 18 5.1 18 7.6v.6z" fill="none" stroke="#575757" stroke-linejoin="round" stroke-miterlimit="10"/></svg>

Before

Width:  |  Height:  |  Size: 959 B

After

Width:  |  Height:  |  Size: 704 B

View file

@ -1,10 +1 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>remix-gray</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="remix-gray" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M3.79735343,14.2387738 C2.44202813,12.0161502 2.33133423,9.04998717 3.52556841,6.69855452 C4.76300021,4.1712308 6.84548544,3.05103565 7.68243931,2.68681676 C8.18551159,2.45318367 8.71558237,2.27107423 9.28615093,2.13693508 L9.84592008,2.01612101 C10.2571974,1.93172883 10.6666748,2.18668205 10.7557699,2.59354119 C10.845765,3.00128868 10.5838794,3.40281779 10.1708022,3.49165166 L9.62633218,3.60891238 C9.17365713,3.71551303 8.73988103,3.86475393 8.31690435,4.06196513 C7.76703465,4.30003992 5.94823489,5.22124719 4.89889272,7.36569692 C4.10243662,8.93183812 3.86484971,11.4218516 5.11848062,13.4765791 C6.25421803,15.4557978 8.57968986,16.6692686 10.7854683,16.4649507 C12.8715533,16.3148214 14.7857478,14.926348 15.4571108,13.0874868 C16.1383733,11.3578912 15.6856982,9.5847671 14.9378394,8.58627435 C14.0369891,7.35592519 12.9156509,6.97749289 12.4755751,6.87178058 C12.4098788,6.85223712 10.8691637,6.38941264 9.50843868,7.07076845 C8.92257097,7.3514835 8.16481273,7.98309234 7.7589351,8.93183812 C7.32065925,9.91167575 7.434053,11.1713401 8.02802027,12.0081552 C8.62558733,12.9053773 9.75232523,13.4135071 10.7215718,13.2411694 C11.6863186,13.0892634 12.3387827,12.3714857 12.4935742,11.7407652 C12.6753641,11.0629628 12.3963795,10.4899843 12.1785915,10.2838897 C11.8087119,9.91878246 11.4892295,9.91256409 11.4757303,9.91167575 C11.3245386,9.90723406 11.2498427,9.91878246 11.2048452,9.92588917 C11.0320547,9.98896122 10.7872682,10.1275421 10.7152722,10.2732296 C10.7026729,10.2972148 10.6702746,10.3629518 10.7323712,10.5272945 C10.880863,10.9172752 10.6801741,11.3534495 10.2850959,11.5000254 C9.89181755,11.6474897 9.44904195,11.4493901 9.29965018,11.0585211 C9.05396372,10.4118105 9.18985623,9.90545738 9.34734755,9.59453882 C9.75862489,8.78526223 10.7134723,8.49211044 10.8214663,8.46101859 C10.8709636,8.44591683 10.9231607,8.43703344 10.9744579,8.43259175 C11.0797521,8.41660165 11.2651419,8.39172816 11.516228,8.40149989 C12.0912963,8.4086066 12.7464602,8.7088651 13.2486325,9.20544645 C13.8416999,9.76509986 14.3060743,10.8897367 13.9766924,12.1120908 C13.6554101,13.4206138 12.4206782,14.5026104 10.9798576,14.7291368 C9.43014299,15.0054101 7.68513916,14.2414388 6.76358995,12.8565187 C5.87533891,11.6084027 5.70524828,9.7819783 6.35501247,8.33309781 C7.06777319,6.66479765 8.42939815,5.90970972 8.82897612,5.71782855 C10.7503702,4.75842271 12.804057,5.39180823 12.8904523,5.41845839 C13.4430218,5.54904419 14.9792372,6.06339232 16.1734713,7.69527059 C17.0914208,8.92295473 17.8356797,11.215757 16.8898319,13.6160483 C16.0258795,15.9816944 13.566315,17.7788037 10.9141612,17.9697965 C10.7062727,17.9893399 10.4956843,18 10.2859958,18 C7.71213768,18 5.10498136,16.5164743 3.79735343,14.2387738 Z" id="Fill-1" fill="#575E75"></path>
</g>
</svg>
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M3.797 14.239c-1.355-2.223-1.466-5.189-.271-7.54a8.498 8.498 0 0 1 4.156-4.012 8.279 8.279 0 0 1 1.604-.55l.56-.12a.77.77 0 0 1 .91.577.755.755 0 0 1-.585.898l-.545.117a6.73 6.73 0 0 0-1.31.453A7.06 7.06 0 0 0 4.9 7.366c-.797 1.566-1.034 4.056.22 6.11 1.135 1.98 3.46 3.193 5.666 2.989 2.087-.15 4-1.539 4.672-3.378.681-1.73.229-3.502-.52-4.5-.9-1.231-2.021-1.61-2.461-1.715-.066-.02-1.607-.483-2.968.199-.585.28-1.343.912-1.75 1.86-.437.98-.324 2.24.27 3.077.598.897 1.724 1.406 2.694 1.233.964-.152 1.617-.87 1.772-1.5.181-.678-.098-1.251-.315-1.457-.37-.365-.69-.371-.703-.372a1.316 1.316 0 0 0-.271.014c-.173.063-.418.202-.49.347-.012.024-.045.09.017.254a.753.753 0 0 1-.447.973.768.768 0 0 1-.985-.441c-.246-.647-.11-1.154.047-1.464.412-.81 1.366-1.103 1.474-1.134a.749.749 0 0 1 .153-.028c.106-.016.291-.041.542-.032.575.008 1.23.308 1.733.804.593.56 1.057 1.685.728 2.907-.322 1.309-1.556 2.39-2.997 2.617-1.55.276-3.295-.488-4.216-1.872-.889-1.249-1.059-3.075-.409-4.524a5.263 5.263 0 0 1 2.474-2.615c1.921-.96 3.975-.326 4.061-.3.553.131 2.09.645 3.283 2.277.918 1.228 1.663 3.52.717 5.921-.864 2.366-3.324 4.163-5.976 4.354-.208.02-.418.03-.628.03-2.574 0-5.181-1.484-6.489-3.761z" fill="#575E75" fill-rule="evenodd"/></svg>

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1,13 +1 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>views-gray</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="views-gray" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="views" transform="translate(2.000000, 3.800000)" fill="#575E75" fill-rule="nonzero">
<path d="M15.4390052,4.41681127 C16.1720223,5.4489779 16.2018258,7.14653628 15.4390052,8.15461725 C15.4390052,8.15461725 13.1136459,12.5714286 7.99999999,12.5714286 C2.88635412,12.5714286 0.560994788,8.15461725 0.560994788,8.15461725 C-0.172022306,7.12245063 -0.201825795,5.42489224 0.560994788,4.41681127 C0.560994788,4.41681127 2.88635412,4.49037158e-16 7.99999999,0 C13.1136459,0 15.4390052,4.41681127 15.4390052,4.41681127 Z M7.99873614,10.855879 C10.5231174,10.855879 12.5695328,8.80946363 12.5695328,6.28508235 C12.5695328,3.76070107 10.5231174,1.71428571 7.99873614,1.71428571 C5.47435486,1.71428571 3.4279395,3.76070107 3.4279395,6.28508235 C3.4279395,8.80946363 5.47435486,10.855879 7.99873614,10.855879 Z" id="Combined-Shape"></path>
<circle id="Oval" cx="7.88571429" cy="6.28571429" r="2.28571429"></circle>
</g>
</g>
</svg>
<svg width="20px" height="20px" id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><style>.st0{fill:#575757}</style><g id="views-gray_00000142863366358815447650000010738254069274213278_"><g id="views_00000127742387757798344080000005698693185098196616_" transform="translate(2 3.8)"><path id="Combined-Shape_00000103235703839151643790000017400590354981511084_" class="st0" d="M15.4 4.4c.7 1 .8 2.7 0 3.7 0 0-2.3 4.4-7.4 4.4S.6 8.2.6 8.2c-.7-1-.8-2.7 0-3.7C.6 4.4 2.9 0 8 0s7.4 4.4 7.4 4.4zM8 10.9c2.5 0 4.6-2 4.6-4.6s-2-4.6-4.6-4.6-4.6 2-4.6 4.6 2.1 4.6 4.6 4.6z"/><circle id="Oval_00000090263241961712918110000010337424226369138089_" class="st0" cx="7.9" cy="6.3" r="2.3"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 704 B

View file

@ -1,76 +1,24 @@
import React from 'react';
const {mountWithIntl} = require('../../helpers/intl-helpers.jsx');
jest.mock('@sentry/browser', () => {
const setExtra = jest.fn();
const setTag = jest.fn();
const makeScope = (setExtraParam, setTagParam) => {
const thisScope = {
setExtra: setExtraParam,
setTag: setTagParam
};
return thisScope;
};
const Sentry = {
captureException: jest.fn(),
lastEventId: function () {
return 0;
},
setExtra: setExtra,
setTag: setTag,
withScope: jest.fn(cb => {
cb(makeScope(setExtra, setTag));
})
};
return Sentry;
});
const Sentry = require('@sentry/browser');
import CrashMessageComponent from '../../../src/components/crashmessage/crashmessage.jsx';
import ErrorBoundary from '../../../src/components/errorboundary/errorboundary.jsx';
const ChildComponent = () => <div>hello</div>;
describe('ErrorBoundary', () => {
let errorBoundaryWrapper;
const ChildClass = () => (
<div>
Children here
</div>
);
test('ErrorBoundary shows children before error and CrashMessageComponent after', () => {
const child = <ChildComponent />;
const wrapper = mountWithIntl(<ErrorBoundary>{child}</ErrorBoundary>);
const childWrapper = wrapper.childAt(0);
beforeEach(() => {
errorBoundaryWrapper = mountWithIntl(
<ErrorBoundary
componentName="TestEBName"
>
<ChildClass id="childClass" />
</ErrorBoundary>
);
});
expect(wrapper.containsMatchingElement(child)).toBeTruthy();
expect(wrapper.containsMatchingElement(<CrashMessageComponent />)).toBeFalsy();
test('calling ErrorBoundary\'s componentDidCatch() calls Sentry.withScope()', () => {
const errorBoundaryInstance = errorBoundaryWrapper.instance();
errorBoundaryInstance.componentDidCatch('error', {});
expect(Sentry.withScope).toHaveBeenCalled();
});
childWrapper.simulateError(new Error('fake error for testing purposes'));
test('calling ErrorBoundary\'s componentDidCatch() calls Sentry.captureException()', () => {
const errorBoundaryInstance = errorBoundaryWrapper.instance();
errorBoundaryInstance.componentDidCatch('error', {});
expect(Sentry.captureException).toHaveBeenCalledWith('error');
});
test('throwing error under ErrorBoundary calls Sentry.withScope()', () => {
const child = errorBoundaryWrapper.find('#childClass');
expect(child.exists()).toEqual(true);
child.simulateError({}, {});
expect(Sentry.withScope).toHaveBeenCalled();
});
test('ErrorBoundary with name prop causes Sentry to setTag with that name', () => {
const child = errorBoundaryWrapper.find('#childClass');
expect(child.exists()).toEqual(true);
child.simulateError({});
expect(Sentry.setTag).toHaveBeenCalledWith('component', 'TestEBName');
expect(wrapper.containsMatchingElement(child)).toBeFalsy();
expect(wrapper.containsMatchingElement(<CrashMessageComponent />)).toBeTruthy();
});
});

View file

@ -230,8 +230,7 @@ module.exports = {
'process.env.CLOUDDATA_HOST': '"' + (process.env.CLOUDDATA_HOST || 'clouddata.scratch.mit.edu') + '"',
'process.env.PROJECT_HOST': '"' + (process.env.PROJECT_HOST || 'https://projects.scratch.mit.edu') + '"',
'process.env.STATIC_HOST': '"' + (process.env.STATIC_HOST || 'https://uploads.scratch.mit.edu') + '"',
'process.env.SCRATCH_ENV': '"' + (process.env.SCRATCH_ENV || 'development') + '"',
'process.env.SENTRY_DSN': '"' + (process.env.SENTRY_DSN || '') + '"'
'process.env.SCRATCH_ENV': '"' + (process.env.SCRATCH_ENV || 'development') + '"'
})
])
.concat(process.env.ANALYZE_BUNDLE === 'true' ? [