mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
e9b87686e1
* Upgrade electron-builder * Fix optional dep * Add another dep * Fix travis * Fix 7zip install * Fix icons * Minor fix * Delete changelog * Moved build scripts to JS * Some adjustments * Remove lines * Add 7zip back * Update scripts * Small tweaks * Fix electronbuilder config * snap dependency * Fix pkg * Remove snapd dep * Updated deps and lots of fixes * Travis update * Return package name * Remove snap for now * Remove portable * Try fixing code signing * Bump cache * Disable automatic tests * Fix windows artifacts * package-lock for app/ * Try fix npm install * Try again * Some minor tweaks * Preleases by default
71 lines
1.8 KiB
JavaScript
71 lines
1.8 KiB
JavaScript
import * as React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import {AppContainer} from 'react-hot-loader';
|
|
import {Provider} from 'react-redux';
|
|
import {DragDropContext} from 'react-dnd';
|
|
import App from './containers/app';
|
|
import * as models from '../models';
|
|
import * as db from '../common/database';
|
|
import {init as initStore} from './redux/modules';
|
|
import {init as initSync} from '../sync';
|
|
import {init as initPlugins} from '../plugins';
|
|
import DNDBackend from './dnd-backend';
|
|
import './css/index.less';
|
|
import {isDevelopment} from '../common/constants';
|
|
import {trackEvent, trackPageView} from '../common/analytics';
|
|
|
|
(async function () {
|
|
await db.initClient();
|
|
|
|
// Create Redux store
|
|
const store = await initStore();
|
|
|
|
const context = DragDropContext(DNDBackend);
|
|
const DndComponent = context(App);
|
|
const render = Component => {
|
|
ReactDOM.render(
|
|
<AppContainer>
|
|
<Provider store={store}>
|
|
<Component/>
|
|
</Provider>
|
|
</AppContainer>,
|
|
document.getElementById('root')
|
|
);
|
|
};
|
|
|
|
render(DndComponent);
|
|
|
|
// Hot Module Replacement API
|
|
if (module.hot) {
|
|
module.hot.accept('./containers/app', () => {
|
|
render(DndComponent);
|
|
});
|
|
}
|
|
|
|
// Do things that can wait
|
|
process.nextTick(initSync);
|
|
process.nextTick(initPlugins);
|
|
})();
|
|
|
|
// Export some useful things for dev
|
|
if (isDevelopment()) {
|
|
window.models = models;
|
|
window.db = db;
|
|
}
|
|
|
|
// Catch uncaught errors and report them
|
|
if (window && !isDevelopment()) {
|
|
window.addEventListener('error', e => {
|
|
trackEvent('Error', 'Uncaught Error');
|
|
console.error('Uncaught Error', e);
|
|
});
|
|
|
|
window.addEventListener('unhandledRejection', e => {
|
|
trackEvent('Error', 'Uncaught Promise');
|
|
console.error('Unhandled Promise', e);
|
|
});
|
|
}
|
|
|
|
// Track the page view
|
|
trackPageView();
|