Repository navigation
Component/resource name clash always throws - #213
Merged
Merged
Conversation
A resource is stored as a same-named component column on its own entity, so a name that is both collides: the resource schema replaced the component's, and component queries returned the resource entity. Store.create now throws in either direction (even for identical schemas), Database.Plugin.create rejects a clash at compile time within a plugin and across extends/imports, and the nameClashes option is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #212, which merged before this commit landed: a component/resource name clash now always throws.
A resource is stored as a same-named component column on its own entity, so components and resources share one name space. A resource reusing a component's name used to replace the component's schema silently (#211 made that a warning, #212 added a
nameClashesacknowledgement). Replacing it changes the column's type and flags, for example making every entity's value non-persistent, and every query on the component also returns the resource's entity.Store.createthrows"<name>" is both a component and a resource…in both directions, even when the schemas are identical.Database.Plugin.createrejects a clash within one plugin and against itsextends/imports. A clash formed throughPlugin.combineis caught at runtime.nameClashesoption from Name clashes throw, optional struct fields, toTypeScript fixes #212 is gone. It is unpublished, so nothing depends on it.Testing
pnpm run lintandpnpm run typecheck(with build caches cleared) pass, as dopnpm run check:workspaceandpnpm run build.pnpm run testpasses in every package, including 3,611 tests indata.extendsand throughPlugin.combine.extends, and keep inference for distinct names. Type instantiations inpackages/datago up by about 1.3%.🤖 Generated with Claude Code