Skip to content
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
14 changes: 5 additions & 9 deletions packages/mask/.webpack/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function createConfiguration(rawFlags: BuildFlags): Configuration {
name: 'mask',
mode,
devtool: sourceMapKind,
target: ['web', 'es2019'],
target: ['web', 'es2021'],
entry: {},
experiments: { backCompat: false, asyncWebAssembly: supportWebAssembly },
cache: {
Expand Down Expand Up @@ -146,21 +146,22 @@ export function createConfiguration(rawFlags: BuildFlags): Configuration {
syntax: 'typescript',
dynamicImport: true,
tsx: true,
importAssertions: true,
},
target: 'es2019',
target: 'es2021',
externalHelpers: true,
transform: {
react: {
runtime: 'automatic',
useBuiltins: true,
refresh: reactRefresh && {
refreshReg: '$RefreshReg$',
refreshSig: '$RefreshSig$',
emitFullSignatures: true,
},
},
},
experimental: {
keepImportAssertions: true,
},
},
},
},
Expand Down Expand Up @@ -242,12 +243,7 @@ export function createConfiguration(rawFlags: BuildFlags): Configuration {
},
output: {
environment: {
arrowFunction: true,
const: true,
destructuring: true,
forOf: true,
module: false,
bigIntLiteral: true,
// Our iOS App doesn't support dynamic import (it requires a heavy post-build time transform).
dynamicImport: !(runtime.architecture === 'app' && runtime.engine === 'safari'),
},
Expand Down
2 changes: 1 addition & 1 deletion packages/mask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"react-refresh": "=0.11.0",
"source-map-loader": "^3.0.1",
"swc-loader": "^0.1.15",
"webpack": "^5.70.0",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4",
"webpack-target-webextension": "^1.0.3"
Expand Down
19 changes: 0 additions & 19 deletions packages/mask/shared/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,8 @@ const betaOrInsiderOnly = insiderOnly || process.env.channel === 'beta'

// TODO: In future, we can turn this object into a Proxy to receive flags from remote
export const Flags = {
__raw__: {
target: process.env.engine,
architecture: process.env.architecture,
},
isolated_dashboard_bridge_enabled: false,
mask_SDK_ready: betaOrInsiderOnly,
/** There is no "tabs" to navigate to. We must be careful with this. */
has_no_browser_tab_ui: appOnly,
has_no_connected_user_link: appOnly,
has_native_nav_bar: appOnly,
using_ShadowDOM_attach_mode: 'closed' as ShadowRootMode,
/** Don't inject injected script in this mode. Native side will do the job. */
support_declarative_user_script: is_iOSApp,
Expand All @@ -29,21 +21,11 @@ export const Flags = {
support_testnet_switch: betaOrInsiderOnly,
// #region Experimental features
image_payload_marked_as_beta: appOnly,
transak_enabled: webOnly,
trader_zrx_enabled: webOnly,
trader_all_api_cached_enabled: devOnly,
metamask_enabled: webOnly,
injected_web3_enabled: webOnly,
toolbox_enabled: webOnly,
/** Prohibit the use of test networks in production */
wallet_allow_testnet: betaOrInsiderOnly || process.env.NODE_ENV !== 'production',
wallet_mnemonic_words_backup_enabled: false,
wallet_private_key_backup_enabled: true,
wallet_gas_price_dialog_enable: true,
/* construct LBP for all ERC20 tokens */
LBP_enabled: false,
LBP_whitelist_enabled: process.env.NODE_ENV === 'production',
plugin_switch_enabled: betaOrInsiderOnly,
// #endregion

EIP1559_enabled: true,
Expand All @@ -54,7 +36,6 @@ export const Flags = {
xdai_enabled: true,
avalanche_enabled: true,
fantom_enabled: true,
flow_enabled: true,
celo_enabled: true,
aurora_enabled: true,
nft_airdrop_enabled: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/polyfills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Extra:

## Targeting ES Syntax and APIs

- Syntax: ES2020
- Syntax: ES2021
- Library: ES2022 (with [core-js](https://github.com/zloirock/core-js)).

### Caution
Expand Down
Loading