Skip to content

feat(core): auto-generated classes inherit from parent with defineEntity extends#7404

Merged
B4nan merged 1 commit intonextfrom
feat/define-entity-extends-inheritance
Apr 18, 2026
Merged

feat(core): auto-generated classes inherit from parent with defineEntity extends#7404
B4nan merged 1 commit intonextfrom
feat/define-entity-extends-inheritance

Conversation

@B4nan
Copy link
Copy Markdown
Member

@B4nan B4nan commented Mar 26, 2026

Summary

  • When defineEntity is used without an explicit class option and with extends pointing to another schema or class, the auto-generated class now extends the parent class at the JS level
  • Previously only BaseEntity was special-cased — any other extends value produced a bare class {} with no prototype chain, so property initializers from the base class didn't run via super()
  • Uses duck-typing to resolve EntitySchema parent classes (runtime import of EntitySchema in typings.ts is blocked by circular dependency)
  • Added docs in define-entity.md (primary), inheritance-mapping.md, and entity-constructors.md

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.64%. Comparing base (8808779) to head (713a4e4).
⚠️ Report is 23 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff            @@
##             next    #7404    +/-   ##
========================================
  Coverage   99.64%   99.64%            
========================================
  Files         262      262            
  Lines       26080    26084     +4     
  Branches     7207     6756   -451     
========================================
+ Hits        25987    25991     +4     
  Misses         88       88            
  Partials        5        5            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@B4nan B4nan force-pushed the feat/define-entity-extends-inheritance branch 2 times, most recently from 280b519 to d48d769 Compare April 1, 2026 14:54
…tity` uses `extends`

Previously, only `BaseEntity` was handled as a special case when
generating classes for `defineEntity` without an explicit `class` option.
Now the auto-generated class extends the parent class regardless of
whether `extends` is a class constructor or an EntitySchema, so property
initializers from the base class run automatically via `super()`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@B4nan B4nan force-pushed the feat/define-entity-extends-inheritance branch from d48d769 to 713a4e4 Compare April 14, 2026 07:21
@B4nan B4nan changed the base branch from master to next April 18, 2026 14:50
@B4nan B4nan merged commit 501b244 into next Apr 18, 2026
22 checks passed
@B4nan B4nan deleted the feat/define-entity-extends-inheritance branch April 18, 2026 14:50
B4nan added a commit that referenced this pull request Apr 19, 2026
…ity extends (#7404)

## Summary

- When `defineEntity` is used without an explicit `class` option and
with `extends` pointing to another schema or class, the auto-generated
class now extends the parent class at the JS level
- Previously only `BaseEntity` was special-cased — any other `extends`
value produced a bare `class {}` with no prototype chain, so property
initializers from the base class didn't run via `super()`
- Uses duck-typing to resolve `EntitySchema` parent classes (runtime
import of `EntitySchema` in `typings.ts` is blocked by circular
dependency)
- Added docs in `define-entity.md` (primary), `inheritance-mapping.md`,
and `entity-constructors.md`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
B4nan added a commit that referenced this pull request Apr 20, 2026
…ity extends (#7404)

## Summary

- When `defineEntity` is used without an explicit `class` option and
with `extends` pointing to another schema or class, the auto-generated
class now extends the parent class at the JS level
- Previously only `BaseEntity` was special-cased — any other `extends`
value produced a bare `class {}` with no prototype chain, so property
initializers from the base class didn't run via `super()`
- Uses duck-typing to resolve `EntitySchema` parent classes (runtime
import of `EntitySchema` in `typings.ts` is blocked by circular
dependency)
- Added docs in `define-entity.md` (primary), `inheritance-mapping.md`,
and `entity-constructors.md`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant