Skip to content

Commit

Permalink
fix(explorer): enable Safari and fix bundled image path (#708)
Browse files Browse the repository at this point in the history
* fix(explorer): enable Safari and fix bundled image path
  • Loading branch information
kaloster authored Jan 17, 2024
1 parent 2c60abf commit 80fc7c6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/configuration/webpack/SUPPORTED_BROWSERS_REGEX.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/configuration/webpack/obsoleteHTMLTemplate.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- for local testing add / to your image file path /static/images... -->
<div
style="
display: flex;
Expand Down
1 change: 1 addition & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
>

<div id="root"></div>
<!-- for local testing add / to your file path /static/... -->
<script
async
src="static/obsoleteBrowsers.js"
Expand Down
1 change: 1 addition & 0 deletions client/index_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
</noscript>

<div id="root"></div>
<!-- for local testing add / to your file path /static/... -->
<script
async
src="static/obsoleteBrowsers.js"
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"iOS >= 10.3",
"Firefox >= 60",
"Edge >= 79",
"not Safari > 0",
"Safari >= 15",
"not Explorer > 0"
],
"dependencies": {
Expand Down
17 changes: 9 additions & 8 deletions dev_docs/developer_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Note: in case you need to just build the client alone, you can run `make build-c
### If you have an M1 or M2 chip...

Attempting to run Explorer locally (server and/or client) will fail with something that looks like:

```
npm ERR! The chromium binary is not available for arm64.
npm ERR! If you are on Ubuntu, you can install with:
Expand All @@ -54,7 +55,7 @@ npm ERR!
npm ERR! sudo apt install chromium-browser
```

Puppeteer is a dependency for e2e tests, but it's not used for running Explorer locally. If you want to run Explorer locally, you can get around this by removing all node dependencies on Puppeteer. To do this, delete any lines in `package.json` that have `puppeteer` in it, such as: `puppeteer-fetch`, `expect-puppeteer`, etc. Then, running any of the build commands should generate a `package-lock.json` file without the Puppeteer dependencies. Just make sure to not commit any of the `package.json` or `package-lock.json` changes to your PR's.
Puppeteer is a dependency for e2e tests, but it's not used for running Explorer locally. If you want to run Explorer locally, you can get around this by setting `export PUPPETEER_SKIP_DOWNLOAD=true` in your virtual environment. That will skip the Puppeteer installation.

If you want to actually run e2e tests, then you'll need to set up Chromium to enable Puppeteer. [This blog post](https://broddin.be/2022/09/19/fixing-the-chromium-binary-is-not-available-for-arm64/) should show you how to do that on an M1/M2 machine.

Expand All @@ -78,7 +79,7 @@ Note that you'll need to `import json` and also add `Response` to the `flask` im

### Before you request a PR review...

Please lint and format your code before requesting a PR review.
Please lint and format your code before requesting a PR review.

We use [`flake8`](https://github.com/PyCQA/flake8) to lint Python and [`black`](https://pypi.org/project/black/) for auto-formatting Python. The frontend Javascript/Typescript code is linted by `eslint` and formatted by `prettier`.

Expand All @@ -96,12 +97,12 @@ Client and server tests run on [Github Actions](https://github.com/chanzuckerber

### Testing Command Cheat Sheet

| What are you testing | Command |
|---|---|
| I want to run unit tests for the backend only. | `make unit-test-server` |
| I want to run unit tests for the frontend only. | `make unit-test-client` |
| I want to run unit and smoke tests for the backend. | `make test-server` |
| I want to only run smoke tests. | `make smoke-test` |
| What are you testing | Command |
| --------------------------------------------------------------------- | -------------------------- |
| I want to run unit tests for the backend only. | `make unit-test-server` |
| I want to run unit tests for the frontend only. | `make unit-test-client` |
| I want to run unit and smoke tests for the backend. | `make test-server` |
| I want to only run smoke tests. | `make smoke-test` |
| I want to run smoke tests against my hot-loaded verion of the client. | `cd client && npm run e2e` |

### Flags
Expand Down

0 comments on commit 80fc7c6

Please sign in to comment.