Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from Agoric/mfig-sesify-ui
Browse files Browse the repository at this point in the history
fix(ui): start using SES
  • Loading branch information
michaelfig authored Sep 8, 2021
2 parents 6062cc2 + 6d00941 commit 10fdd8e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 14 deletions.
1 change: 1 addition & 0 deletions _agstate/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
agoric-wallet
keys
agoric-servers
9 changes: 5 additions & 4 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
],
"development": [
"last 1 chrome version",
Expand Down Expand Up @@ -61,7 +61,8 @@
"eslint-plugin-react": "^7.21.4",
"eslint-plugin-react-hooks": "^4.1.2",
"prettier": "^2.1.2",
"rimraf": "^3.0.2"
"rimraf": "^3.0.2",
"ses": "^0.14.2"
},
"prettier": {
"trailingComma": "all",
Expand Down
7 changes: 2 additions & 5 deletions ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,8 @@ <h1 class="mdc-typography--headline2">Fungible Token Faucet</h1>


<!-- Required Material Web JavaScript library -->
<script src="https://unpkg.com/[email protected]/dist/material-components-web.min.js"></script>
<script src="https://unpkg.com/material-components-web@^11.0.0/dist/material-components-web.min.js"></script>

<script>
</script>

<script type="module" src="src/main.js"></script>
<script type="module" src="src/main.js"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions ui/public/src/install-ses-lockdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-disable import/no-extraneous-dependencies */
import 'ses/dist/ses.umd'; // adds lockdown, harden, and Compartment
import '@agoric/eventual-send/shim'; // adds support needed by E

// Help lock down the JS environment. The start compartment (current evaluation context)
// can still access powerful globals, but this start compartment can use `new Compartment(...)`
// to evaluate code with stricter confinement.
lockdown({
errorTaming: 'unsafe',
overrideTaming: 'severe',
});

Error.stackTraceLimit = Infinity;
2 changes: 1 addition & 1 deletion ui/public/src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-check
/* globals document mdc */
import 'regenerator-runtime/runtime.js';
import './install-ses-lockdown.js';
import dappConstants from '../lib/constants.js';
import { connect } from './connect.js';

Expand Down
6 changes: 3 additions & 3 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1457,9 +1457,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001035:
version "1.0.30001251"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz"
integrity sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A==
version "1.0.30001252"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001252.tgz"
integrity sha512-I56jhWDGMtdILQORdusxBOH+Nl/KgQSdDmpJezYddnAkVOmnoU8zwjTV9xAjMIYxr0iPreEAVylCGcmHCjfaOw==

caseless@~0.12.0:
version "0.12.0"
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7610,7 +7610,7 @@ ses@^0.12.6:
"@agoric/make-hardener" "^0.1.2"
"@agoric/transform-module" "^0.4.1"

ses@^0.14.1:
ses@^0.14.1, ses@^0.14.2:
version "0.14.2"
resolved "https://registry.yarnpkg.com/ses/-/ses-0.14.2.tgz#3dd62c1779cc9ee5df506d7b1a40fe514ba541e1"
integrity sha512-RKAOt8KxkJJyclwfd0mQ6GtmIyYUOrDew7DwKM6DTWY8f9u1eDJccpHXvxDhpXDcWlJ40dtC/FCx12BFZuGPng==
Expand Down

0 comments on commit 10fdd8e

Please sign in to comment.