Skip to content

Commit a2c3843

Browse files
committed
Remove unused code, update prod webpack build for previewScripts
1 parent 68897b7 commit a2c3843

File tree

5 files changed

+2
-27
lines changed

5 files changed

+2
-27
lines changed

client/modules/Preview/EmbedFrame.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import PropTypes from 'prop-types';
22
import React, { useRef, useEffect, useMemo } from 'react';
33
import styled from 'styled-components';
4-
// import escapeStringRegexp from 'escape-string-regexp';
5-
import srcDoc from 'srcdoc-polyfill';
64
import loopProtect from 'loop-protect';
75
import { JSHINT } from 'jshint';
86
import decomment from 'decomment';
@@ -16,7 +14,7 @@ import {
1614
EXTERNAL_LINK_REGEX,
1715
NOT_EXTERNAL_LINK_REGEX
1816
} from '../../../server/utils/fileUtils';
19-
import { startTag, getAllScriptOffsets } from '../../utils/consoleUtils';
17+
import { getAllScriptOffsets } from '../../utils/consoleUtils';
2018
import { registerFrame } from '../../utils/dispatcher';
2119
import { createBlobUrl } from './filesReducer';
2220

client/utils/previewEntry.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ import evaluateExpression from './evaluateExpression';
1111
const editor = window.parent.parent;
1212
const { editorOrigin } = window;
1313
const htmlOffset = 12;
14-
// const editorOrigin = '*';
15-
// const editorOrigin = 'http://localhost:8000';
16-
// so this works??
17-
// maybe i have to pass the parent window??? idk man
18-
// console.log(window.location);
1914
window.objectUrls[window.location.href] = '/index.html';
2015
const blobPath = window.location.href.split('/').pop();
2116
window.objectPaths[blobPath] = 'index.html';
@@ -66,19 +61,6 @@ function handleMessageEvent(e) {
6661

6762
window.addEventListener('message', handleMessageEvent);
6863

69-
function getScriptOff(line) {
70-
const { offs } = window;
71-
let l = 0;
72-
let file = '';
73-
for (let i = 0; i < offs.length; i += 1) {
74-
const n = offs[i][0];
75-
if (n < line && n > l) {
76-
l = n;
77-
[, file] = offs[i];
78-
}
79-
}
80-
return [line - l, file];
81-
}
8264
// catch reference errors, via http://stackoverflow.com/a/12747364/2994108
8365
window.onerror = function onError(msg, source, lineNumber, columnNo, error) {
8466
const urls = Object.keys(window.objectUrls);

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@
228228
"sinon": "^7.5.0",
229229
"sinon-mongoose": "^2.3.0",
230230
"slugify": "^1.3.6",
231-
"srcdoc-polyfill": "^1.0.0",
232231
"stacktrace-js": "^2.0.2",
233232
"styled-components": "^5.0.0",
234233
"styled-theming": "^2.2.0",

webpack/config.prod.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = {
2828
path.resolve(__dirname, '../client/modules/Preview/previewIndex.jsx')
2929
],
3030
previewScripts: [
31+
'@babel/polyfill',
3132
path.resolve(__dirname, '../client/utils/previewEntry.js')
3233
]
3334
},

0 commit comments

Comments
 (0)