-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(platform): defer load monaco-editor
edit react-monaco-editor to meta3d-react-monaco-editor: add monaco param instead of dependent on it; (refer to https://segmentfault.com/a/1190000041564651#item-5-1)
- Loading branch information
Showing
33 changed files
with
981 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
example/node_modules | ||
node_modules | ||
src/*.js |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"extends": [ | ||
"prettier", | ||
"airbnb", | ||
"plugin:react/recommended", | ||
"plugin:prettier/recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"plugins": ["react", "prettier", "@typescript-eslint", "react-hooks"], | ||
"rules": { | ||
"@typescript-eslint/ban-ts-comment": 0, | ||
"@typescript-eslint/explicit-module-boundary-types": 0, | ||
"@typescript-eslint/no-empty-function": 0, | ||
"@typescript-eslint/no-explicit-any": 0, | ||
"@typescript-eslint/no-unsafe-call": 0, | ||
"@typescript-eslint/no-unsafe-member-access": 0, | ||
"@typescript-eslint/no-unused-vars": 0, | ||
"array-bracket-spacing": 0, | ||
"camelcase": 0, | ||
"comma-dangle": 0, | ||
"import/extensions": 0, | ||
"import/no-unresolved": 0, | ||
"jsx-a11y/href-no-hash": 0, | ||
"max-classes-per-file": 0, | ||
"no-underscore-dangle": 0, | ||
"prettier/prettier": 2, | ||
"react/destructuring-assignment": 0, | ||
"react/forbid-prop-types": 0, | ||
"react/jsx-filename-extension": 0, | ||
"react/jsx-no-undef": 2, | ||
"react/jsx-uses-react": 1, | ||
"react/static-property-placement": [2, "static public field"], | ||
"semi": 0, | ||
"valid-jsdoc": 2, | ||
"no-use-before-define": "off", | ||
"@typescript-eslint/no-use-before-define": ["error"], | ||
"react-hooks/rules-of-hooks": "error", | ||
"react-hooks/exhaustive-deps": "warn" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
*.iml | ||
.idea/ | ||
.ipr | ||
.iws | ||
*.js | ||
*~ | ||
~* | ||
*.diff | ||
*.patch | ||
*.bak | ||
.DS_Store | ||
Thumbs.db | ||
.project | ||
.*proj | ||
.svn/ | ||
*.swp | ||
*.swo | ||
*.pyc | ||
*.pyo | ||
node_modules | ||
dist | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.vscode |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.eslintignore | ||
.eslintrc | ||
.github/ | ||
.gitignore | ||
.npmignore | ||
.travis.yml | ||
.vscode/ | ||
/example/ | ||
/examples/ | ||
tsconfig.json | ||
yarn-error.log |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016-present Leon Shi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
fork from https://github.com/react-monaco-editor/react-monaco-editor |
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as React from "react"; | ||
import { noop } from "./utils"; | ||
declare function MonacoEditor({ monaco, width, height, value, defaultValue, language, theme, options, overrideServices, editorWillMount, editorDidMount, editorWillUnmount, onChange, className, uri, }: { | ||
monaco: any; | ||
width: any; | ||
height: any; | ||
value: any; | ||
defaultValue: any; | ||
language: any; | ||
theme: any; | ||
options: any; | ||
overrideServices: any; | ||
editorWillMount: any; | ||
editorDidMount: any; | ||
editorWillUnmount: any; | ||
onChange: any; | ||
className: any; | ||
uri: any; | ||
}): React.JSX.Element; | ||
declare namespace MonacoEditor { | ||
var defaultProps: { | ||
width: string; | ||
height: string; | ||
value: any; | ||
defaultValue: string; | ||
language: string; | ||
theme: any; | ||
options: {}; | ||
overrideServices: {}; | ||
editorWillMount: typeof noop; | ||
editorDidMount: typeof noop; | ||
editorWillUnmount: typeof noop; | ||
onChange: typeof noop; | ||
className: any; | ||
}; | ||
var displayName: string; | ||
} | ||
export default MonacoEditor; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import MonacoEditor from "./editor"; | ||
export { MonacoEditor as default }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare function processSize(size: number | string): string | number; | ||
export declare function noop(): void; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"name": "meta3d-react-monaco-editor", | ||
"version": "0.0.1", | ||
"description": "Monaco Editor for React", | ||
"main": "lib/index.js", | ||
"module": "lib/index", | ||
"types": "lib/index.d.ts", | ||
"scripts": { | ||
"preversion": "npm run lint", | ||
"build": "tsc", | ||
"clean": "rimraf lib", | ||
"format": "eslint --fix '{src,example}/**/*.{ts,tsx}'" | ||
}, | ||
"keywords": [ | ||
"monaco", | ||
"editor", | ||
"react", | ||
"vscode" | ||
], | ||
"authors": [ | ||
"Daniele Esposti <daniele.espsoti@gmail.com>", | ||
"Dominik Moritz <domoritz@cs.washington.edu>", | ||
"Leon Shi <superRaytin@gmail.com>" | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/react-monaco-editor/react-monaco-editor/issues" | ||
}, | ||
"homepage": "https://github.com/react-monaco-editor/react-monaco-editor", | ||
"repository": "https://github.com/react-monaco-editor/react-monaco-editor", | ||
"devDependencies": { | ||
"@types/react": "^18.2.18", | ||
"@typescript-eslint/eslint-plugin": "^6.2.1", | ||
"@typescript-eslint/parser": "^6.2.1", | ||
"eslint": "^8.46.0", | ||
"eslint-config-airbnb": "^19.0.4", | ||
"eslint-config-prettier": "^8.9.0", | ||
"eslint-plugin-import": "^2.28.0", | ||
"eslint-plugin-jsx-a11y": "^6.7.1", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"eslint-plugin-react": "^7.33.1", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"prettier": "^3.0.0", | ||
"react": "^18.2.0", | ||
"rimraf": "^5.0.1", | ||
"typescript": "^5.1.6" | ||
}, | ||
"peerDependencies": { | ||
"@types/react": ">=16 <= 18", | ||
"react": ">=16 <= 18" | ||
}, | ||
"dependencies": { | ||
"prop-types": "^15.8.1" | ||
} | ||
} |
Oops, something went wrong.