Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@briebug/ngrx-auto-entity

Package Overview
Dependencies
Maintainers
6
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@briebug/ngrx-auto-entity - npm Package Versions

13
7

0.8.1

Diff

Changelog

Source

0.8.1 Beta (2022-05-05)

Added two new loading related selectors: hasBeenLoaded and loadWasAttempted. These selectors allow end developers to determine if a load has ever been attempted before, which is sometimes necessary to display the correct information in a UI component. Until a load has at least been attempted, it would generally be inappropriate to display to the user that there are no Entities X, however as the current state of each entity currently stands, there is no way to determine that particular state of an entity. You can determine if an entity is loading or not, which is useful for displaying a spinner, but other messaging requires more information.

Features

  • selectors: Added selectHasBeenLoaded to selector map
  • selectors: Added selectLoadWasAttempted to selector map

<a name="0.8.0-beta.1"></a>

jrista
published 0.8.0-beta.1 •

Changelog

Source

0.8.0-beta.1 Beta (2022-04-05)

Updated state builders to build all state functionality "on-demand" to limit memory footprint when lots of entities are used. This aligns selectors, facades, etc. with the way actions were implemented when they were introduced to the state builder. Selectors for any given entity are only created if they are accessed (i.e. destructured from the object returned by buildState), and the same goes for facades.

Performed a major internal refactor of the auto-entity reducer in order to break down the single monolithic reducer into a more modular design. Each set of related actions, such as loadAll, create, editing, selections, etc. have their own corresponding reducer. Actions are now mapped to the appropriate reducer through a centralized mapping for action-to-reducer routing.

These changes are internal, and should not present any breaking changes to the public API. That said, the changes are fairly extensive, and care should be used until 0.8 is officially released.

Internal

  • util: Renamed internal functional pipe function to compose
  • reducer: Refactored monolithic reducer into modular design
  • state: Modified internal state structure to use nested objects (#111)
  • selectors: Adjusted selectors to utilize more nested state structure (#111)
  • selectors: Updated selector builder to create selectors on-demand (#162)
  • facades: Updated facade builder to create new facade on-demand (#162)

<a name="0.7.2"></a>

jrista
published 0.7.2 •

Changelog

Source

0.7.2 Beta (2022-01-24)

Resolved a discrepancy in optional loading, where if the entity were a part of feature state, and its state properties were nested underneath a feature state property on root state, the correct entity state property could not be found.

Bug Fixes

  • operators: Update getEntityState function to check if entity has feature affinity, and access from the appropriate feature if necessary.
  • factories: Updated optional loading factories to support optional props where possible
  • actions: Updated optional loading actions to support optional props where possible

Internal

  • operators: Moved operator support utilities to their own code file

<a name="0.7.1"></a>

jrista
published 0.7.1 •

Changelog

Source

0.7.1 Beta (2021-11-05)

Resolve license field issues in package.json. Update packages based on security alerts. No other or breaking changes in this release.

<a name="0.7.0"></a>

jrista
published 0.7.0 •

Changelog

Source

0.7.0 Beta (2021-08-02)

This release officially adds support for Angular 12 and NgRx 12! With the advent of Ivy, and its continued progress towards replacing View Engine, supporting Angular 12 required a bit more active work to support. Currently, the library is built with enableIvy set to false, which allows the library to be built with support for View Engine versions of Angular.

Research and planning has begun on supporting Angular 13, however this will be a more challenging task than supporting Angular 12 due to the fact that View Engine will be dropped entirely from Ng 13, which will affect our ability to build a library that supports older versions of Angular. We hope to have a plan in place for this scenario soon.

This release also updates some internal usage of NgRx to drop use of legacy or fully deprecated features, such as the @Entity decorator.

Internal

  • effects: All effects have dropped use of the legacy @Effect() decorator, and are now using the current and recommended createEffect() function. This is to ensure support with NgRx 12+.
  • actions: Action factories have been updated with more explicit typing. Increased type strictness that comes with Ng 12 revealed cases where types were not specified, or insufficiently specified. These types have been strengthened to be more accurate and clear. These changes should not impact normal use of action factories.

Breaking Changes !!

  • library: Support for Angular 8 has been dropped! While the library may still work with Angular 8 applications, due to changes in Angular 12 build tools, as well as changes in NgRx 8, there are no guarantees that Auto-Entity will continue to work in Angular 8 applications.
  • build: Library is now being built with TypeScript 4. While we are not yet explicitly using any TypeScript 4.x features, and thus should still support TypeScript 3.x, this change in underlying build tools for the library may have impacts on builds for dependent projects.

<a name="0.6.1"></a>

jrista
published 0.7.0-alpha.2 •

jrista
published 0.7.0-alpha.1 •

jrista
published 0.6.1 •

Changelog

Source

0.6.1 Beta (2021-06-24)

Auto-Entity version 0.6.1 is a patch release to fix a couple bugs.

Bug Fixes

  • facade: Fix error when calling the deselectAll() method on a facade (#174)
  • actions: Fix type error when using DeleteByKeyFailure or DeleteByKeySuccess (#183)

<a name="0.6.0"></a>

jrista
published 0.6.0 •

Changelog

Source

0.6.0 Beta (2021-04-02)

Auto-Entity version 0.6 introduces NgRx 8+ compatible action factory functions. Similar to the kind of actions (technically factory functions that create actions!) you get when using the createAction factory function from NgRx itself. This change is NON-Breaking, as all legacy actions remain in place and fully usable, allowing migration to the new actions to be done progressively if necessary.

New actions may be destructured from the object returend by calling buildState and buildFeatureState, as with all other auto-entity state functionality. Simply destructure the new actions property:

export const {
  actions: {
    loadAll: loadAllCustomers,
    create: createCustomer,
    update: updateCustomer,
    delete: deleteCustomer,
    select: selectCustomer,
    deselect: deselectCustomer,
    // ... many more!
  }
} = buildState(Customer);

Actions introduce a new mechanism for building auto-entity state. Only the actions that are actually used (i.e. destructured) are actually created for the specified entity. This should limit the amount of memory used for auto-entity related functionality. This mechanism will be expanded to the rest of the state related functionality that can be generated by the build state calls in the future.

The breaking changes this release should be minimally breaking, and mostly backwards compatible except in fringe cases covering more unusual use cases. Conversion of selection properties from read only getters to simple fields should improve the unit testability of facades by allowing simpler mocks, stubs, and fakes, easier spying, etc. This may also improve support for more custom use cases and extensions in concrete facade classes.

Features

  • actions: Add NgRx 8+ style action factory functions (#76)
  • util: Add support for NgRx 8+ style action factory generation (#76)
  • actions: Add "bare edit" support with EditNew action (#161)
  • facades: Add "bare edit" support with editNew activity method (#161)
  • selectors: Add new selectHasEntities and selectHasNoEntities selectors (#149)
  • facades: Add new hasEntities$ and hasNoEntities$ selections to facades (#149)

Bug Fix

  • reducer: Fix issue with meta reducer not calling next reducer with next state (#170)
  • decorators: Fix @Key decorator to only try to attach NAE_KEYS internal property if it has not yet been set
  • reducer: Add missing updatedAt and replacedAt timestamps in state for each entity

Breaking Changes !!

  • facades: Convert getter properties to fields to improve unit testability/mocking/spying (#150)

<a name="0.5.0"></a>

jrista
published 0.6.0-beta.1 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc