Skip to content

Commit ce2da4f

Browse files
moved instantiation of vscode to effect, written components, re… (#2510)
moved instantiation of vscode to effect, written components, reviewed
2 parents ba5cf6d + 6b5f5b7 commit ce2da4f

File tree

274 files changed

+4892
-15284
lines changed

Some content is hidden

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

274 files changed

+4892
-15284
lines changed

.drone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ steps:
2626
- yarn build
2727

2828
- name: deploy
29-
image: lbogdan/codesandbox-deploy-plugin:2
29+
image: lbogdan/codesandbox-deploy-plugin:3
3030
settings:
3131
domain: &domain build.csb.dev
3232
volumes:
@@ -177,6 +177,6 @@ trigger:
177177
branch: master
178178
---
179179
kind: signature
180-
hmac: 015a8ddaa2fa145808e3c30ad05da71d03e3b8653b6bddb41547f13611397070
180+
hmac: e625eaf2e469b9b6763641d4cc1f089900ef8d8c41db32c6f6aacb27bee8c19c
181181

182182
...

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ npm-debug.log
2121
yarn-error.log
2222
.idea
2323
jest
24+
stats.json
2425

2526
lerna-debug.log
2627

packages/app/config/build.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { SANDBOX_ONLY } = process.env;
33
const staticAssets = [
44
!SANDBOX_ONLY && {
55
from: 'standalone-packages/vscode-editor/release/min/vs',
6-
to: 'public/vscode24/vs',
6+
to: 'public/vscode25/vs',
77
},
88
!SANDBOX_ONLY && {
99
from: 'standalone-packages/vscode-extensions/out',
@@ -30,6 +30,13 @@ const staticAssets = [
3030
from: 'packages/app/static',
3131
to: 'static',
3232
},
33+
{
34+
from: isDev
35+
? 'standalone-packages/codesandbox-browserfs/build'
36+
: 'standalone-packages/codesandbox-browserfs/dist',
37+
to: 'static/browserfs7',
38+
},
39+
// For caching purposes
3340
{
3441
from: isDev
3542
? 'standalone-packages/codesandbox-browserfs/build'

packages/app/config/webpack.common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ module.exports = {
384384
/browserfs\.min\.js/,
385385
/standalone-packages\/codesandbox-browserfs/,
386386
/standalone-packages\/vscode\//,
387+
/fontfaceobserver\.standalone\.js/,
387388
],
388389
},
389390

packages/app/config/webpack.prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ module.exports = merge(commonConfig, {
180180
},
181181
},
182182
{
183-
urlPattern: /\/vscode24/,
183+
urlPattern: /\/vscode25/,
184184
handler: 'cacheFirst',
185185
options: {
186186
cache: {

packages/app/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"license": "MIT",
1111
"scripts": {
1212
"build": "cross-env NODE_ENV=production NODE_OPTIONS=\"--max-old-space-size=4096\" node scripts/build.js",
13+
"build:stats": "cross-env NODE_ENV=production NODE_OPTIONS=\"--max-old-space-size=4096\" webpack --env production --config config/webpack.prod.js --json --profile --progress > stats.json && node scripts/stats",
1314
"build:clean": "rimraf www",
1415
"build:embed": "cross-env NODE_ENV=production webpack --config config/webpack.embed.js",
1516
"build:sandbox": "cross-env NODE_ENV=production SANDBOX_ONLY=true node scripts/build.js && yarn copy-assets",
@@ -69,8 +70,6 @@
6970
"@apollo/react-hooks": "^0.1.0-beta.2",
7071
"@babel/plugin-transform-destructuring": "^7.5.0",
7172
"@babel/preset-env": "^7.5.5",
72-
"@cerebral/http": "^4.0.0",
73-
"@cerebral/mobx-state-tree": "^3.0.0",
7473
"@codesandbox/executors": "^0.1.0",
7574
"@codesandbox/template-icons": "^1.0.1",
7675
"@emmetio/codemirror-plugin": "^0.3.5",
@@ -97,7 +96,6 @@
9796
"base64-loader": "^1.0.0",
9897
"browser-detect": "^0.2.28",
9998
"browser-resolve": "CompuIves/node-browser-resolve",
100-
"cerebral": "^4.0.0",
10199
"circular-json": "^0.4.0",
102100
"codemirror": "^5.27.4",
103101
"codesandbox-api": "0.0.23",

packages/app/scripts/copy-assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const assets = [
2525
},
2626
!SANDBOX_ONLY && {
2727
from: 'standalone-packages/vscode-editor/release/min/vs',
28-
to: 'public/vscode22/vs',
28+
to: 'public/vscode24/vs',
2929
},
3030
{
3131
from: 'packages/app/public',

packages/app/scripts/stats.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* eslint-disable */
2+
const stats = require('../stats.json');
3+
4+
const longTime = stats.modules.filter(stat => {
5+
if (stat.profile && stat.profile.building > 1000) {
6+
return stat;
7+
}
8+
});
9+
10+
longTime
11+
.sort((a, b) => (a.profile.building > b.profile.building ? 1 : -1))
12+
.forEach(stat => {
13+
console.log(
14+
JSON.stringify(
15+
{
16+
id: stat.id,
17+
profile: stat.profile,
18+
},
19+
null,
20+
2
21+
)
22+
);
23+
});

packages/app/src/app/components/CodeEditor/CodeMirror/index.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
// @flow
22

3-
import * as React from 'react';
4-
import CodeMirror from 'codemirror';
5-
import { withTheme } from 'styled-components';
6-
7-
import type { ModuleError, Module } from '@codesandbox/common/lib/types';
8-
import { resolveModule } from '@codesandbox/common/lib/sandbox/modules';
9-
import { getCodeMirror } from 'app/utils/codemirror';
10-
11-
import { listen } from 'codesandbox-api';
12-
133
import 'codemirror/addon/dialog/dialog';
144
import 'codemirror/addon/hint/show-hint';
155
import 'codemirror/addon/tern/tern';
166
import 'codemirror/addon/lint/lint.css';
177
import 'codemirror/addon/lint/lint';
188

19-
import FuzzySearch from '../FuzzySearch';
20-
import { Container, CodeContainer } from './elements';
21-
9+
import { resolveModule } from '@codesandbox/common/lib/sandbox/modules';
10+
import type { Module, ModuleError } from '@codesandbox/common/lib/types';
11+
import { getCodeMirror } from 'app/utils/codemirror';
12+
import CodeMirror from 'codemirror';
13+
import { listen } from 'codesandbox-api';
14+
import * as React from 'react';
15+
import { withTheme } from 'styled-components';
2216
// eslint-disable-next-line
23-
import LinterWorker from 'worker-loader?publicPath=/&name=monaco-linter.[hash:8].worker.js!../Monaco/workers/linter';
17+
import LinterWorker from 'worker-loader?publicPath=/&name=monaco-linter.[hash:8].worker.js!app/overmind/effects/vscode/LinterWorker/index';
2418

25-
import type { Props, Editor } from '../types';
19+
import FuzzySearch from '../FuzzySearch';
20+
import type { Editor, Props } from '../types';
21+
import { CodeContainer, Container } from './elements';
2622

2723
type State = { fuzzySearchEnabled: boolean };
2824

packages/app/src/app/components/CodeEditor/VSCode/Configuration/index.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@ import { ConfigurationFile } from '@codesandbox/common/lib/templates/configurati
22
import getUI from '@codesandbox/common/lib/templates/configuration/ui';
33
import theme from '@codesandbox/common/lib/theme';
44
import { Module } from '@codesandbox/common/lib/types';
5-
import { TextOperation } from 'ot';
6-
import React from 'react';
7-
85
import EntryIcons from 'app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/Entry/EntryIcons';
96
import getType from 'app/utils/get-type';
7+
import { TextOperation } from 'ot';
8+
import React from 'react';
109

11-
import { Props as EditorProps, Editor } from '../../types'; // eslint-disable-line
12-
13-
import { Container, Title, Description } from './elements';
10+
import { Editor, Props as EditorProps } from '../../types'; // eslint-disable-line
11+
import { Container, Description, Title } from './elements';
1412

1513
type Disposable = {
1614
dispose: () => void;
1715
};
1816

1917
type Props = EditorProps & {
2018
config: ConfigurationFile;
19+
onChange: (code: string, moduleShortid: string) => void;
2120
toggleConfigUI: () => void;
2221
onDidChangeDirty: (cb: () => void) => Disposable;
2322
getCode: () => string;

0 commit comments

Comments
 (0)