Files
SpeedScope/src/speedscope.tsx
T
Jamie Wong e404053837 Add support for profiles w/ multiples processes & threads (#130)
More broadly, this just supports multiple profiles loaded into the editor in the same time, which supports import from profiles which are multithreaded by importing each thread as a different profile.

For now, the only two file formats that support multiprocess import are Instruments .trace files and speedscope's own file format

In the process of doing this, I refactored the container code considerably and extracted all the dispatch calls into containers rather than them being part of the non-container view code. This is nice because it means that views don't have to be aware of which Flamechart they are or which profile index is being operated upon.

Fixes #66
Fixes #82
Fixes #91
2018-08-11 22:06:53 -07:00

28 lines
796 B
TypeScript

import {h, render} from 'preact'
import {createApplicationStore} from './store'
import {Provider} from 'preact-redux'
import {ApplicationContainer} from './views/application-container'
console.log(`speedscope v${require('../package.json').version}`)
declare const module: any
if (module.hot) {
module.hot.dispose(() => {
// Force the old component go through teardown steps
render(<div />, document.body, document.body.lastElementChild || undefined)
})
module.hot.accept()
}
const lastStore: any = (window as any)['store']
const store = createApplicationStore(lastStore ? lastStore.getState() : {})
;(window as any)['store'] = store
render(
<Provider store={store}>
<ApplicationContainer />
</Provider>,
document.body,
document.body.lastElementChild || undefined,
)