-
Notifications
You must be signed in to change notification settings - Fork 1
Replace monolithic ObjectStackKernel with plugin-based MiniKernel architecture #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a49c488
92f0485
8e005e5
b8a22bf
068c40f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||
| import { ObjectStackKernel, ObjectQLPlugin, ObjectQL } from '@objectstack/runtime'; | ||||||
| import { ObjectKernel, ObjectQLPlugin, DriverPlugin, AppManifestPlugin, ObjectQL } from '@objectstack/runtime'; | ||||||
|
||||||
| import { ObjectKernel, ObjectQLPlugin, DriverPlugin, AppManifestPlugin, ObjectQL } from '@objectstack/runtime'; | |
| import { ObjectKernel, ObjectQLPlugin, DriverPlugin, AppManifestPlugin } from '@objectstack/runtime'; |
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,13 @@ | |||||||||||||||||||||||||||||||||||||||||
| import { http, HttpResponse } from 'msw'; | |||||||||||||||||||||||||||||||||||||||||
| import { setupWorker } from 'msw/browser'; | |||||||||||||||||||||||||||||||||||||||||
| import { RuntimePlugin, RuntimeContext, ObjectStackRuntimeProtocol } from '@objectstack/runtime'; | |||||||||||||||||||||||||||||||||||||||||
| import { | |||||||||||||||||||||||||||||||||||||||||
| RuntimePlugin, | |||||||||||||||||||||||||||||||||||||||||
| RuntimeContext, | |||||||||||||||||||||||||||||||||||||||||
| Plugin, | |||||||||||||||||||||||||||||||||||||||||
| PluginContext, | |||||||||||||||||||||||||||||||||||||||||
| ObjectStackRuntimeProtocol, | |||||||||||||||||||||||||||||||||||||||||
| ObjectKernel | |||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+8
to
+9
|
|||||||||||||||||||||||||||||||||||||||||
| ObjectStackRuntimeProtocol, | |
| ObjectKernel | |
| ObjectStackRuntimeProtocol |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 months ago
To fix the unused import, remove ObjectKernel from the import list on line 3 while leaving all actually used imports intact. This will eliminate the unused symbol without affecting existing functionality.
Concretely, in packages/plugin-msw/src/msw-plugin.ts, edit the import from @objectstack/runtime so that ObjectKernel is no longer included in the named imports. No additional code changes or imports are needed, and no other lines must be modified.
-
Copy modified line R8 -
Copy modified line R11
| @@ -5,10 +5,10 @@ | ||
| RuntimeContext, | ||
| Plugin, | ||
| PluginContext, | ||
| ObjectStackRuntimeProtocol, | ||
| ObjectKernel | ||
| ObjectStackRuntimeProtocol | ||
| } from '@objectstack/runtime'; | ||
|
|
||
|
|
||
| export interface MSWPluginOptions { | ||
| /** | ||
| * Enable MSW in the browser environment |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MSWPlugin should declare a dependency on the ObjectQL plugin since it creates an ObjectStackRuntimeProtocol that requires ObjectQL to be available. Add dependencies = ['com.objectstack.engine.objectql'] to ensure proper initialization order. Without this, the plugin might start before ObjectQL is initialized, causing runtime errors.
| version = '1.0.0'; | |
| version = '1.0.0'; | |
| dependencies = ['com.objectstack.engine.objectql']; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Copilot Autofix
AI 2 months ago
In general, unused imports should be removed from the import list so the code only brings in what it actually uses. This improves readability and avoids potential linting or compilation warnings.
The best fix here is to edit
examples/host/src/index.tsand modify the first import statement: removeObjectQLfrom the destructured import from@objectstack/runtime, keeping the remaining imported names unchanged. No other code changes or new imports are required, and this will not alter runtime behavior becauseObjectQLwas never referenced.Concretely: in
examples/host/src/index.ts, line 1 currently imports{ ObjectKernel, ObjectQLPlugin, DriverPlugin, AppManifestPlugin, ObjectQL }. Replace that line with an import that only includes{ ObjectKernel, ObjectQLPlugin, DriverPlugin, AppManifestPlugin }.