Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A lightweight reactive data library for javascript applications. Designed over composable primitives.

License

NotificationsYou must be signed in to change notification settings

seanCodes/ember-data

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EmberDataEmberData

The lightweight reactive data library for JavaScript applications

Build StatusDiscord Community Server


Wrangle your application's data management with scalable patterns for developer productivity.

  • ⚡️ Committed to Best-In-Class Performance
  • 🌲 Focused on being as svelte as possible
  • 🚀 SSR Ready
  • 🔜 Typescript Support
  • 🐹 Built with♥️ byEmber
  • ⚛️ Supports any API:GraphQLJSON:APIRESTtRPC ...bespoke or a mix

Tagged Releases

  • NPM Canary Version
  • NPM Beta Version
  • NPM Stable Version
  • NPM LTS Version
  • NPM LTS 4.12 Version

📖 On This Page

Overview

EmberData is a lightweight reactive data library for JavaScript applications that provides composable primitives for ordering query/mutation/peek flows, managing network and cache, and reducing data for presentation.

🪜 Architecture

EmberData is bothresource centric anddocument centric in it's approach to caching, requesting and presenting data. Your application's configuration and usage drives which is important and when.

TheStore is acoordinator. When using aStore you configure what cache to use, how cache data should be presented to the UI, and where it should look for requested data when it is not available in the cache.

This coordination is handled opaquely to the nature of the requests issued and the format of the data being handled. This approach gives applications broad flexibility to configureEmberData to best suit their needs. This makesEmberData a powerful solution for applications regardless of their size and complexity.

EmberData is designed to scale, with a religious focus on performance and asset-size to keep its footprint small but speedy while still being able to handle large complex APIs in huge data-driven applications with no additional code and no added application complexity. It's goal is to prevent applications from writing code to manage data that is difficult to maintain or reason about.

EmberData's power comes not from specific features, data formats, or adherence to specific API specs such asJSON:APItrpc orGraphQL, but from solid conventions around requesting and mutating data developed over decades of experience scaling developer productivity.

Basic Installation

Install using your javascript package manager of choice. For instance withpnpm

pnpm add ember-data

ember-data is installed by default for new applications generated withember-cli. You can check what version is installed by looking in thedevDependencies hash of your project'spackage.json file.

If you have generated a newEmber application usingember-cli but donot wish to useember-data, removeember-data from your project'spackage.json file and run your package manager's install command to update your lockfile.

Advanced Installation

EmberData is organized into primitives that compose together via public APIs.

  • @ember-data/store is the core and handles coordination
  • @ember-data/tracking is required when using the core and provides tracking primitives for change notification of Tracked properties
  • @ember-data/json-api is a resource cache for JSON:API structured data. It integrates with the store via the hookcreateCache
  • @ember-data/model is a presentation layer, it integrates with the store via the hooksinstantiateRecord andteardownRecord.
  • @ember-data/adapter provides various network API integrations for APIS built over specific REST or JSON:API conventions.
  • @ember-data/serializer pairs with@ember-data/adapter to normalize and serialize data to and from an API format into theJSON:API format understood by@ember-data/json-api.
  • @ember-data/debug provides debugging support for theember-inspector.
  • ember-data is a "meta" package which bundles all of these together for convenience

The packages interop with each other through well defined public API boundaries. The coreof the library is the store provided by@ember-data/store, while each of the other libraries plugs into the store when installed. Because these packages interop via fullypublic APIs, other libraries or applications may provide their own implementations. For instance,ember-m3 is a commonly used presentation and cache implementation suitable for complex resource objects and graphs.

Configuration

Deprecation Stripping

EmberData allows users to opt-in and remove code that exists to support deprecated behaviors.

If your app has resolved all deprecations present in a given version, you may specify that version as your "compatibility" version to remove the code that supported the deprecated behavior from your app.

letapp=newEmberApp(defaults,{emberData:{compatWith:'4.8',},});

randomUUID polyfill

EmberData usesUUID V4 by default to generate identifiers for new data created on the client. Identifier generation is configurable, but we also for convenience will polyfillthe necessary feature if your browser support or deployment environment demands it. Toactivate this polyfill:

letapp=newEmberApp(defaults,{emberData:{polyfillUUID:true},});

removing inspector support in production

If you do not want to ship inspector support in your production application, you can specifythat all support for it should be stripped from the build.

letapp=newEmberApp(defaults,{emberData:{includeDataAdapterInProduction:false,},});

Debugging

Many portions of the internals are helpfully instrumented with logging that can be activatedat build time. This instrumentation is always removed from production builds or any buildsthat has not explicitly activated it. To activate it set the appropriate flag totrue.

letapp=newEmberApp(defaults,{emberData:{debug:{LOG_PAYLOADS:false,// data store received to update cache withLOG_OPERATIONS:false,// updates to cache remote stateLOG_MUTATIONS:false,// updates to cache local stateLOG_NOTIFICATIONS:false,LOG_REQUESTS:false,// log Requests issued via the request managerLOG_REQUEST_STATUS:false,LOG_IDENTIFIERS:false,LOG_GRAPH:false,// relationship storageLOG_INSTANCE_CACHE:false,// instance creation/deletion},},});

Compatibility

The following table lists EmberData versions alongside information aboutember compatibility.

  • Lockstep: the latest version of ember-source at the time of release
  • Supported: the versions of ember-source the release officially supports
  • Tested: the versions of ember-source the project tested this release against
  • Range: the peer-dep range the release states for ember-source

the version ofember-source they were release with (lockstep), as well as the range of versions of ember-source that theproject tested against at the point of release.

StatusEmberDataLockstepSupportedTestedRange
LatestNPM Stable Version5.3.04.84.125.*3.284.44.84.125.25.33.28.12
>= 4.*
>= 5.*
LTSNPM Stable Version4.12.34.*5.*3.284.44.84.125.03.28.12
>= 4.*
>= 5.*
Prior LTSNPM Stable Version4.12.34.*5.*3.284.44.84.125.03.28.12
>= 4.*
>= 5.*
unsupported
(prior LTS)
NPM Stable Version4.8.64.*3.284.44.83.28.12
>= 4.*
unsupported1NPM Stable Version4.6.03.284.*3.284.44.54.63.28.12
>= 4.*
unsupported1
(prior LTS)
NPM Stable Version4.4.63.284.*3.284.43.28.12
>= 4.*

Contributing

See theContributing guide for details.

Code of Conduct

Refer to theCode of Conduct for community guidelines and inclusivity.

License

This project is licensed under theMIT License.

Footnotes

  1. This version may receive special long-term patches to assist model-fragments users in creating a migration path onto 5.x and off of ModelFragments2

About

A lightweight reactive data library for javascript applications. Designed over composable primitives.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript49.7%
  • TypeScript49.4%
  • Other0.9%

[8]ページ先頭

©2009-2025 Movatter.jp