Skip to content

Commit 70dca6f

Browse files
authored
Cleanup deps (#1350)
* More dependency cleanup and router cleanup * Use global hadron
1 parent 7fc57e5 commit 70dca6f

File tree

4 files changed

+7
-33
lines changed

4 files changed

+7
-33
lines changed

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,11 @@
188188
"ampersand-collection": "^1.5.0",
189189
"ampersand-collection-filterable": "^0.2.1",
190190
"ampersand-dom-bindings": "^3.7.0",
191-
"ampersand-filtered-subcollection": "^2.0.4",
192-
"ampersand-form-view": "^5.2.2",
193-
"ampersand-input-view": "^5.0.0",
194191
"ampersand-model": "^6.0.2",
195192
"ampersand-rest-collection": "^5.0.0",
196193
"ampersand-router": "^3.0.2",
197-
"ampersand-select-view": "^4.3.2",
198194
"ampersand-state": "4.8.2",
199195
"ampersand-view": "^9.0.0",
200-
"ampersand-view-switcher": "^2.0.0",
201196
"app-migrations": "mongodb-js/app-migrations#v0.1.2",
202197
"async": "^1.5.2",
203198
"backoff": "^2.4.1",

src/app/index.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ var electron = require('electron');
2424
var APP_VERSION = electron.remote.app.getVersion();
2525

2626
var _ = require('lodash');
27-
var ViewSwitcher = require('ampersand-view-switcher');
2827
var View = require('ampersand-view');
2928
var async = require('async');
3029
var ipc = require('hadron-ipc');
@@ -117,8 +116,6 @@ var Application = View.extend({
117116
return debug('router already started!');
118117
}
119118
this.router = new Router();
120-
debug('Listening for page changes from the router...');
121-
this.listenTo(this.router, 'page', this.onPageChange);
122119

123120
debug('Starting router...');
124121
this.router.history.start({
@@ -180,11 +177,6 @@ var Application = View.extend({
180177

181178
this.el = document.querySelector('#application');
182179
this.renderWithTemplate(this);
183-
this.pageSwitcher = new ViewSwitcher(this.queryByHook('layout-container'), {
184-
show: function() {
185-
document.scrollTop = 0;
186-
}
187-
});
188180
debug('rendering statusbar...');
189181
this.statusComponent = app.appRegistry.getRole('Application.Status')[0].component;
190182
ReactDOM.render(React.createElement(this.statusComponent), this.queryByHook('statusbar'));
@@ -258,12 +250,6 @@ var Application = View.extend({
258250
this.showOptIn();
259251
}
260252
},
261-
onPageChange: function(view) {
262-
// connect dialog
263-
if (view.screenName) {
264-
this.pageSwitcher.set(view);
265-
}
266-
},
267253
onLinkClick: function(event) {
268254
const localLinks = require('local-links');
269255
const pathname = localLinks.getLocalPathname(event);

src/app/router.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
var AmpersandRouter = require('ampersand-router');
2-
var app = require('hadron-app');
3-
var React = require('react');
4-
var ReactDOM = require('react-dom');
1+
const AmpersandRouter = require('ampersand-router');
2+
const React = require('react');
3+
const ReactDOM = require('react-dom');
54

65
module.exports = AmpersandRouter.extend({
76
routes: {
8-
'': 'home',
9-
home: 'home',
10-
'home/:ns': 'home',
11-
'(*path)': 'catchAll'
7+
'': 'home'
128
},
139
home: function(ns) {
14-
this.homeView = app.appRegistry.getComponent('Home.Home');
10+
this.homeView = global.hadronApp.appRegistry.getComponent('Home.Home');
1511
this.trigger('page',
1612
ReactDOM.render(
1713
React.createElement(this.homeView, {ns: ns}),
18-
app.state.queryByHook('layout-container')
14+
global.hadronApp.state.queryByHook('layout-container')
1915
));
20-
},
21-
catchAll: function() {
22-
this.redirectTo('');
2316
}
2417
});

src/main/window-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if (process.platform === 'linux') {
4646
* The app's HTML shell which is the output of `./src/index.html`
4747
* created by the `build:pages` gulp task.
4848
*/
49-
var DEFAULT_URL = 'file://' + path.join(RESOURCES, 'index.html#connect');
49+
var DEFAULT_URL = 'file://' + path.join(RESOURCES, 'index.html');
5050
var LOADING_URL = 'file://' + path.join(RESOURCES, 'loading', 'loading.html');
5151

5252
// track if app was launched, @see `renderer ready` handler below

0 commit comments

Comments
 (0)