Skip to content

Commit a0dd744

Browse files
committed
Merge branch 'master' into improve/sandbox-load-time
2 parents b477c45 + 444d108 commit a0dd744

File tree

140 files changed

+7633
-1148
lines changed

Some content is hidden

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

140 files changed

+7633
-1148
lines changed

.circleci/config.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ aliases:
2626

2727
- &restore_deps_cache
2828
keys:
29-
- v33-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
30-
- v33-dependency-cache-{{ .Branch }}
31-
- v33-dependency-cache
29+
- v34-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
30+
- v34-dependency-cache-{{ .Branch }}
31+
- v34-dependency-cache
3232

3333
- &save_deps_cache
34-
key: v33-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
34+
key: v34-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
3535
paths:
3636
- node_modules
3737
- packages/app/node_modules
@@ -51,51 +51,51 @@ aliases:
5151

5252
- &restore_standalone_deps_cache
5353
keys:
54-
- v33-standalone-dependency-cache-{{ .Branch }}-{{ checksum
54+
- v34-standalone-dependency-cache-{{ .Branch }}-{{ checksum
5555
"standalone-packages/codesandbox-browserfs/yarn.lock" }}
56-
- v33-standalone-dependency-cache-{{ .Branch }}
57-
- v33-standalone-dependency-cache
56+
- v34-standalone-dependency-cache-{{ .Branch }}
57+
- v34-standalone-dependency-cache
5858

5959
- &save_standalone_deps_cache
6060
key:
61-
v33-standalone-dependency-cache-{{ .Branch }}-{{ checksum
61+
v34-standalone-dependency-cache-{{ .Branch }}-{{ checksum
6262
"standalone-packages/codesandbox-browserfs/yarn.lock" }}
6363
paths:
6464
- standalone-packages/codesandbox-browserfs/node_modules
6565

6666
- &restore_prod_homepage_cache
67-
key: v33-prod-homepage-build-cache-master
67+
key: v34-prod-homepage-build-cache-master
6868

6969
- &restore_prod_result
7070
key:
71-
v33-prod-build-result-{{ .Environment.CIRCLE_BRANCH
71+
v34-prod-build-result-{{ .Environment.CIRCLE_BRANCH
7272
}}-{{.Environment.CIRCLE_SHA1 }}
7373

7474
- &save_prod_build_cache
7575
key:
76-
v33-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
76+
v34-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
7777
}}-{{.Environment.CIRCLE_SHA1 }}
7878
paths:
7979
- packages/app/node_modules/.cache
8080

8181
- &restore_prod_build_cache
8282
keys:
83-
- v33-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
83+
- v34-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
8484
}}-{{.Environment.CIRCLE_SHA1 }}
85-
- v33-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-
86-
- v33-prod-build-cache-master-
85+
- v34-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-
86+
- v34-prod-build-cache-master-
8787

8888
# To persist the images built by sharp
8989
- &save_prod_homepage_cache
9090
key:
91-
v33-prod-homepage-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{
91+
v34-prod-homepage-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{
9292
.Environment.CIRCLE_SHA1 }}
9393
paths:
9494
- ./packages/homepage/public
9595

9696
- &save_prod_result
9797
key:
98-
v33-prod-build-result-{{ .Environment.CIRCLE_BRANCH }}-{{
98+
v34-prod-build-result-{{ .Environment.CIRCLE_BRANCH }}-{{
9999
.Environment.CIRCLE_SHA1 }}
100100
paths:
101101
- ./www
@@ -136,14 +136,14 @@ commands:
136136
steps:
137137
- restore_cache:
138138
keys:
139-
- v33-source-cache-{{ .Branch }}-{{ .Revision }}
140-
- v33-source-cache-{{ .Branch }}-
141-
- v33-source-cache-
139+
- v34-source-cache-{{ .Branch }}-{{ .Revision }}
140+
- v34-source-cache-{{ .Branch }}-
141+
- v34-source-cache-
142142

143143
- checkout
144144

145145
- save_cache:
146-
key: v33-source-cache-{{ .Branch }}-{{ .Revision }}
146+
key: v34-source-cache-{{ .Branch }}-{{ .Revision }}
147147
paths:
148148
- '.git'
149149
build_deps:

.drone.yml

Lines changed: 3 additions & 3 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:3
29+
image: lbogdan/codesandbox-deploy-plugin:4
3030
settings:
3131
domain: &domain build.csb.dev
3232
volumes:
@@ -124,7 +124,7 @@ steps:
124124
- yarn build
125125

126126
- name: deploy
127-
image: lbogdan/codesandbox-deploy-plugin:2
127+
image: lbogdan/codesandbox-deploy-plugin:4
128128
settings:
129129
domain: &domain build.csb.dev
130130
volumes:
@@ -177,6 +177,6 @@ trigger:
177177
branch: master
178178
---
179179
kind: signature
180-
hmac: e625eaf2e469b9b6763641d4cc1f089900ef8d8c41db32c6f6aacb27bee8c19c
180+
hmac: a229340365980b689bbe4c5f92d721cf3b6ce176670293a925f329501a054fe4
181181

182182
...

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
"javascriptreact",
77
{ "language": "typescript", "autoFix": true },
88
{ "language": "typescriptreact", "autoFix": true }
9-
]
9+
],
10+
"files.watcherExclude": {
11+
"**/node_modules": true,
12+
"**/node_modules/**": false
13+
}
1014
}

packages/app/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"apollo-boost": "^0.4.4",
8787
"apollo-link-batch-http": "^1.2.12",
8888
"apollo-link-context": "^1.0.18",
89+
"astring": "^1.4.3",
8990
"axios": "^0.19.0",
9091
"babel-code-frame": "^6.26.0",
9192
"babel-macros": "^2.0.0",
@@ -115,6 +116,7 @@
115116
"downshift": "^1.0.0-rc.14",
116117
"eslint-plugin-react-hooks": "1.6.0",
117118
"eslint-plugin-vue": "^4.2.2",
119+
"estree-walker": "^1.0.1",
118120
"file-saver": "^1.3.3",
119121
"fontfaceobserver": "^2.0.13",
120122
"fuse.js": "^3.2.1",
@@ -146,6 +148,7 @@
146148
"lodash-es": "^4.17.2",
147149
"lru-cache": "^4.1.3",
148150
"match-sorter": "^1.8.1",
151+
"meriyah": "^1.9.7",
149152
"minimatch": "^3.0.4",
150153
"mobx": "^5.11.0",
151154
"mobx-react": "^6.1.1",
@@ -158,9 +161,9 @@
158161
"normalizr": "^3.2.3",
159162
"onigasm": "^2.2.1",
160163
"ot": "^0.0.15",
161-
"overmind": "^21.0.0-1576231149763",
164+
"overmind": "^22.0.0-1579617484651",
162165
"overmind-devtools": "^19.0.0",
163-
"overmind-react": "^22.0.0-1576231149763",
166+
"overmind-react": "^23.0.0-1579617484651",
164167
"phoenix": "^1.4.11",
165168
"postcss": "^6.0.9",
166169
"postcss-selector-parser": "^2.2.3",
@@ -214,6 +217,7 @@
214217
"subworkers": "^1.0.1",
215218
"svg-react-loader": "^0.4.4",
216219
"tern": "^0.21.0",
220+
"use-interval": "^1.2.1",
217221
"util": "0.11.1",
218222
"vue": "^2.5.2",
219223
"vue-eslint-parser": "^2.0.3",

packages/app/src/app/overmind/effects/api/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,18 @@ export default {
4646

4747
return response.token;
4848
},
49-
createPatronSubscription(token: string, amount: number, coupon: string) {
49+
createPatronSubscription(
50+
token: string,
51+
amount: number,
52+
duration: 'monthly' | 'yearly',
53+
coupon: string
54+
) {
5055
return api.post<CurrentUser>('/users/current_user/subscription', {
5156
subscription: {
5257
amount,
5358
coupon,
5459
token,
60+
duration,
5561
},
5662
});
5763
},
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ResolveState } from 'overmind';
2+
import { Reaction, Config } from '..';
3+
4+
export default (() => {
5+
let _reaction: Reaction;
6+
7+
return {
8+
initialize(reaction: Reaction) {
9+
_reaction = reaction;
10+
},
11+
waitUntil(
12+
test: (state: ResolveState<Config['state']>) => boolean
13+
): Promise<boolean> {
14+
return new Promise(resolve => {
15+
_reaction(test, bool => {
16+
if (bool === true) {
17+
resolve();
18+
}
19+
});
20+
});
21+
},
22+
};
23+
})();

packages/app/src/app/overmind/effects/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ export { default as executor } from './executor';
2525
export { default as stripe } from './stripe';
2626
export { default as jwt } from './jwt';
2727
export { default as preview } from './preview';
28+
export { default as flows } from './flows';

packages/app/src/app/overmind/effects/live/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ export default {
195195
this.send('live:module_state', {});
196196
}
197197
},
198+
sendExternalResourcesChanged(externalResources: string[]) {
199+
return this.send('sandbox:external-resources', {
200+
externalResources,
201+
});
202+
},
198203
sendUserCurrentModule(moduleShortid: string) {
199204
return this.send('user:current-module', {
200205
moduleShortid,

packages/app/src/app/overmind/effects/notificationToast.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import {
1010
export default {
1111
convertTypeToStatus,
1212
add(notification: NotificationMessage) {
13-
notificationState.addNotification(notification);
13+
return notificationState.addNotification(notification);
14+
},
15+
remove(id: string) {
16+
notificationState.removeNotification(id);
1417
},
1518
error(message: string) {
1619
notificationState.addNotification({

0 commit comments

Comments
 (0)