Add is-waypoint-record util (moved from ember-core) - #71
Open
roncodes wants to merge 1 commit into
Open
Conversation
Moved here from @fleetbase/ember-core, where it had been importing ../models/waypoint — a path that does not exist in that package, so the module threw for anyone who imported it. This is its natural home: the Waypoint model lives here, so the import is a plain relative one. It could not stay in ember-core, because ember-core cannot depend on fleetops-data (fleetops-data already depends on ember-core), leaving only an undeclared cross-package import or an optional peer dependency, both worse than putting the util beside the model it checks. No package used it in source, so nothing needs updating alongside this. The matches that show up elsewhere are in built dist bundles, which is ember-core's own code inlined into consumers' vendor files rather than real usage. Tested against a real waypoint, the place model waypoint extends, an unrelated record, a proxy, and plain and nullish values. Co-Authored-By: Claude Fable 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.
Why
isWaypointRecordlived in@fleetbase/ember-core, where it imported../models/waypoint— a path that does not exist in that package. Any consumer importing it gotCould not find module.This is its natural home: the
Waypointmodel is here, so the import is a plain relative one.It could not stay in ember-core. That package cannot depend on
@fleetbase/fleetops-data, because fleetops-data already depends on@fleetbase/ember-core— a direct dependency would be circular. The alternatives were an undeclared cross-package import or an optional peer dependency, both worse than putting the util beside the model it checks.Consumer impact
None. No package references it in source — checked across every package in the monorepo. The matches that appear elsewhere are inside built
dist/bundles, which is ember-core's own code inlined into consumers' vendor files, not real usage.Tests
Covers a real waypoint record, the
placemodel that waypoint extends (the check has to reject the parent while accepting the child), an unrelated record, anObjectProxywrapping a waypoint (instanceofsees the proxy, not its content), and plain and nullish values.Related
Removed from ember-core in fleetbase/ember-core#90.
🤖 Generated with Claude Code