Skip to content

Commit 9f43019

Browse files
committed
Support async code loading again
1 parent d3f2228 commit 9f43019

File tree

12 files changed

+29
-18
lines changed

12 files changed

+29
-18
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
tmp
22
node_modules
33
dist
4-
examples/*/app.build.js
5-
4+
examples/build

examples/auth-flow/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<title>Authentication Flow Example</title>
33
<link rel="stylesheet" href="../app.css"/>
44
<body>
5-
<script src="app.build.js"></script>
5+
<script src="../build/auth-flow.js"></script>
66

examples/data-flow/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<title>Data Flow Example</title>
33
<link href="app.css" rel="stylesheet"/>
44
<body>
5-
<script src="app.build.js"></script>
5+
<script src="../build/data-flow.js"></script>
66

examples/dynamic-segments/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<title>Managed ActiveRoute Example</title>
33
<link href="../app.css" rel="stylesheet"/>
44
<body>
5-
<script src="app.build.js"></script>
5+
<script src="../build/dynamic-segments.js"></script>

examples/managed-active-route/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<title>Managed ActiveRoute Example</title>
33
<link href="../app.css" rel="stylesheet"/>
44
<body>
5-
<script src="app.build.js"></script>
5+
<script src="../build/managed-active-route.js"></script>

examples/master-detail/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<title>Address Book Example</title>
33
<link href="app.css" rel="stylesheet"/>
44
<body>
5-
<script src="app.build.js"></script>
5+
<script src="../build/master-detail.js"></script>

examples/_partial-app-loading/app.js renamed to examples/partial-app-loading/app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ var AsyncJSXRoute = {
1414
}
1515

1616
require.ensure([], function() {
17-
console.log('loading', this.globalName, this.filePath);
1817
this.routeCache[this.globalName] = require('./async-components/' + this.filePath);
1918
this.forceUpdate();
2019
}.bind(this));
@@ -44,7 +43,7 @@ var Main = React.createClass({
4443

4544
var PreDashboard = React.createClass({
4645
mixins: [AsyncJSXRoute],
47-
filePath: 'partial-app-dashboard.js',
46+
filePath: 'dashboard.js',
4847
globalName: 'Dashboard',
4948
preRender: function() {
5049
return <div>Loading dashboard...</div>
@@ -53,7 +52,7 @@ var PreDashboard = React.createClass({
5352

5453
var PreInbox = React.createClass({
5554
mixins: [AsyncJSXRoute],
56-
filePath: 'partial-app-inbox.js',
55+
filePath: 'inbox.js',
5756
globalName: 'Inbox',
5857
preRender: function() {
5958
return <div>Loading inbox...</div>

examples/_partial-app-loading/async-components/dashboard.js renamed to examples/partial-app-loading/async-components/dashboard.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/** @jsx React.DOM */
2+
3+
var React = require('react');
4+
var ReactRouter = require('../../../lib/main');
5+
var Link = ReactRouter.Link;
6+
27
var Dashboard = React.createClass({
38

49
render: function() {
@@ -14,3 +19,4 @@ var Dashboard = React.createClass({
1419
}
1520
});
1621

22+
module.exports = Dashboard;

examples/_partial-app-loading/async-components/inbox.js renamed to examples/partial-app-loading/async-components/inbox.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/** @jsx React.DOM */
2+
3+
var React = require('react');
4+
25
var Inbox = React.createClass({
36

47
render: function() {
@@ -10,4 +13,4 @@ var Inbox = React.createClass({
1013
}
1114
});
1215

13-
16+
module.exports = Inbox;

examples/_partial-app-loading/index.html renamed to examples/partial-app-loading/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<title>Partial App Loading Example</title>
33
<link rel="stylesheet" href="../app.css"/>
44
<body>
5-
<script src="app.build.js"></script>
5+
<script src="../build/partial-app-loading.js"></script>

0 commit comments

Comments
 (0)