# @ember-data-mirror/model

> (Legacy) Ember implementation of a resource presentation layer for use with @ember-data-mirror/store

Latest version **5.9.1** (published 2026-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ember-data-mirror/model
pnpm add @ember-data-mirror/model
yarn add @ember-data-mirror/model
bun add @ember-data-mirror/model
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 5.9.1 |
| Published | 2026-09-05 |
| First published | 2024-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 304.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3155 |
| Maintainers | ember-data-admin, runspired, richgt, hm_krystan, katiegengler |
| Keywords | ember-addon |

## Links

- npm: https://www.npmjs.com/package/@ember-data-mirror/model
- Repository: https://github.com:warp-drive-data/warp-drive
- npm.io page: https://npm.io/package/@ember-data-mirror/model

## Dependencies (5)

- [warp-drive](https://npm.io/package/warp-drive.md) 0.2.1
- [@embroider/macros](https://npm.io/package/@embroider/macros.md) ^1.20.6
- [@warp-drive-mirror/core](https://npm.io/package/@warp-drive-mirror/core.md) 5.9.1
- [@warp-drive-mirror/legacy](https://npm.io/package/@warp-drive-mirror/legacy.md) 5.9.1
- [@warp-drive-mirror/utilities](https://npm.io/package/@warp-drive-mirror/utilities.md) 5.9.1

## Recent versions

- 5.9.1 (latest) — 2026-09-05
- 5.10.0-alpha.10 (canary) — 2026-09-23
- 5.9.0-beta.3 (beta) — 2026-09-05
- 4.13.0-alpha.9 (v4-canary) — 2025-05-15
- 5.10.0-alpha.9 — 2026-09-22
- 5.10.0-alpha.8 — 2026-09-18
- 5.10.0-alpha.7 — 2026-09-15
- 5.10.0-alpha.6 — 2026-09-11
- 5.10.0-alpha.5 — 2026-09-11
- 5.10.0-alpha.4 — 2026-09-10
- 5.10.0-alpha.3 — 2026-09-10
- 5.10.0-alpha.2 — 2026-09-10
- 5.10.0-alpha.1 — 2026-09-08
- 5.10.0-alpha.0 — 2026-09-05
- 5.9.0 — 2026-09-05
- … 291 more at https://npm.io/package/@ember-data-mirror/model/versions

## README

<p align="center">
  <img
    class="project-logo"
    src="./logos/logo-yellow-slab.svg"
    alt="WarpDrive"
    width="180px"
    title="WarpDrive"
    />
</p>

![NPM Stable Version](https://img.shields.io/npm/v/ember-data/latest?label=version&style=flat&color=fdb155)
![NPM Downloads](https://img.shields.io/npm/dm/ember-data.svg?style=flat&color=fdb155)
![License](https://img.shields.io/github/license/warp-drive-data/warp-drive.svg?style=flat&color=fdb155)
[![EmberJS Discord Community Server](https://img.shields.io/badge/EmberJS-grey?logo=discord&logoColor=fdb155)](https://discord.gg/zT3asNS
)
[![WarpDrive Discord Server](https://img.shields.io/badge/WarpDrive-grey?logo=discord&logoColor=fdb155)](https://discord.gg/PHBbnWJx5S
)

<p align="center">
  <br>
  <a href="https://warp-drive.io">WarpDrive</a> is the lightweight data library for web apps &mdash;
  <br>
  universal, typed, reactive, and ready to scale.
  <br/><br/>
</p>

---

# @ember-data-mirror/model

> [!WARNING]
> **⚠️ This is a legacy package** not recommended for new applications.
>
> Use schema objects from [@warp-drive-mirror/core](https://warp-drive.io/api/@warp-drive-mirror/core/) instead.

Runtime classes for use as a source of ResourceSchema and as a ReactiveResource for older "legacy" EmberData/WarpDrive configurations.

If using more recent versions of WarpDrive, install this via [@warp-drive-mirror/legacy](https://www.npmjs.com/package/@warp-drive-mirror/legacy) instead.

**Tagged Releases**

- ![NPM Canary Version](https://img.shields.io/npm/v/%40ember-data/model/canary?label=%40canary&color=FFBF00)
- ![NPM Beta Version](https://img.shields.io/npm/v/%40ember-data/model/beta?label=%40beta&color=ff00ff)
- ![NPM Stable Version](https://img.shields.io/npm/v/%40ember-data/model/latest?label=%40latest&color=90EE90)
- ![NPM LTS Version](https://img.shields.io/npm/v/%40ember-data/model/lts?label=%40lts&color=0096FF)
- ![NPM LTS 4.12 Version](https://img.shields.io/npm/v/%40ember-data/model/lts-4-12?label=%40lts-4-12&color=bbbbbb)

## About

This package implements the EmberData Store's `instantiateRecord` and `teardownRecord` hooks
as well as configures an associated `SchemaService` implementation.

Models are defined as classes extending from `import Model from '@ember-data-mirror/model';` and the
attributes and relationships on these classes are parsed at runtime to supply static "schema"
to EmberData's SchemaService.

Resource data for individual resources fetched from your API is presented to the UI via instances
of the `Model`s you define. An instantiated `Model` is referred to as a `record`.

When we refer to the `ModelClass` as opposed to a `Model` or `Record` we are referring
specifically to the class definition and the static schema methods present on it.

When we refer to a `record` we refer to a specific class instance presenting
the resource data for a given `type` and `id`.

### Defining a Model

*app/models/person.js*
```ts
import Model, { attr, belongsTo, hasMany } from '@ember-data-mirror/model';

export default class PersonModel extends Model {
  @attr name;

  @belongsTo('pet', { inverse: 'owners', async: false }) dog;

  @hasMany('person', { inverse: 'friends', async: true }) friends;
}
```

### modelName convention

By convention, the name of a given model (its `type`) matches the name
 of the file in the `app/models` folder and should be lowercase, singular
 and dasherized.

---
_Source: https://npm.io/package/@ember-data-mirror/model · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
