Skip to content

Commit 76eeb5a

Browse files
authored
Embed support (codesandbox#7)
* Add embeds * Progress in embeds * Embedding progress * Finish embeds * Specify embedly * Add editor url * Allow options for main url as well * Make babel async generator main dep * More babel plugins
1 parent 380dd52 commit 76eeb5a

File tree

133 files changed

+6489
-723
lines changed

Some content is hidden

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

133 files changed

+6489
-723
lines changed

config/paths.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function resolveApp(relativePath) {
2323
const src = resolveApp('src');
2424
const appSrc = path.join(src, 'app');
2525
const sandboxSrc = path.join(src, 'sandbox');
26+
const embedSrc = path.join(src, 'embed');
2627

2728
// config after eject: we're in ./config/
2829
module.exports = {
@@ -34,6 +35,7 @@ module.exports = {
3435
src,
3536
appSrc,
3637
sandboxSrc,
38+
embedSrc,
3739
appNodeModules: resolveApp('node_modules'),
3840
ownNodeModules: resolveApp('node_modules'),
3941
nodePaths,

config/webpack.config.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ const config = {
5252
require.resolve('./polyfills'),
5353
path.join(paths.sandboxSrc, 'index.js'),
5454
],
55-
vendor: ['babel-standalone', 'codemirror', 'react', 'styled-components'],
55+
embed: [
56+
require.resolve('./polyfills'),
57+
path.join(paths.embedSrc, 'index.js'),
58+
],
59+
vendor: ['codemirror', 'react', 'react-dom', 'styled-components'],
5660
},
5761

5862
target: 'web',
@@ -192,6 +196,24 @@ const config = {
192196
minifyURLs: true,
193197
},
194198
}),
199+
new HtmlWebpackPlugin({
200+
inject: true,
201+
chunks: ['vendor', 'embed'],
202+
filename: 'embed.html',
203+
template: path.join(paths.embedSrc, 'index.html'),
204+
minify: __PROD__ && {
205+
removeComments: true,
206+
collapseWhitespace: true,
207+
removeRedundantAttributes: true,
208+
useShortDoctype: true,
209+
removeEmptyAttributes: true,
210+
removeStyleLinkTypeAttributes: true,
211+
keepClosingSlash: true,
212+
minifyJS: true,
213+
minifyCSS: true,
214+
minifyURLs: true,
215+
},
216+
}),
195217
// Makes some environment variables available to the JS code, for example:
196218
// if (process.env.NODE_ENV === 'development') { ... }. See `env.js`.
197219
new webpack.DefinePlugin(env),
@@ -226,6 +248,7 @@ if (__DEV__) {
226248
];
227249

228250
config.entry.app = [...devEntries, ...config.entry.app];
251+
config.entry.embed = [...devEntries, ...config.entry.embed];
229252
}
230253

231254
if (__PROD__) {

flow-typed/npm/autoprefixer_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 48cff332d8dbc4fef7bdfee9c9af1bbe
2-
// flow-typed version: <<STUB>>/autoprefixer_v^6.6.0/flow_v0.37.4
1+
// flow-typed signature: a1feacd63a3a8365b7f331bf9372676d
2+
// flow-typed version: <<STUB>>/autoprefixer_v^6.7.7/flow_v0.43.0
33

44
/**
55
* This is an autogenerated libdef stub for:

flow-typed/npm/babel-core_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: e5374ea2d55a1f89dd8c75f3e224f943
2-
// flow-typed version: <<STUB>>/babel-core_v^6.21.0/flow_v0.37.4
1+
// flow-typed signature: c429165753b6efc81cdaf5d9991baf55
2+
// flow-typed version: <<STUB>>/babel-core_v^6.21.0/flow_v0.43.0
33

44
/**
55
* This is an autogenerated libdef stub for:

flow-typed/npm/babel-eslint_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: b46ccd1d41acd642bb71bfff7cc58fef
2-
// flow-typed version: <<STUB>>/babel-eslint_v^7.1.1/flow_v0.37.4
1+
// flow-typed signature: 17a66f6409e310c0b8e272c7bb4400c8
2+
// flow-typed version: <<STUB>>/babel-eslint_v^7.1.1/flow_v0.43.0
33

44
/**
55
* This is an autogenerated libdef stub for:

flow-typed/npm/babel-jest_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 51d4b0b47762393443b387d205a0632d
2-
// flow-typed version: <<STUB>>/babel-jest_v^18.0.0/flow_v0.37.4
1+
// flow-typed signature: 71591a897e9fca2a6b850c5d1a4b1f86
2+
// flow-typed version: <<STUB>>/babel-jest_v^19.0.0/flow_v0.43.0
33

44
/**
55
* This is an autogenerated libdef stub for:

flow-typed/npm/babel-loader_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 9993a9f24a5ed8b6251a48dd5e994b31
2-
// flow-typed version: <<STUB>>/babel-loader_v^6.2.10/flow_v0.37.4
1+
// flow-typed signature: 0d9d22848bd3ddbab6e01dd42e2300d7
2+
// flow-typed version: <<STUB>>/babel-loader_v^6.2.10/flow_v0.43.0
33

44
/**
55
* This is an autogenerated libdef stub for:

flow-typed/npm/babel-plugin-lodash_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 50b19df9f51e3ffc3cf6ff99fd3bcb37
2-
// flow-typed version: <<STUB>>/babel-plugin-lodash_v^3.2.11/flow_v0.37.4
1+
// flow-typed signature: 1c20a1b1297f292636a33bcd8baa8fe5
2+
// flow-typed version: <<STUB>>/babel-plugin-lodash_v^3.2.11/flow_v0.43.0
33

44
/**
55
* This is an autogenerated libdef stub for:

flow-typed/npm/babel-plugin-transform-class-properties_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 6a1f626ec5c9266edcb7e52247f30890
2-
// flow-typed version: <<STUB>>/babel-plugin-transform-class-properties_v^6.19.0/flow_v0.37.4
1+
// flow-typed signature: 28a83de0b5c2eef9bf54c24c5dc3e096
2+
// flow-typed version: <<STUB>>/babel-plugin-transform-class-properties_v^6.19.0/flow_v0.43.0
33

44
/**
55
* This is an autogenerated libdef stub for:
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// flow-typed signature: 03fdf990451d5163224e1c01448bf09b
2+
// flow-typed version: <<STUB>>/babel-plugin-transform-decorators-legacy_v^1.3.4/flow_v0.43.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* 'babel-plugin-transform-decorators-legacy'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module 'babel-plugin-transform-decorators-legacy' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module 'babel-plugin-transform-decorators-legacy/lib/index' {
26+
declare module.exports: any;
27+
}
28+
29+
// Filename aliases
30+
declare module 'babel-plugin-transform-decorators-legacy/lib/index.js' {
31+
declare module.exports: $Exports<'babel-plugin-transform-decorators-legacy/lib/index'>;
32+
}

0 commit comments

Comments
 (0)