mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: update cordis to 2.6.0
This commit is contained in:
1 parent
afe40ec835
commit
9219bbfc24
7 files changed
+19
-19
No files matched your search
@@ -45,9 +45,9 @@ export namespace Context {
|
||||
export interface Config extends cordis.Context.Config { }
|
||||
}
|
||||
|
||||
export type Runtime = cordis.Runtime<Context>;
|
||||
export type State = cordis.State<Context>;
|
||||
export type Fork = cordis.Fork<Context>;
|
||||
export type MainScope = cordis.MainScope<Context>;
|
||||
export type EffectScope = cordis.EffectScope<Context>;
|
||||
export type ForkScope = cordis.ForkScope<Context>;
|
||||
export type Plugin = cordis.Plugin<Context>;
|
||||
export const Service = cordis.Service<Context>;
|
||||
export namespace Plugin {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { relative, resolve } from 'path';
|
||||
import { FSWatcher, watch } from 'chokidar';
|
||||
import { debounce } from 'lodash';
|
||||
import { Context, Runtime, Service } from '../context';
|
||||
import { Context, MainScope, Service } from '../context';
|
||||
import { Logger } from '../logger';
|
||||
import { unwrapExports } from '../utils';
|
||||
|
||||
@@ -142,10 +142,10 @@ export default class Watcher extends Service {
|
||||
this.analyzeChanges();
|
||||
|
||||
/** plugins pending classification */
|
||||
const pending = new Map<string, Runtime>();
|
||||
const pending = new Map<string, MainScope>();
|
||||
|
||||
/** plugins that should be reloaded */
|
||||
const reloads = new Map<Runtime, string>();
|
||||
const reloads = new Map<MainScope, string>();
|
||||
|
||||
// we assume that plugin entry files are "atomic"
|
||||
// that is, reloading them will not cause any other reloads
|
||||
@@ -172,7 +172,7 @@ export default class Watcher extends Service {
|
||||
|
||||
// prepare for reload
|
||||
let isMarked = false;
|
||||
const visited = new Set<Runtime>();
|
||||
const visited = new Set<MainScope>();
|
||||
const queued = [runtime];
|
||||
while (queued.length) {
|
||||
const runtime = queued.shift();
|
||||
|
||||
Reference in new issue
Block a user