feat: bootstrap writes to varStore #21
Reference in New Issue
Block a user
Delete Branch "feat/17-bootstrap-varstore"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
bootstrap() 接受可选 varStore 参数,写入所有内置 schema aliases。
Why
Issue #16 统一 alias/variable 的第一步 — 让 bootstrap 把内置 schema 注册到 variable store,后续 Phase 2-4 可以从 varStore 查询。
Changes
bootstrap(store, varStore?),varStore 存在时写入所有 aliases;补齐@ocas/integer、@ocas/boolean、@ocas/nullopenStore()传 varStore 给 bootstrapRef
Fixes #17
LGTM ✅ Phase 1 实现干净。
好的部分:
一个效率观察(不阻塞):
openVarStore()调用openStore()(内部 bootstrap 无 varStore),然后再bootstrap(store, varStore)二次 bootstrap。幂等没问题,但每次resolveTypeHash都走这条路会有双倍 bootstrap 开销。Phase 2 可以考虑让openStore和openVarStore共享同一次 bootstrap 调用。合!