Skip to content

Commit 5fe92eb

Browse files
committed
Merge branch 'master' of https://github.com/popcodeorg/popcode into add-title-to-classroom-export
2 parents 20a2e6f + be2c23f commit 5fe92eb

26 files changed

Lines changed: 470 additions & 28 deletions

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ addons:
2323
- ubuntu-toolchain-r-test
2424
packages:
2525
- g++-4.8
26+
chrome: stable
2627
before_install:
2728
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.0.2
2829
- export PATH="$HOME/.yarn/bin:$PATH"

bower.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"lodash": "^4.11.2",
3434
"mustache.js": "mustache#^2.2.1",
3535
"normalize-css": "normalize.css#^4.1.1",
36+
"p5js": "^0.5.13",
3637
"react": "^15.0.1",
3738
"roboto-webfont-bower": "roboto-webfont#^0.1.1",
3839
"underscore": "^1.8.3"

karma.conf.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ module.exports = function(config) {
7777
reporters: ['dots', 'BrowserStack'],
7878
});
7979
} else if (isCi) {
80-
config.set({browsers: ['ChromeHeadless']});
80+
config.set({
81+
browsers: ['ChromeHeadlessNoSandbox'],
82+
customLaunchers: {
83+
ChromeHeadlessNoSandbox: {
84+
base: 'ChromeHeadless',
85+
flags: ['--no-sandbox'],
86+
},
87+
},
88+
});
8189
}
8290
};

src/actions/clients.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ export const createSnapshot = createAction('CREATE_SNAPSHOT');
44
export const snapshotCreated = createAction('SNAPSHOT_CREATED');
55
export const snapshotExportError = createAction('SNAPSHOT_EXPORT_ERROR');
66
export const snapshotNotFound = createAction('SNAPSHOT_NOT_FOUND');
7-
export const snapshotImported = createAction('SNAPSHOT_IMPORTED');
7+
export const snapshotImported = createAction(
8+
'SNAPSHOT_IMPORTED',
9+
(projectKey, project) => ({projectKey, project}),
10+
);
811
export const snapshotImportError = createAction('SNAPSHOT_IMPORT_ERROR');
912
export const projectRestoredFromLastSession =
1013
createAction('PROJECT_RESTORED_FROM_LAST_SESSION');

src/components/PreviewFrame.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Bowser from 'bowser';
66
import bindAll from 'lodash/bindAll';
77
import {t} from 'i18next';
88
import normalizeError from '../util/normalizeError';
9+
import retryingFailedImports from '../util/retryingFailedImports';
910
import {sourceDelimiter} from '../util/compileProject';
1011
import {CompiledProject as CompiledProjectRecord} from '../records';
1112

@@ -41,15 +42,21 @@ class PreviewFrame extends React.Component {
4142
return false;
4243
}
4344

44-
_evaluateConsoleExpression(key, expression) {
45+
async _evaluateConsoleExpression(key, expression) {
46+
const {hasExpressionStatement} = await retryingFailedImports(
47+
() => import(
48+
/* webpackChunkName: 'mainAsync' */
49+
'../util/javascript',
50+
),
51+
);
4552
// eslint-disable-next-line prefer-reflect
4653
this._channel.call({
4754
method: 'evaluateExpression',
4855
params: expression,
4956
success: (printedResult) => {
5057
this.props.onConsoleValue(
5158
key,
52-
printedResult,
59+
hasExpressionStatement(expression) ? printedResult : null,
5360
this.props.compiledProject.compiledProjectKey,
5461
);
5562
},

0 commit comments

Comments
 (0)