Skip to content

Commit

Permalink
feat: only reload plugin when config changed
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Nov 21, 2024
1 parent ab9d527 commit 7d3a9fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/events.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Awaitable, defineProperty, Promisify } from 'cosmokit'
import { Awaitable, deepEqual, defineProperty, Promisify } from 'cosmokit'
import { Context } from './context'
import { EffectScope, ScopeStatus } from './scope'
import { getTraceable, symbols } from './utils'
Expand Down Expand Up @@ -124,6 +124,7 @@ class EventsService {
for (const acceptor of scope.acceptors) {
if (acceptor(scope, config)) return true
}
return deepEqual(scope.config, config)
}, { global: true }))
}

Expand Down
1 change: 0 additions & 1 deletion packages/loader/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ declare module '@cordisjs/core' {
'exit'(signal: NodeJS.Signals): Promise<void>
'loader/config-update'(): void
'loader/entry-init'(entry: Entry): void
'loader/entry-scope'(entry: Entry, type: string): void
'loader/entry-check'(entry: Entry): boolean | undefined
'loader/partial-dispose'(entry: Entry, legacy: Partial<EntryOptions>, active: boolean): void
'loader/before-patch'(this: EntryUpdateMeta, entry: Entry): void
Expand Down

0 comments on commit 7d3a9fe

Please sign in to comment.