-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the rest of urcore, better init structure.
This is another rather big one: All remaining parts of ucore are removed. Init is now sync. Render starts only when backend connection is done.
- Loading branch information
Showing
23 changed files
with
218 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import { Provider } from 'ucore/react' | ||
|
||
import { App, makeCore } from './src/index.js' | ||
import { App } from './src/index.js' | ||
|
||
import extensions from '../../extensions' | ||
|
||
run() | ||
|
||
function run () { | ||
const core = makeCore(extensions) | ||
core.ready() | ||
|
||
render( | ||
<Provider core={core}> | ||
<App /> | ||
</Provider>, | ||
<App extensions={extensions} />, | ||
document.querySelector('div') | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,7 @@ | ||
import storeConstructor from './store' | ||
import ArchiveInfo from './ArchiveInfo' | ||
import ArchiveSharing from './ArchiveSharing' | ||
import { init as initArchiveStore } from './archive' | ||
import { init as initNetstatsStore } from './netStatsStore.js' | ||
|
||
import registry from '../../lib/component-registry.js' | ||
import { getApi } from '../../lib/api' | ||
|
||
export default { | ||
plugin: archivePlugin | ||
} | ||
|
||
registry.add('archiveTabs', ArchiveInfo, { title: 'Info' }) | ||
registry.add('archiveTabs', ArchiveSharing, { title: 'Sharing' }) | ||
|
||
// getApi().then(ready) | ||
// async function ready (api) { | ||
// let archiveStream = await api.hyperlib.createArchiveStream(true) | ||
// archiveStream.on('data', archive => { | ||
// // console.log('got archive', archive) | ||
// }) | ||
// } | ||
|
||
async function archivePlugin (core, opts) { | ||
let store = core.makeStore('archive', storeConstructor) | ||
|
||
let updateStream = await core.api.hyperlib.createArchiveStream() | ||
updateStream.on('data', data => { | ||
let key = data.key | ||
store.set(draft => { | ||
draft.archives[key] = data | ||
}) | ||
}) | ||
let statsStream = await core.api.hyperlib.createStatsStream() | ||
statsStream.on('data', data => { | ||
// do something with stats data. | ||
}) | ||
export default function start () { | ||
initArchiveStore() | ||
initNetstatsStore() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.