mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
website: monaco loading improvements
Some checks failed
CI / CI (push) Has been cancelled
Some checks failed
CI / CI (push) Has been cancelled
This commit is contained in:
parent
5eb2aba338
commit
5181be1011
2 changed files with 8 additions and 0 deletions
|
|
@ -62,6 +62,10 @@ async function _loadMonaco(setup: IMonacoSetup): Promise<typeof monaco> {
|
||||||
return new Promise((res) => {
|
return new Promise((res) => {
|
||||||
// First load editor.main. If it inlines the plugins, we don't want to try to load them from the server.
|
// First load editor.main. If it inlines the plugins, we don't want to try to load them from the server.
|
||||||
req(["vs/editor/editor.main"], () => {
|
req(["vs/editor/editor.main"], () => {
|
||||||
|
if ((setup as any).onlyCore) {
|
||||||
|
res(monaco);
|
||||||
|
return;
|
||||||
|
}
|
||||||
req(
|
req(
|
||||||
[
|
[
|
||||||
"vs/basic-languages/monaco.contribution",
|
"vs/basic-languages/monaco.contribution",
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,10 @@ export class ControlledMonacoEditor extends React.Component<{
|
||||||
|
|
||||||
private lastSubscription: monaco.IDisposable | undefined;
|
private lastSubscription: monaco.IDisposable | undefined;
|
||||||
|
|
||||||
|
componentDidMount(): void {
|
||||||
|
this.componentDidUpdate({ value: "" });
|
||||||
|
}
|
||||||
|
|
||||||
componentDidUpdate(lastProps: this["props"]) {
|
componentDidUpdate(lastProps: this["props"]) {
|
||||||
const newOnDidValueChange = this.props.onDidValueChange;
|
const newOnDidValueChange = this.props.onDidValueChange;
|
||||||
if (newOnDidValueChange !== lastProps.onDidValueChange) {
|
if (newOnDidValueChange !== lastProps.onDidValueChange) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue