Skip to content

Commit 8ba3709

Browse files
committed
Merge branch 'master' into editor-modules
2 parents d271f29 + 9751f01 commit 8ba3709

File tree

64 files changed

+645
-169
lines changed

Some content is hidden

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

64 files changed

+645
-169
lines changed

.all-contributorsrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,16 @@
633633
"design",
634634
"ideas"
635635
]
636+
},
637+
{
638+
"login": "francoischalifour",
639+
"name": "François Chalifour",
640+
"avatar_url": "https://avatars3.githubusercontent.com/u/6137112?v=4",
641+
"profile": "https://francoischalifour.com",
642+
"contributions": [
643+
"bug",
644+
"code"
645+
]
636646
}
637647
],
638648
"repoType": "github"

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# [CodeSandbox](https://codesandbox.io) [![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/KE3TbEZ) [![All Contributors](https://img.shields.io/badge/all_contributors-65-orange.svg?style=flat-square)](#contributors) [![CircleCI](https://circleci.com/gh/CompuIves/codesandbox-client.svg?style=svg)](https://circleci.com/gh/CompuIves/codesandbox-client) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
1+
# [CodeSandbox](https://codesandbox.io) [![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/KE3TbEZ) [![All Contributors](https://img.shields.io/badge/all_contributors-66-orange.svg?style=flat-square)](#contributors) [![CircleCI](https://circleci.com/gh/CompuIves/codesandbox-client.svg?style=svg)](https://circleci.com/gh/CompuIves/codesandbox-client) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
2+
[![Backers on Open Collective](https://opencollective.com/codesandbox/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/codesandbox/sponsors/badge.svg)](#sponsors)
23

34
![Banner](https://codesandbox.io/static/img/banner.png)
45

@@ -49,5 +50,27 @@ Thanks goes to these wonderful people
4950
| [<img src="https://avatars0.githubusercontent.com/u/1820292?v=4" width="100px;"/><br /><sub><b>Michel Weststrate</b></sub>](https://twitter.com/mweststrate)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=mweststrate "Code") | [<img src="https://avatars0.githubusercontent.com/u/52824?v=4" width="100px;"/><br /><sub><b>Oleg</b></sub>](https://kof.github.io)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=kof "Code") | [<img src="https://avatars0.githubusercontent.com/u/1127037?v=4" width="100px;"/><br /><sub><b>Paul Sherman</b></sub>](https://www.pshrmn.com)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Apshrmn "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=pshrmn "Code") | [<img src="https://avatars2.githubusercontent.com/u/9244507?v=4" width="100px;"/><br /><sub><b>Ro Savage</b></sub>](https://github.com/ro-savage)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=ro-savage "Code") | [<img src="https://avatars3.githubusercontent.com/u/13242392?v=4" width="100px;"/><br /><sub><b>Sam Denty</b></sub>](https://samdd.me)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=samdenty99 "Code") | [<img src="https://avatars1.githubusercontent.com/u/3087225?v=4" width="100px;"/><br /><sub><b>Zephraph</b></sub>](https://github.com/zephraph)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=zephraph "Code") | [<img src="https://avatars1.githubusercontent.com/u/1900735?v=4" width="100px;"/><br /><sub><b>Josh Waller</b></sub>](https://www.joshwaller.me)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Amdxprograms "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=mdxprograms "Code") [📖](https://github.com/CompuIves/codesandbox-client/commits?author=mdxprograms "Documentation") |
5051
| [<img src="https://avatars0.githubusercontent.com/u/1195863?v=4" width="100px;"/><br /><sub><b>Joe Ng'ethe</b></sub>](http://joey.co.ke)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=joeynimu "Code") | [<img src="https://avatars0.githubusercontent.com/u/576935?v=4" width="100px;"/><br /><sub><b>Carles Codony</b></sub>](https://github.com/bitblitter)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=bitblitter "Code") | [<img src="https://avatars2.githubusercontent.com/u/468006?v=4" width="100px;"/><br /><sub><b>Vytenis</b></sub>](https://github.com/FDiskas)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=FDiskas "Code") | [<img src="https://avatars1.githubusercontent.com/u/894149?v=4" width="100px;"/><br /><sub><b>Manuel Dugué</b></sub>](http://manueldugue.de)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Amdugue "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=mdugue "Code") | [<img src="https://avatars2.githubusercontent.com/u/5346497?v=4" width="100px;"/><br /><sub><b>Demian Dekoninck</b></sub>](https://dem.be)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=DemianD "Code") | [<img src="https://avatars2.githubusercontent.com/u/3144549?v=4" width="100px;"/><br /><sub><b>Drake Costa</b></sub>](http://www.saeris.io)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=Saeris "Code") | [<img src="https://avatars2.githubusercontent.com/u/433394?v=4" width="100px;"/><br /><sub><b>Marko Stijak</b></sub>](https://cxjs.io/)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=mstijak "Code") |
5152
| [<img src="https://avatars2.githubusercontent.com/u/10588170?v=4" width="100px;"/><br /><sub><b>Ilya</b></sub>](https://twitter.com/ilya_komar0ff)<br />[💬](#question-Komar0ff "Answering Questions") [🤔](#ideas-Komar0ff "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/10627086?v=4" width="100px;"/><br /><sub><b>Emerson Laurentino</b></sub>](https://twitter.com/elaurent_)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=emersonlaurentino "Code") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Aemersonlaurentino "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/180963?v=4" width="100px;"/><br /><sub><b>Aaron Reisman</b></sub>](https://github.com/lifeiscontent)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Alifeiscontent "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=lifeiscontent "Code") [📦](#platform-lifeiscontent "Packaging/porting to new platform") | [<img src="https://avatars2.githubusercontent.com/u/19484365?v=4" width="100px;"/><br /><sub><b>Colton Colcleasure</b></sub>](https://github.com/colshacol)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=colshacol "Code") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Acolshacol "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/497242?v=4" width="100px;"/><br /><sub><b>PJ Walker</b></sub>](https://github.com/PJWalker)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3APJWalker "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=PJWalker "Code") | [<img src="https://avatars2.githubusercontent.com/u/29819102?v=4" width="100px;"/><br /><sub><b>Satya Rohith</b></sub>](https://satya.tech)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=satyarohith "Code") [📖](https://github.com/CompuIves/codesandbox-client/commits?author=satyarohith "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/17421347?v=4" width="100px;"/><br /><sub><b>Melanie Seltzer</b></sub>](https://www.melanieseltzer.io/)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=melanieseltzer "Code") |
52-
| [<img src="https://avatars1.githubusercontent.com/u/23313266?v=4" width="100px;"/><br /><sub><b>ZYSzys</b></sub>](http://zyszys.top)<br />[📖](https://github.com/CompuIves/codesandbox-client/commits?author=ZYSzys "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1051509?v=4" width="100px;"/><br /><sub><b>Sara Vieira</b></sub>](http://iamsaravieira.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=SaraVieira "Code") [🎨](#design-SaraVieira "Design") [🤔](#ideas-SaraVieira "Ideas, Planning, & Feedback") |
53+
| [<img src="https://avatars1.githubusercontent.com/u/23313266?v=4" width="100px;"/><br /><sub><b>ZYSzys</b></sub>](http://zyszys.top)<br />[📖](https://github.com/CompuIves/codesandbox-client/commits?author=ZYSzys "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1051509?v=4" width="100px;"/><br /><sub><b>Sara Vieira</b></sub>](http://iamsaravieira.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=SaraVieira "Code") [🎨](#design-SaraVieira "Design") [🤔](#ideas-SaraVieira "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/6137112?v=4" width="100px;"/><br /><sub><b>François Chalifour</b></sub>](https://francoischalifour.com)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Afrancoischalifour "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=francoischalifour "Code") |
5354
<!-- ALL-CONTRIBUTORS-LIST:END -->
55+
56+
## Backers
57+
58+
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/codesandbox#backer)]
59+
60+
<a href="https://opencollective.com/codesandbox#backers" target="_blank"><img src="https://opencollective.com/codesandbox/backers.svg?width=890"></a>
61+
62+
63+
## Sponsors
64+
65+
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/codesandbox#sponsor)]
66+
67+
<a href="https://opencollective.com/codesandbox/sponsor/0/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/0/avatar.svg"></a>
68+
<a href="https://opencollective.com/codesandbox/sponsor/1/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/1/avatar.svg"></a>
69+
<a href="https://opencollective.com/codesandbox/sponsor/2/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/2/avatar.svg"></a>
70+
<a href="https://opencollective.com/codesandbox/sponsor/3/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/3/avatar.svg"></a>
71+
<a href="https://opencollective.com/codesandbox/sponsor/4/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/4/avatar.svg"></a>
72+
<a href="https://opencollective.com/codesandbox/sponsor/5/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/5/avatar.svg"></a>
73+
<a href="https://opencollective.com/codesandbox/sponsor/6/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/6/avatar.svg"></a>
74+
<a href="https://opencollective.com/codesandbox/sponsor/7/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/7/avatar.svg"></a>
75+
<a href="https://opencollective.com/codesandbox/sponsor/8/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/8/avatar.svg"></a>
76+
<a href="https://opencollective.com/codesandbox/sponsor/9/website" target="_blank"><img src="https://opencollective.com/codesandbox/sponsor/9/avatar.svg"></a>

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"add-contributor": "all-contributors add",
2222
"generate": "all-contributors generate",
2323
"precommit": "lint-staged",
24-
"postinstall": "rimraf packages/app/node_modules/styled-components && yarn lerna run install-dependencies --scope codesandbox-browserfs --scope sse-loading-screen --stream"
24+
"postinstall": "rimraf packages/app/node_modules/styled-components && yarn lerna run install-dependencies --scope codesandbox-browserfs --scope sse-loading-screen --stream && opencollective postinstall"
2525
},
2626
"lint-staged": {
2727
"*.{js,css,json}": [
@@ -66,5 +66,13 @@
6666
"lerna": "^2.5.1",
6767
"lint-staged": "^5.0.0",
6868
"prettier": "^1.8.2"
69+
},
70+
"dependencies": {
71+
"opencollective": "^1.0.3"
72+
},
73+
"collective": {
74+
"type": "opencollective",
75+
"url": "https://opencollective.com/codesandbox",
76+
"logo": "https://opencollective.com/codesandbox/logo.txt"
6977
}
70-
}
78+
}

packages/app/config/webpack.prod.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,19 @@ module.exports = merge(commonConfig, {
111111
maximumFileSizeToCacheInBytes: 5242880,
112112

113113
runtimeCaching: [
114-
{
115-
urlPattern: /api\/v1\/sandboxes/,
116-
handler: 'networkFirst',
117-
options: {
118-
cache: {
119-
maxEntries: 50,
120-
name: 'sandboxes-cache',
121-
},
122-
},
123-
},
114+
// Don't add this runtime cache as this causes us to give back *old*
115+
// API responses, this will lead people to believe that they lost work
116+
// when they can't connect to our servers.
117+
// {
118+
// urlPattern: /api\/v1\/sandboxes/,
119+
// handler: 'networkFirst',
120+
// options: {
121+
// cache: {
122+
// maxEntries: 50,
123+
// name: 'sandboxes-cache',
124+
// },
125+
// },
126+
// },
124127
{
125128
urlPattern: /^https:\/\/unpkg\.com/,
126129
handler: 'cacheFirst',

packages/app/src/app/components/Preview/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @flow
22
import * as React from 'react';
33
import type { Sandbox, Module } from 'common/types';
4-
import { listen, dispatch, registerFrame } from 'codesandbox-api';
4+
import { listen, dispatch, registerFrame, resetState } from 'codesandbox-api';
55
import { debounce } from 'lodash-es';
66
import io from 'socket.io-client';
77

@@ -336,6 +336,8 @@ class BasePreview extends React.Component<Props, State> {
336336
handleSandboxChange = (newId: string) => {
337337
this.serverPreview = getTemplate(this.props.sandbox.template).isServer;
338338

339+
resetState();
340+
339341
const url = this.serverPreview
340342
? getSSEUrl(newId)
341343
: frameUrl(newId, this.props.initialPath || '');
@@ -360,7 +362,12 @@ class BasePreview extends React.Component<Props, State> {
360362
handleMessage = (data: Object, source: any) => {
361363
if (data && data.codesandbox) {
362364
if (data.type === 'initialized' && source) {
363-
registerFrame(source);
365+
registerFrame(
366+
source,
367+
this.serverPreview
368+
? getSSEUrl(this.props.sandbox.id)
369+
: frameUrl(this.props.sandbox.id)
370+
);
364371

365372
if (!this.state.frameInitialized && this.props.onInitialized) {
366373
this.disposeInitializer = this.props.onInitialized(this);

packages/app/src/app/pages/Dashboard/Content/Sandboxes/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class Content extends React.Component {
4949
<DelayedAnimation
5050
delay={0.6}
5151
style={{
52+
textAlign: 'center',
5253
marginTop: '2rem',
5354
fontWeight: 600,
5455
color: 'rgba(255, 255, 255, 0.5)',

packages/app/src/app/pages/Sandbox/SearchDependencies/DependencyHit/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default class DependencyHit extends React.PureComponent {
132132
const tagName = getTagName(hit.tags, v);
133133
return (
134134
<option key={v}>
135-
{v} {tagName ? `- ${tagName}` : ''}
135+
{v} {tagName && `- ${tagName}`}
136136
</option>
137137
);
138138
})}

packages/app/src/app/pages/Search/Filters/Filter/elements.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styled from 'styled-components';
1+
import styled, { css } from 'styled-components';
22

33
export const Container = styled.div`
44
padding: 1rem;
@@ -19,10 +19,37 @@ export const Container = styled.div`
1919
font-size: 0.875rem;
2020
padding-left: 2.5em;
2121
}
22+
23+
@media (max-width: 768px) {
24+
${props =>
25+
!props.open &&
26+
css`
27+
height: 30px;
28+
overflow: hidden;
29+
`};
30+
}
2231
`;
2332

2433
export const Title = styled.div`
2534
font-weight: 300;
2635
font-size: 1.25rem;
2736
margin-bottom: 1rem;
37+
display: flex;
38+
justify-content: space-between;
39+
align-items: center;
40+
41+
svg {
42+
display: none;
43+
width: 30px;
44+
height: 30px;
45+
@media (max-width: 768px) {
46+
display: block;
47+
}
48+
}
49+
`;
50+
51+
export const Button = styled.button`
52+
border: none;
53+
background: inherit;
54+
color: ${props => props.theme.white};
2855
`;
Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
import React from 'react';
2-
1+
import React, { Component } from 'react';
2+
import Down from 'react-icons/lib/md/expand-more';
3+
import Up from 'react-icons/lib/md/expand-less';
34
import { RefinementList } from 'react-instantsearch/dom';
45

5-
import { Container, Title } from './elements';
6+
import { Container, Title, Button } from './elements';
67

7-
function Filter({ title, attributeName, operator, noSearch }) {
8-
return (
9-
<Container>
10-
<Title>{title}</Title>
11-
<RefinementList
12-
withSearchBox={!noSearch}
13-
showMore={!noSearch}
14-
operator={operator}
15-
attributeName={attributeName}
16-
/>
17-
</Container>
18-
);
19-
}
8+
class Filter extends Component {
9+
state = { open: false };
2010

11+
toggle = () => this.setState(({ open }) => ({ open: !open }));
12+
render() {
13+
const { title, attributeName, operator, noSearch } = this.props;
14+
const { open } = this.state;
15+
return (
16+
<Container open={open}>
17+
<Title>
18+
<span>{title}</span>
19+
<Button onClick={this.toggle}>{open ? <Up /> : <Down />}</Button>
20+
</Title>
21+
<RefinementList
22+
withSearchBox={!noSearch}
23+
showMore={!noSearch}
24+
operator={operator}
25+
attributeName={attributeName}
26+
/>
27+
</Container>
28+
);
29+
}
30+
}
2131
export default Filter;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import styled from 'styled-components';
2+
3+
export const Container = styled.aside`
4+
flex: 1;
5+
@media (max-width: 768px) {
6+
width: 100%;
7+
}
8+
`;

0 commit comments

Comments
 (0)