Skip to content

Commit a3114bf

Browse files
author
sakuraash
committed
fix monaco version, update plugin persist
1 parent 556169b commit a3114bf

File tree

641 files changed

+158344
-164745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

641 files changed

+158344
-164745
lines changed

app/components/Plugins/actions.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ import { registerAction } from 'utils/actions'
22
import { PluginRegistry } from 'utils/plugins'
33
import { autorun, observable } from 'mobx'
44
import config from 'config'
5+
import localforage from 'localforage'
56
import { notify, NOTIFY_TYPE } from 'components/Notification/actions'
67
import store from './store'
78
import api from '../../backendAPI'
89

10+
const pluginScriptsStore = localforage.createInstance({
11+
name: 'pluginScripts'
12+
})
13+
914
const io = require(__RUN_MODE__ ? 'socket.io-client/dist/socket.io.min.js' : 'socket.io-client-legacy/dist/socket.io.min.js')
1015

1116
export const PLUGIN_REGISTER_VIEW = 'PLUGIN_REGISTER_VIEW'
@@ -32,8 +37,8 @@ export const updateLocalPackage = registerAction(PACKAGE_UPDATE_LOCAL, p => p)
3237
export const PACKAGE_TOGGLE = 'PACKAGE_TOGGLE'
3338

3439
export const togglePackage = registerAction(PACKAGE_TOGGLE,
35-
({ pkgId, shouldEnable, info, type, data }, action) => {
36-
const script = localStorage.getItem(pkgId) // toggle行为从本地读取
40+
async ({ pkgId, shouldEnable, info, type, data }, action) => {
41+
const script = await pluginScriptsStore.getItem(pkgId) // toggle行为从本地读取
3742
if (!shouldEnable) {
3843
// plugin will unmount
3944
// 根据 package Id 把所有此插件组的插件拔掉
@@ -107,7 +112,7 @@ export const fetchPackageGroup = registerAction(FETCH_PACKAGE_GROUP,
107112
const scriptArguments = pkgs.map((pkg => ({ pkgName: pkg.name, pkgVersion: pkg.version, target: pkg.TARGET })))
108113
return api.fetchPackageScript(scriptArguments)
109114
.then((script) => {
110-
localStorage.setItem(groupName, script)
115+
pluginScriptsStore.setItem(groupName, script)
111116
codingPackageJsonp.groups[groupName] = pkgs.map(pkg => pkg.name)
112117
// Todo: refractor the toggle package model
113118
// return togglePackage({ pkgId: groupName, shouldEnable: !PluginRegistry.find(groupName), type, data })
@@ -120,7 +125,7 @@ export const fetchPackage = registerAction(FETCH_PACKAGE,
120125
(pkg, type, data) => ({ pkg, type, data }),
121126
({ pkg, type, data }) => api.fetchPackageScript({ pkgName: pkg.name, pkgVersion: pkg.version, target: pkg.TARGET })
122127
.then((script) => {
123-
localStorage.setItem(pkg.name, script)
128+
pluginScriptsStore.setItem(pkg.name, script)
124129
return pkg.name
125130
})
126131
.then(pkgId => togglePackage({ pkgId, shouldEnable: true, type, data })))
@@ -160,7 +165,7 @@ const FETCH_USER_PACKAGE = 'FETCH_USER_PACKAGE'
160165
export const fetchUserPackage = registerAction(FETCH_USER_PACKAGE, (pkg) => {
161166
return api.fetchUserPackageScript(pkg.filePath)
162167
.then((script) => {
163-
localStorage.setItem(pkg.name, script)
168+
pluginScriptsStore.setItem(pkg.name, script)
164169
return pkg.name
165170
})
166171
.then(pkgId => togglePackage({ pkgId, shouldEnable: true, type: 'Required' }))
@@ -341,7 +346,7 @@ export const startRemoteHMRServer = registerAction('plugin:mount', () => {
341346
const getInfo = store.list.get(key || packageUniqueName) || {}
342347
PluginRegistry.set(key || packageUniqueName, { ...plugin, pkgId: packageUniqueName, info: getInfo, loadType: 'Required' })
343348
manager.pluginWillMount()
344-
localStorage.setItem(packageUniqueName, script)
349+
pluginScriptsStore.setItem(packageUniqueName, script)
345350
firstPending = false
346351
} catch (e) {
347352
console.error(e)
@@ -376,7 +381,8 @@ export const startRemoteHMRServer = registerAction('plugin:mount', () => {
376381
PluginRegistry.delete(plugin.key)
377382
})
378383
}
379-
localStorage.setItem(packageUniqueName, script)
384+
pluginScriptsStore.setItem(packageUniqueName, script)
385+
// localStorage.setItem(packageUniqueName, script)
380386
togglePackage({ pkgId: packageUniqueName, shouldEnable: true, type: 'reload', data: null })
381387
})
382388
})

app/monaco-editor/CHANGELOG.md

Lines changed: 9 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,4 @@
1-
# Monaco Editor Changelog
2-
3-
## [0.15.6] (23.11.2018)
4-
* Fixes issue with context menu (https://github.com/Microsoft/monaco-editor/issues/1199)
5-
6-
## [0.15.5] (16.11.2018)
7-
* Re-remove cast to any from our code base to allow for tree shaking to not shake useful code (https://github.com/Microsoft/monaco-editor/issues/1013)
8-
9-
## [0.15.4] (15.11.2018)
10-
* Fixes context menu in IE11 - https://github.com/Microsoft/monaco-editor/issues/1191
11-
* Fixes suggest widget - https://github.com/Microsoft/monaco-editor/issues/1185 and https://github.com/Microsoft/monaco-editor/issues/1186
12-
13-
## [0.15.3] (15.11.2018)
14-
* Remove cast to any from our code base to allow for tree shaking to not shake useful code (https://github.com/Microsoft/monaco-editor/issues/1013)
15-
16-
## [0.15.2] (14.11.2018)
17-
* Fixes usage of `marked` to allow for packaging with rollup (https://github.com/Microsoft/monaco-editor/issues/1183)
18-
19-
## [0.15.1] (13.11.2018)
20-
* Fixes the `/esm/` distribution (https://github.com/Microsoft/monaco-editor/issues/1178)
21-
22-
## [0.15.0] (12.11.2018)
23-
24-
### New & Noteworthy
25-
26-
* Improved typings in `monaco.d.ts` to better reflect null types.
27-
28-
### Breaking changes
29-
30-
* We are slowly migrating our code-base away from WinJS promises, so the exposed `monaco.Promise` API has been reduced to indicate that. We are setting up a Promise polyfill to cover browsers which do not have a native Promise implementation yet (i.e. IE11).
31-
* `CompletionItemProvider.provideCompletionItems` and `CompletionItemProvider.resolveCompletionItem` have been modified to better reflect the API of VS Code. Both arguments and return type have changed.
32-
* `SignatureHelpProvider.provideSignatureHelp` now receives an extra argument for the context.
33-
* Various new editor options or tweaks to existing ones: `parameterHints`, `autoClosingBrackets`, `autoClosingQuotes`, `autoSurround`, `copyWithSyntaxHighlighting`, `tabCompletion`.
34-
35-
### Thank you
36-
37-
Contributions to `monaco-editor`:
38-
39-
* [Arvind S (@arvind0598)](https://github.com/arvind0598): Updated C# sample code for a simpler game. [PR #1160](https://github.com/Microsoft/monaco-editor/pull/1160)
40-
* [Brooks Becton (@brooksbecton)](https://github.com/brooksbecton): Removing obsolete Note in Monarch Docs [PR #1089](https://github.com/Microsoft/monaco-editor/pull/1089)
41-
* [James Orr (@buzzcola)](https://github.com/buzzcola): Correct comma splice in README.md [PR #1111](https://github.com/Microsoft/monaco-editor/pull/1111)
42-
* [Chintogtokh Batbold (@chintogtokh)](https://github.com/chintogtokh): Clarify that repo doesn't contain source code [PR #1119](https://github.com/Microsoft/monaco-editor/pull/1119)
43-
* [Chris Helgert (@chrishelgert)](https://github.com/chrishelgert): Move issue template to '.github' folder and add some styling for better readability [PR #1121](https://github.com/Microsoft/monaco-editor/pull/1121)
44-
* [Steven Bock (@dabockster)](https://github.com/dabockster): Added better Java sample (FizzBuzz instead of JUnit) [PR #1161](https://github.com/Microsoft/monaco-editor/pull/1161)
45-
* [Michele Gobbi (@dynamick)](https://github.com/dynamick): Added Ruby [PR #1102](https://github.com/Microsoft/monaco-editor/pull/1102)
46-
* [Edilson Ngulele (@EdNgulele)](https://github.com/EdNgulele): style: Updated CONTRIBUTING.md [PR #1088](https://github.com/Microsoft/monaco-editor/pull/1088)
47-
* [Evan Walters (@evanwaltersdev)](https://github.com/evanwaltersdev): issue guidelines [PR #1096](https://github.com/Microsoft/monaco-editor/pull/1096)
48-
* [Abdussalam Abdurrahman (@finalfantasia)](https://github.com/finalfantasia): [clojure] Update Clojure example with one that's more representative. [PR #1059](https://github.com/Microsoft/monaco-editor/pull/1059)
49-
* [@flash76](https://github.com/flash76): Update README.md [PR #1141](https://github.com/Microsoft/monaco-editor/pull/1141)
50-
* [Daniel Pasch (@gempir)](https://github.com/gempir): fix 2 of 7 npm package vurnerabilities [PR #1087](https://github.com/Microsoft/monaco-editor/pull/1087)
51-
* [@Hotlar](https://github.com/Hotlar): lingual fixes to readme [PR #1086](https://github.com/Microsoft/monaco-editor/pull/1086)
52-
* [Jeremy Meiss (@jerdog)](https://github.com/jerdog): correct README grammar [PR #1114](https://github.com/Microsoft/monaco-editor/pull/1114)
53-
* [Joaquim Honório (@JoaquimCMH)](https://github.com/JoaquimCMH): Update CHANGELOG [PR #1152](https://github.com/Microsoft/monaco-editor/pull/1152)
54-
* [Ricardo Ambrogi (@KadoBOT)](https://github.com/KadoBOT): Remove commented code [PR #1113](https://github.com/Microsoft/monaco-editor/pull/1113)
55-
* [Abhinav Srivastava (@krototype)](https://github.com/krototype): changed the license block of readme [PR #1133](https://github.com/Microsoft/monaco-editor/pull/1133)
56-
* [Mera Gangapersaud (@Mera-Gangapersaud)](https://github.com/Mera-Gangapersaud): Fixed prerequisites link in Contributing.md [PR #1155](https://github.com/Microsoft/monaco-editor/pull/1155)
57-
* [Michael (@michael-k)](https://github.com/michael-k): Use python examples that work [PR #1053](https://github.com/Microsoft/monaco-editor/pull/1053)
58-
* [Remy Suen (@rcjsuen)](https://github.com/rcjsuen): Add missing links in CHANGELOG.md [PR #1029](https://github.com/Microsoft/monaco-editor/pull/1029)
59-
* [Shivansh Saini (@shivanshs9)](https://github.com/shivanshs9): Fixed typos in website page and CHANGELOG [PR #1153](https://github.com/Microsoft/monaco-editor/pull/1153)
60-
* [Sachin Saini (@thetinygoat)](https://github.com/thetinygoat): hacktoberfest fix [PR #1131](https://github.com/Microsoft/monaco-editor/pull/1131)
61-
62-
Contributions to `monaco-languages`:
63-
64-
* [Aastha (@AasthaGupta)](https://github.com/AasthaGupta): Fix markdown bug #1107 [PR #52](https://github.com/Microsoft/monaco-languages/pull/52)
65-
* [Abdussalam Abdurrahman (@finalfantasia)](https://github.com/finalfantasia): [clojure] Improve Clojure syntax highlighting. [PR #45](https://github.com/Microsoft/monaco-languages/pull/45)
66-
* [Abhishek (@GeekAb)](https://github.com/GeekAb): Markdown bug fix for #1107 [PR #51](https://github.com/Microsoft/monaco-languages/pull/51)
67-
* [Matthew D. Miller (@goober99)](https://github.com/goober99): Added support for Perl quote-like operators to fix #1101 [PR #50](https://github.com/Microsoft/monaco-languages/pull/50)
68-
* [Grzegorz Wcisło (@grzegorz-wcislo)](https://github.com/grzegorz-wcislo): Fix yaml string tokenization [PR #47](https://github.com/Microsoft/monaco-languages/pull/47)
69-
* [Pascal Berger (@pascalberger)](https://github.com/pascalberger): Use C# highlighting for Cake scripts [PR #53](https://github.com/Microsoft/monaco-languages/pull/53)
70-
* [Sebastian Pahnke (@spahnke)](https://github.com/spahnke)
71-
* [JS/TS] Add support for alternative octal integer literal syntax [PR #49](https://github.com/Microsoft/monaco-languages/pull/49)
72-
* Improve tokenization of regular expressions [PR #46](https://github.com/Microsoft/monaco-languages/pull/46)
73-
* [Tiago Danin (@TiagoDanin)](https://github.com/TiagoDanin): New rule for non-teminated string in yaml [PR #48](https://github.com/Microsoft/monaco-languages/pull/48)
74-
75-
Contributions to `monaco-typescript`:
76-
77-
* [Parikshit Hooda (@Parikshit-Hooda)](https://github.com/Parikshit-Hooda): fixed typo in line 11 [PR #23](https://github.com/Microsoft/monaco-typescript/pull/23)
78-
* [Sebastian Pahnke (@spahnke)](https://github.com/spahnke): Render documentation in suggestion widget as Markdown [PR #22](https://github.com/Microsoft/monaco-typescript/pull/22)
79-
80-
Contributions to `monaco-json`:
81-
82-
* [Igor Nesterenko (@nesterone)](https://github.com/nesterone): Provide diagnostic option to enable on-demand schema loading [PR #7](https://github.com/Microsoft/monaco-json/pull/7)
83-
84-
Contributions to `monaco-css`:
85-
86-
* [Richard Samuelson (@ricsam)](https://github.com/ricsam): Fix indentation on the CSS test page [PR #7](https://github.com/Microsoft/monaco-css/pull/7)
87-
88-
1+
# Monaco Editor Change log
892

903
## [0.14.3] (17.08.2018)
914
* Fixes TypeScript/JavaScript coloring of regular expressions https://github.com/Microsoft/monaco-editor/issues/1009
@@ -134,7 +47,7 @@ Contributions to `monaco-editor`:
13447

13548
Contributions to `monaco-typescript`:
13649

137-
* [Fathy Boundjadj (@fathyb)](https://github.com/fathyb): Use Markdown code block for hover tooltip [PR #20](https://github.com/Microsoft/monaco-typescript/pull/20)
50+
* [Fathy Boundjadj (@fathyb)](https://github.com/fathyb): Use Mardown code block for hover tooltip [PR #20](https://github.com/Microsoft/monaco-typescript/pull/20)
13851
* [Matt McCutchen (@mattmccutchen)](https://github.com/mattmccutchen): Clear the `file` fields of `relatedInformation` too. (WIP) [PR #21](https://github.com/Microsoft/monaco-typescript/pull/21)
13952

14053
Contributions to `monaco-languages`:
@@ -252,7 +165,7 @@ Contributions to `monaco-languages`:
252165
### Notable Fixes
253166
* No longer use CSS class `.row` for command palette to avoid CSS conflicts with Bootstrap.
254167
* Fix Accessibility Help Dialog accessible issue on IE/Edge.
255-
* Fix Find Widget CSS compatibility issues with IE11.
168+
* Fix Find Widget CSS compability issues with IE11.
256169
* Toggle Block Comment can remove extra whitespaces.
257170

258171
### Thank you
@@ -282,7 +195,7 @@ Contributions to `monaco-languages`:
282195
* Support for the internal snippet syntax **has been discontinued** and snippet must now use the official, TextMate-like syntax. Find its grammar and samples [here](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax).
283196
* Changed `IModel.findMatches` to accept a list of word separators.
284197
* Changed the shape of the `IModelContentChangedEvent` emitted via `IModel.onDidChangeContent` to **now contain a batch** of all the changes that the model had.
285-
* No longer using `transform: translate3d`, now using `will-change: transform` for browser layer hinting. Use the `disableLayerHinting` option if you have any trouble with browser layers (blurriness or high GPU memory usage).
198+
* No longer using `transform: translate3d`, now using `will-change: transform` for browser layer hinting. Use the `disableLayerHinting` option if you have any trouble with browser layers (bluriness or high GPU memory usage).
286199
* Simplified wrapping settings: `wordWrap`, `wordWrapColumn` and `wordWrapMinified`.
287200

288201
### API changes
@@ -427,10 +340,10 @@ Contributions to `monaco-languages`:
427340
- removed `model.setMode()`, as `IMode` will soon disappear from the API.
428341

429342
### Debt work
430-
- Removed HTML, razor, PHP and handlebars from `monaco-editor-core`:
343+
- Removed html, razor, php and handlebars from `monaco-editor-core`:
431344
- the `monaco-editor-core` is now finally language agnostic.
432-
- coloring for HTML, razor, PHP and handlebars is now coming in from `monaco-languages`.
433-
- language smarts for HTML, razor and handlebars now comes from `monaco-html`.
345+
- coloring for html, razor, php and handlebars is now coming in from `monaco-languages`.
346+
- language smarts for html, razor and handlebars now comes from `monaco-html`.
434347
- Packaging improvements:
435348
- thanks to the removal of the old languages from `monaco-editor-core`, we could improve the bundling and reduce the number of .js files we ship.
436349
- we are thinking about simplifying this further in the upcoming releases.
@@ -505,15 +418,8 @@ Contributions to `monaco-languages`:
505418
- Broken configurations (loading from `file://` or misconfigured cross-domain loading) now load the web worker code in the UI thread. This caused a **breaking change** in the behaviour of `monaco.editor.createWebWorker`
506419
- The right-pointing mouse pointer is oversized in high DPI - [issue](https://github.com/Microsoft/monaco-editor/issues/5)
507420
- The editor functions now correctly when hosted inside a `position:fixed` element.
508-
- Cross-origin configuration is now picked up (as advertised in documentation from MonacoEnvironment)
509-
510-
[0.14.3]: https://github.com/Microsoft/monaco-editor/compare/v0.14.2...v0.14.3
511-
[0.14.2]: https://github.com/Microsoft/monaco-editor/compare/v0.14.1...v0.14.2
512-
[0.14.1]: https://github.com/Microsoft/monaco-editor/compare/v0.14.0...v0.14.1
513-
[0.14.0]: https://github.com/Microsoft/monaco-editor/compare/v0.13.1...v0.14.0
514-
[0.13.1]: https://github.com/Microsoft/monaco-editor/compare/v0.13.0...v0.13.1
515-
[0.13.0]: https://github.com/Microsoft/monaco-editor/compare/v0.12.0...v0.13.0
516-
[0.12.0]: https://github.com/Microsoft/monaco-editor/compare/v0.11.1...v0.12.0
421+
- Cross origin configuration is now picked up (as advertised in documentation from MonacoEnvironment)
422+
517423
[0.11.1]: https://github.com/Microsoft/monaco-editor/compare/v0.11.0...v0.11.1
518424
[0.11.0]: https://github.com/Microsoft/monaco-editor/compare/v0.10.1...v0.11.0
519425
[0.10.1]: https://github.com/Microsoft/monaco-editor/compare/v0.10.0...v0.10.1

app/monaco-editor/LICENSE

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
The MIT License (MIT)
2-
3-
Copyright (c) 2016 - present Microsoft Corporation
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 - present Microsoft Corporation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)