-
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(sdk-install-modal-web): migrate from i18next to custom Simpl…
…eI18n implementation (#1141) * feat: migrate i18n away from sdk dependency * refactor(sdk-install-modal-web): replace i18next with SimpleI18n implementation - Remove i18next dependency in favor of lighter custom i18n solution - Add SimpleI18n class for handling translations - Update modal components to use new i18n implementation - Improve translation loading with proper error handling * build: optimize build configurations and add size limits - Enable build optimizations in stencil config - Add proper size limits for bundle tracking - Enable file name hashing for better caching - Add build statistics tracking - Update size limit configurations across packages * chore: clean up dependencies - Remove unused react-refresh from devnext - Remove react-native-webview direct dependency - Update size-limit dependency version - Clean up redundant peer dependencies * refactor(sdk): improve code organization and error handling - Refactor ModalLoader class for better maintainability - Add proper error handling for modal rendering - Improve mobile port stream documentation - Update rollup config with better bundle visualization - Remove debug console logs - Add type improvements * feat: remove i18n temporarily * build: lazy loading but esm error * feat: working state but still included in bundle * feat: add browser language detection and dynamic translation loading Implemented browser language detection and dynamic loading of translations from a remote URL. Removed hardcoded locale files and updated the SimpleI18n class to handle supported locales and fallback mechanisms. * feat: fully working simple i18n * chore: cleanup * chore: cleanup * fix: unit tests * fix: types export * chore: nodenv conf * chore: reset sdk version * fix: build wip * feat: move global types * fix: build issues * fix: sdk react unit tests
- Loading branch information
1 parent
5201001
commit 40d642d
Showing
40 changed files
with
1,714 additions
and
995 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[ | ||
{ | ||
"path": "./dist/es/index.js", | ||
"limit": "100000 ms" | ||
"path": "dist/components/*.js", | ||
"limit": "30 KB" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,37 +13,20 @@ | |
}, | ||
"author": "MetaMask", | ||
"packageManager": "[email protected]", | ||
"main": "dist/components/index.js", | ||
"module": "dist/components/index.js", | ||
"types": "dist/components/index.d.ts", | ||
"main": "./dist/index.cjs.js", | ||
"module": "./dist/index.js", | ||
"collection": "dist/collection/collection-manifest.json", | ||
"types": "dist/types/index.d.ts", | ||
"files": [ | ||
"./dist" | ||
], | ||
"exports": { | ||
".": { | ||
"import": "./dist/components/index.js", | ||
"types": "./dist/components/index.d.ts" | ||
}, | ||
"./components/mm-install-modal": { | ||
"import": "./dist/components/mm-install-modal.js", | ||
"types": "./dist/components/mm-install-modal.d.ts" | ||
}, | ||
"./components/mm-pending-modal": { | ||
"import": "./dist/components/mm-pending-modal.js", | ||
"types": "./dist/components/mm-pending-modal.d.ts" | ||
}, | ||
"./components/mm-select-modal": { | ||
"import": "./dist/components/mm-select-modal.js", | ||
"types": "./dist/components/mm-select-modal.d.ts" | ||
} | ||
}, | ||
"scripts": { | ||
"allow-scripts": "", | ||
"generate": "stencil generate", | ||
"build:types": "tsc --project tsconfig.json --emitDeclarationOnly --outDir dist/types", | ||
"build:clean": "yarn clean && yarn build", | ||
"build": "stencil build --prod", | ||
"build:dev": "stencil build --debug --dev", | ||
"build:dev": "NODE_ENV=development stencil build --debug --dev", | ||
"build:tsc": "tsc --build tsconfig.json --verbose", | ||
"build:watch": "stencil build --watchAll", | ||
"build:post-tsc": "echo 'N/A'", | ||
|
@@ -84,17 +67,14 @@ | |
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"eslint-plugin-react": "^7.32.2", | ||
"i18next": "23.11.5", | ||
"jest": "^29.6.4", | ||
"prettier": "^2.8.8", | ||
"puppeteer": "^23.8.0", | ||
"rimraf": "^5.0.0", | ||
"size-limit": "^11.0.2", | ||
"rollup-plugin-visualizer": "^5.12.0", | ||
"size-limit": "^11.1.6", | ||
"typescript": "^5.6.3" | ||
}, | ||
"peerDependencies": { | ||
"i18next": "23.11.5" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org/" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.