module@warp-drive/legacy/compat @legacy
Helps an app migrate incrementally from legacy EmberData patterns to modern WarpDrive.
Why it exists
While migrating, you may need to:
- keep Adapters and Serializers working on a Store whose requests go through the RequestManager
- keep the deprecated request methods such as
store.findRecordandstore.query, which Adapters fulfill, working while you move calls tostore.request - adopt modern patterns one piece at a time rather than all at once
What it provides
- LegacyNetworkHandler, a request handler that fulfills those legacy requests through the store's Adapters and Serializers and passes every other request along
- adapterFor, serializerFor, normalize, pushPayload and serializeRecord, the store methods for working with Adapters and Serializers, and LegacyStoreCompat, the Store type that includes them
The Store that useLegacyStore produces adds LegacyNetworkHandler to its RequestManager unless linksMode is true. The hooks that present Model instances live in @warp-drive/legacy/model, not here.
When to use it
Only during a migration from legacy EmberData to modern WarpDrive. It lets you adopt modern patterns incrementally while your existing Adapters and Serializers keep working. For incremental migration strategies, see the Migration Guide and the Two Store Migration Strategy.