Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ture Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
| */ | ||
|
|
||
| import { ObjectStackKernel, ObjectQLPlugin, ObjectQL, SchemaRegistry } from '../packages/runtime/src'; | ||
| import { ObjectKernel, ObjectQLPlugin, ObjectQL, SchemaRegistry } from '../packages/runtime/src'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 months ago
In general, unused imports should be removed to keep the code clear and avoid confusion about what is actually needed. This also prevents potential linting or build warnings and can marginally improve performance by not pulling in unneeded symbols.
Here, the best fix is simply to remove SchemaRegistry from the import list on line 10 of test-objectql-plugin.ts, leaving the other three imported symbols intact. No other lines need to change, and no new methods or imports are required. Functionality will remain exactly the same because SchemaRegistry is not referenced anywhere in the file.
| @@ -7,7 +7,7 @@ | ||
| * 3. Multiple plugins with ObjectQL work | ||
| */ | ||
|
|
||
| import { ObjectKernel, ObjectQLPlugin, ObjectQL, SchemaRegistry } from '../packages/runtime/src'; | ||
| import { ObjectKernel, ObjectQLPlugin, ObjectQL } from '../packages/runtime/src'; | ||
|
|
||
| async function testPluginBasedRegistration() { | ||
| console.log('\n=== Test 1: Plugin-based ObjectQL Registration ==='); |
There was a problem hiding this comment.
Pull request overview
This PR completes the migration to microkernel architecture by removing all backward compatibility code for the deprecated ObjectStackKernel monolithic runtime. Following PR #333 which introduced the new plugin-based ObjectKernel, this cleanup PR removes legacy interfaces, deprecated kernel implementation, and updates all documentation to reflect the new architecture exclusively.
Changes:
- Removed
ObjectStackKernelclass and all legacyRuntimePlugin/RuntimeContextinterfaces from the runtime package - Cleaned up dual-kernel support logic from
ObjectStackRuntimeProtocol,ObjectQLPlugin,MSWPlugin, andHonoServerPlugin - Updated all documentation to remove migration guides and "Before/After" comparisons, showing only the microkernel pattern
- Updated test suite to validate new microkernel-only architecture
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
packages/runtime/src/kernel.ts |
Removed entire legacy ObjectStackKernel implementation (229 lines) |
packages/runtime/src/types.ts |
Removed RuntimePlugin and RuntimeContext interfaces, updated PluginContext to only support ObjectKernel |
packages/runtime/src/protocol.ts |
Removed dual-kernel detection logic, now only supports ObjectKernel |
packages/runtime/src/objectql-plugin.ts |
Removed legacy install method for backward compatibility |
packages/runtime/src/mini-kernel.ts |
Removed RuntimePlugin type guards and legacy plugin lifecycle support |
packages/runtime/src/index.ts |
Removed deprecated ObjectStackKernel export |
packages/plugin-msw/src/msw-plugin.ts |
Removed RuntimePlugin interface implementation and legacy lifecycle methods |
packages/plugin-hono-server/src/hono-plugin.ts |
Removed RuntimePlugin interface implementation and legacy lifecycle methods |
packages/runtime/README.md |
Removed migration guide and legacy support documentation |
test-objectql-plugin.ts |
Updated tests to use microkernel pattern and verify error handling for missing services |
OBJECTQL_PLUGIN_QUICKSTART.md |
Updated all examples to use ObjectKernel chaining pattern |
MINI_KERNEL_*.md files |
Removed "Before/After" architecture comparisons and migration sections |
examples/msw-react-crud/QUICKSTART.md |
Updated code examples to use ObjectKernel |
Comments suppressed due to low confidence (1)
OBJECTQL_PLUGIN_QUICKSTART.md:204
- The documentation shows
ObjectKernelhaving aqlproperty, but this is incorrect after the microkernel migration. In the new architecture,ObjectKerneldoes not have aqlproperty - instead, ObjectQL is accessed via the service registry usingkernel.getService<ObjectQL>('objectql').
This code snippet should be updated to reflect the actual ObjectKernel implementation or removed entirely as it no longer applies to the microkernel architecture.
The kernel's `ql` property is typed as optional:
```typescript
export class ObjectKernel {
public ql?: ObjectQL;
private ensureObjectQL(): ObjectQL {
if (!this.ql) {
throw new Error('ObjectQL engine not initialized');
}
return this.ql;
}
}
| * kernel.use(server); | ||
| */ | ||
| export class HonoServerPlugin implements Plugin, RuntimePlugin { | ||
| export class HonoServerPlugin implements Plugin { |
There was a problem hiding this comment.
The package @objectstack/plugin-hono-server has two different implementations of HonoServerPlugin:
hono-plugin.ts- Updated to use the newPlugininterface (included in this PR)index.ts- Still using the oldRuntimePlugininterface (NOT included in this PR)
According to package.json, the entry point is dist/index.js, which means the old RuntimePlugin implementation in index.ts will be exported, while the updated hono-plugin.ts will be ignored. This creates an inconsistency where the package still exports legacy code that depends on RuntimePlugin and RuntimeContext which are being removed from @objectstack/runtime.
Either:
- Update
index.tsto match the changes inhono-plugin.ts, or - Change the package entry point to use
hono-plugin.tsinstead ofindex.ts, or - Remove the duplicate implementation and ensure only one file exists
| import { ObjectKernel } from './mini-kernel.js'; | ||
|
|
There was a problem hiding this comment.
The @objectstack/types package still exports RuntimePlugin and RuntimeContext interfaces. However, these interfaces are being removed from @objectstack/runtime in this PR. This creates a discrepancy where:
- The types package defines these legacy interfaces
- The runtime package no longer supports or exports them
- Files like
packages/plugin-hono-server/src/index.tsimport from@objectstack/typesand still implement the legacy interfaces
For a clean removal of legacy code, the RuntimePlugin, RuntimeContext, and IKernel interfaces should also be removed from the @objectstack/types package, or this PR should not claim to completely remove backward compatibility.
| */ | ||
|
|
||
| import { ObjectStackKernel, ObjectQLPlugin, ObjectQL, SchemaRegistry } from '../packages/runtime/src'; | ||
| import { ObjectKernel, ObjectQLPlugin, ObjectQL, SchemaRegistry } from '../packages/runtime/src'; |
There was a problem hiding this comment.
Unused import SchemaRegistry.
| import { ObjectKernel, ObjectQLPlugin, ObjectQL, SchemaRegistry } from '../packages/runtime/src'; | |
| import { ObjectKernel, ObjectQLPlugin, ObjectQL } from '../packages/runtime/src'; |
Post-merge cleanup for #333. Removes backward compatibility layer for deprecated
ObjectStackKernelmonolithic runtime. Codebase now exclusively usesObjectKernelmicrokernel architecture.Code Changes
Removed:
packages/runtime/src/kernel.ts- ObjectStackKernel class (230 lines)RuntimePlugin/RuntimeContextinterfacesObjectStackRuntimeProtocolUpdated:
mini-kernel.ts- Removed legacy plugin compatibility checksobjectql-plugin.ts- Removed backward compatibility shimsplugin-msw,plugin-hono-server- Now implementPlugininterface onlyDocumentation Changes
Updated all docs to show microkernel pattern only:
Removed migration guides and "Before/After" comparisons.
Breaking Changes
Applications using
ObjectStackKernelmust migrate to plugin-based architecture.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.