Normalizes nested JSON according to a schema

Overview

normalizr build status Coverage Status npm version npm downloads

Install

Install from the NPM repository using yarn or npm:

yarn add normalizr
npm install normalizr

Motivation

Many APIs, public or not, return JSON data that has deeply nested objects. Using data in this kind of structure is often very difficult for JavaScript applications, especially those using Flux or Redux.

Solution

Normalizr is a small, but powerful utility for taking JSON with a schema definition and returning nested entities with their IDs, gathered in dictionaries.

Documentation

Examples

Quick Start

Consider a typical blog post. The API response for a single post might look something like this:

{
  "id": "123",
  "author": {
    "id": "1",
    "name": "Paul"
  },
  "title": "My awesome blog post",
  "comments": [
    {
      "id": "324",
      "commenter": {
        "id": "2",
        "name": "Nicole"
      }
    }
  ]
}

We have two nested entity types within our article: users and comments. Using various schema, we can normalize all three entity types down:

import { normalize, schema } from 'normalizr';

// Define a users schema
const user = new schema.Entity('users');

// Define your comments schema
const comment = new schema.Entity('comments', {
  commenter: user
});

// Define your article
const article = new schema.Entity('articles', {
  author: user,
  comments: [comment]
});

const normalizedData = normalize(originalData, article);

Now, normalizedData will be:

{
  result: "123",
  entities: {
    "articles": {
      "123": {
        id: "123",
        author: "1",
        title: "My awesome blog post",
        comments: [ "324" ]
      }
    },
    "users": {
      "1": { "id": "1", "name": "Paul" },
      "2": { "id": "2", "name": "Nicole" }
    },
    "comments": {
      "324": { id: "324", "commenter": "2" }
    }
  }
}

Dependencies

None.

Credits

Normalizr was originally created by Dan Abramov and inspired by a conversation with Jing Chen. Since v3, it was completely rewritten and maintained by Paul Armstrong. It has also received much help, enthusiasm, and contributions from community members.

Issues
  • Fix Safari GC issue by removing mapValues() in favor of Object.keys().reduce()

    Fix Safari GC issue by removing mapValues() in favor of Object.keys().reduce()

    Problem

    See the gist: Safari GC Issue: Normalizr + Lodash (credit to @alunny)

    Summary: normalizr + lodash in Safari appears to encounter a problem sometimes in which Safari's garbage collector interrupts the entity mapping, causing the entities object to be empty.

    Solution

    This is sort of a half-way-there solution, because the ultimate goal would be to remove all production dependencies. However, isEqual/deep-equality is not an easy problem to solve and lodash's implementation is the best available.

    • Removes lodash dependency
    • Uses lodash.isequal package for isEqual
    • Adds an isObject util method
    • Refactors use of lodash/mapValues
    Outdated 
    opened by paularmstrong 55
  • [minor] Improve typescript types with generics

    [minor] Improve typescript types with generics

    Problem

    It's very hard to infer anything about the types without generics. Given that it's most useful to have types for the data stored in your normalized cache this seems pretty essential.

    Solution

    The idea here is at some point you'll point to an entity whose processStrategy will return the type you expect.

    Splitting the Schema union type was essential to distinguish between list results and singular results as well.

    In the end I was able to create my own type in userland that could extract what type to expect:

    export type SchemaOf<T> = T extends SchemaArray<infer R>
      ? R[]
      : T extends SchemaBase<infer R>
        ? R
        : never;
    

    TODO

    • [x] Add & update tests
    • [x] Ensure CI is passing (lint, tests, flow)
    • [x] Update relevant documentation
    Outdated 
    opened by ntucker 22
  • Use a reference cache to allow recursive references

    Use a reference cache to allow recursive references

    Problem

    Recursive / circular references throw a stack-level too deep error when denormalized.

    Solution

    Cache references to the already denormalized entities and use the reference from the cache if it shows back up in a subsequent pass. The bulk of the work is in src/schemas/Entity.js – the rest is just passing the cache object around to make sure it's always available to the denormalize method.

    Outdated 
    opened by andyhite 22
  • provide schema in assignEntity

    provide schema in assignEntity

    This PR is a small change to provide schema as an argument to the assignEntity function.

    My use-case is that when normalizing entities I want the key to be present under a different name in certain circumstances. I need to support both normalized and denormalized data and having fields with the same name but different types is causing quite a lot of confusion and noise.

    With this change I can flag the schemas which I want to be assigned with a new name and then override the assignEntity method. See the added test for an example of this working.

    Happy to discuss or make changes if you want, many thanks.

    Priority: Low Status: Review Needed Type: Enhancement Outdated 
    opened by frankwallis 20
  • Add type declarations

    Add type declarations

    Status: Accepted Type: Enhancement Outdated 
    opened by unindented 19
  • Different attribute values for same entity

    Different attribute values for same entity

    Problem

    We have a situation where the same entity has different values of a specific attribute depending on where that entity comes from.

    Input

    Following your example with articles, this would be the input:

    var article = new Schema('articles'),
            tutorial = new Schema('tutorials'),
            magazine = new Schema('magazine'),
            articleOrTutorial = { articles: article, tutorials: tutorial },
            input;
    
    magazine.define({
      contents: arrayOf(articleOrTutorial, { schemaAttribute: 'type' } )
    });
    
    input = [
      {
        id: 1,
        name: 'my magazine',
        contents: [{
            id: 1,
            type: 'articles',
            title: 'Some Article',
            releaseDate: '01/01/2016'
          }, {
            id: 2,
            type: 'articles',
            title: 'Another Article',
            releaseDate: '10/01/2016'
          }, {
            id: 1,
            type: 'tutorials',
            title: 'Some tutorial',
            releaseDate: '10/01/2016'
          }]
        },
        {
          id: 2,
          name: 'your magazine',
          contents: [{
            id: 1,
            type: 'articles',
            title: 'Some Article',
            releaseDate: '15/01/2016'
          }, {
            id: 2,
            type: 'articles',
            title: 'Another Article',
            releaseDate: '25/01/2016'
          }, {
            id: 1,
            type: 'tutorials',
            title: 'Some tutorial',
            releaseDate: '25/01/2016'
          }]
        }
      };
    
    output = normalize(input, arrayOf(magazine);
    

    Output

    When we normalize the input, we get merge conflict with the releaseDate. We lose the information regarding the specifics of that article or tutorial related to its magazine. The articles are the same and I want to keep them as the same entity. But I'd like to also keep the value that is specific of that article related with the magazine.

    I'd like to get maybe something like this:

    output = {
      magazines: {
        1:  {
          id: 1,
          name: 'my magazine',
          contents: [{
              id: 1,
              schema: 'articles',
              releaseDate: '01/01/2016'
            }, {
              id: 2,
              schema: 'articles',
              releaseDate: '10/01/2016'
            }, {
              id: 1,
              schema: 'tutorials',
              releaseDate: '10/01/2016'
            }
          ]
        },
        2: {
          id: 2,
          name: 'your magazine',
          contents: [{
              id: 1,
              schema: 'articles',
              releaseDate: '15/01/2016'
            }, {
              id: 2,
              schema: 'articles',
              releaseDate: '25/01/2016'
            }, {
              id: 1,
              schema: 'tutorials',
              releaseDate: '25/01/2016'
            }
          ]
        }
      },
      articles: {
        ...
      },
      tutorials: {
        ...
      }
    };
    

    Conclusion

    I hope this explanation is clear enough.

    Have you ever encountered a situation like this? How did you solve it? We thought about keeping another array with just the releaseDate in our magazine object. But it's not very clean.

    I'd like to do something like this:

      ...
      function polymorphicItem(item) {
        return { releaseDate: item.releaseDate };
      }
    
      magazine.define({
        contents: arrayOf(articleOrTutorial, { schemaAttribute: 'type', polymorphicItem: polymorphicItem } )
      });
      ...
      output = normalize(input, arrayOf(magazine);
    

    Thank you very much!

    Status: Pending Type: Enhancement Outdated 
    opened by lmuntaner 18
  • An empty array of results should produce an empty entity

    An empty array of results should produce an empty entity

    Problem

    If the data for an entity is an empty array then the entities container is not created.

    Input

    Here's how I'm using normalizr:

    const { schema, normalize } = require('normalizr');
    
    // Define a users schema
    const user = new schema.Entity('users');
    
    // Define your comments schema
    const comment = new schema.Entity('comments', {
      commenter: user
    });
    
    // Define your article
    const article = new schema.Entity('articles', {
      author: user,
      comments: [ comment ]
    });
    
    const data = {
      id: "123",
      author: {
        id: "1",
        name: "Paul"
      },
      title: "My awesome blog post",
      // Imagine the API returned zero comments for this article:
      comments: []
    };
    console.log(normalize(data, article));
    

    Here's what I actually see when I run the above:

    { 
      entities: { 
        users: { '1': [Object] }, 
        articles: { '123': [Object] },
      },
      result: '123',
    }
    

    Here's what I expected to see:

    { 
      entities: { 
        users: { '1': [Object] }, 
        articles: { '123': [Object] },
        comments: {},
      },
      result: '123',
    }
    

    In other words, the comments entity should be initialized to an empty object since the schema specified that it should exist. Without this, the top level entities object would sometimes be "normalized" to an inconsistent state. This makes it hard for code that receives entities to know if it's working with the right object or if the caller made a mistake.

    Type: Enhancement 
    opened by kumar303 17
  • can now normalize iterables keyed with their id

    can now normalize iterables keyed with their id

    Status: Revision Needed Type: Enhancement Outdated 
    opened by adjohu 16
  • Questions/Feature Requests: Nested entities that aren't objects, Denormalization, JSON-API

    Questions/Feature Requests: Nested entities that aren't objects, Denormalization, JSON-API

    Firstly, @gaearon, thank you for your work on the Redux ecosystem. The normalizr library has been critical for my project, so I had a couple of questions which are really disguised feature requests -

    1. Are there any plans to support JSON-API response system in the future? Right now, I have made it work for JSON but there are plans to move to JSON-API in the near future. In that case, I wonder if I will have to discard library to write something similar of my own or if you plan to support it.
    2. Is there any way to specify or for the dictionary to identify single attribute of an object rather than needing for the whole object to be there?

    For example,

    post.define({
        author: user
    });
    

    works great when the author object is embedded within the post object like

    "post": {
      "author": {
        "id": 5,
        "name": "r2d2"
      }
    }
    

    What can I do for cases where the JSON is either of the two options below?

    "post": {
      "author":5
    }
    

    OR

    "post": {
      "author_id":5
    }
    
    1. A pain that I am facing now is constant denormalization of the nested entities in a lot of the components. With a result, those components aren't as 'dumb' as I would like and are constantly having to have state.entities.x passed to them which they can use to fetch the appropriate nested entity (using lodash find, merge, mapValues etc). I suspect there is some other way of doing this? A different pattern or another denormalization solution?

    Apologies if I missed this in documentation somewhere! Thanks again!

    Outdated 
    opened by oyeanuj 16
  • Denormalization with the same schema that is used for normalization

    Denormalization with the same schema that is used for normalization

    My attempt to revert the normalisation by using the same schema. This was suggested by #17 and #1. I am not sure what you think about this @gaearon but I'd love to hear your feedback on this.

    Note also that I have inverted all of the relevant test cases, except these two:

    • can normalise nested entity and delete an existing key using custom function
    • can normalise mutually recursive entities

    I think the first one could be archived by using the options param, that is new in v1.0.0. But I don't really see a use case here. The latter one is difficult because of the recursive entities. If you have a good idea how to break the dependency chain, feel free to give me some feedback on this. This is also the reason why I have written the single test for the denormalisation but also disabled it for now.

    One more thing: in principle one could just define the bag once, in the denormalize call, and access the bag from within all functions that need access, but I kept the same function arguments as in the normalisation direction. I think this is purely a matter of taste.

    Outdated 
    opened by dotcs 15
  • chore: Bump tmpl from 1.0.4 to 1.0.5

    chore: Bump tmpl from 1.0.4 to 1.0.5

    Bumps tmpl from 1.0.4 to 1.0.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • chore: Bump tar from 6.0.5 to 6.1.11

    chore: Bump tar from 6.0.5 to 6.1.11

    Bumps tar from 6.0.5 to 6.1.11.

    Commits
    • e573aee 6.1.11
    • edb8e9a fix: perf regression on hot string munging path
    • a9d9b05 chore(test): Avoid spurious failures packing node_modules/.cache
    • 24b8bda fix(test): use posix path for testing path reservations
    • e5a223c fix(test): make unpack test pass on case-sensitive fs
    • 188badd 6.1.10
    • 23312ce drop dirCache for symlink on all platforms
    • 4f1f4a2 6.1.9
    • 875a37e fix: prevent path escape using drive-relative paths
    • b6162c7 fix: reserve paths properly for unicode, windows
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • chore: Bump path-parse from 1.0.6 to 1.0.7

    chore: Bump path-parse from 1.0.6 to 1.0.7

    Bumps path-parse from 1.0.6 to 1.0.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • chore: Bump glob-parent from 5.1.1 to 5.1.2

    chore: Bump glob-parent from 5.1.1 to 5.1.2

    Bumps glob-parent from 5.1.1 to 5.1.2.

    Release notes

    Sourced from glob-parent's releases.

    v5.1.2

    Bug Fixes

    Changelog

    Sourced from glob-parent's changelog.

    5.1.2 (2021-03-06)

    Bug Fixes

    6.0.0 (2021-05-03)

    ⚠ BREAKING CHANGES

    • Correct mishandled escaped path separators (#34)
    • upgrade scaffold, dropping node <10 support

    Bug Fixes

    • Correct mishandled escaped path separators (#34) (32f6d52), closes #32

    Miscellaneous Chores

    • upgrade scaffold, dropping node <10 support (e83d0c5)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • fallbackStrategy as a parameter of denormalize

    fallbackStrategy as a parameter of denormalize

    Problem

    I want to have a way to detect that some entities are missing in entities "database" and be able to fetch missing data in batched requests. Current fallbackStrategy is great for displaying "loading" state, but there's no simple way to gather all missing entities while denormalizing.

    Solution

    Add fallbackStrategy option for denormalize. This way I can pass a closure in which I can gather all missing entities and load them. This way it also will be possible to make LRU cache for entities eliminating one of the pain points of normalizr — infinitely growing entities map.

    opened by Dema 0
  • chore: Bump ws from 7.3.1 to 7.4.6

    chore: Bump ws from 7.3.1 to 7.4.6

    Bumps ws from 7.3.1 to 7.4.6.

    Release notes

    Sourced from ws's releases.

    7.4.6

    Bug fixes

    • Fixed a ReDoS vulnerability (00c425ec).

    A specially crafted value of the Sec-Websocket-Protocol header could be used to significantly slow down a ws server.

    for (const length of [1000, 2000, 4000, 8000, 16000, 32000]) {
      const value = 'b' + ' '.repeat(length) + 'x';
      const start = process.hrtime.bigint();
    

    value.trim().split(/ *, */);

    const end = process.hrtime.bigint();

    console.log('length = %d, time = %f ns', length, end - start); }

    The vulnerability was responsibly disclosed along with a fix in private by Robert McLaughlin from University of California, Santa Barbara.

    In vulnerable versions of ws, the issue can be mitigated by reducing the maximum allowed length of the request headers using the --max-http-header-size=size and/or the maxHeaderSize options.

    7.4.5

    Bug fixes

    • UTF-8 validation is now done even if utf-8-validate is not installed (23ba6b29).
    • Fixed an edge case where websocket.close() and websocket.terminate() did not close the connection (67e25ff5).

    7.4.4

    Bug fixes

    • Fixed a bug that could cause the process to crash when using the permessage-deflate extension (92774377).

    7.4.3

    Bug fixes

    • The deflate/inflate stream is now reset instead of reinitialized when context takeover is disabled (#1840).

    7.4.2

    Bug fixes

    ... (truncated)

    Commits
    • f5297f7 [dist] 7.4.6
    • 00c425e [security] Fix ReDoS vulnerability
    • 990306d [lint] Fix prettier error
    • 32e3a84 [security] Remove reference to Node Security Project
    • 8c914d1 [minor] Fix nits
    • fc7e27d [ci] Test on node 16
    • 587c201 [ci] Do not test on node 15
    • f672710 [dist] 7.4.5
    • 67e25ff [fix] Fix case where abortHandshake() does not close the connection
    • 23ba6b2 [fix] Make UTF-8 validation work even if utf-8-validate is not installed
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • chore: Bump browserslist from 4.14.5 to 4.16.6

    chore: Bump browserslist from 4.14.5 to 4.16.6

    Bumps browserslist from 4.14.5 to 4.16.6.

    Changelog

    Sourced from browserslist's changelog.

    4.16.6

    • Fixed npm-shrinkwrap.json support in --update-db (by Geoff Newman).

    4.16.5

    • Fixed unsafe RegExp (by Yeting Li).

    4.16.4

    • Fixed unsafe RegExp.
    • Added artifactory support to --update-db (by Ittai Baratz).

    4.16.3

    • Fixed --update-db.

    4.16.2

    4.16.1

    • Fixed Chrome 4 with mobileToDesktop (by Aron Woost).

    4.16

    • Add browserslist config query.

    4.15

    • Add TypeScript types (by Dmitry Semigradsky).

    4.14.7

    • Fixed Yarn Workspaces support to --update-db (by Fausto Núñez Alberro).
    • Added browser changes to --update-db (by @​AleksandrSl).
    • Added color output to --update-db.
    • Updated package.funding to have link to our Open Collective.

    4.14.6

    • Fixed Yarn support in --update-db (by Ivan Storck).
    • Fixed npm 7 support in --update-db.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 2
  • Fix incorrect typescript definition file

    Fix incorrect typescript definition file

    Problem

    Fixes https://github.com/paularmstrong/normalizr/issues/470

    Solution

    I ended up having to touch a lot more files in the project than I expected to. A summary of changes is below:

    • Rewrote the index.d.ts file from scratch to include as much type information as possible given the structure of the project.
    • Moved index.d.ts next to index.js
      • This allows typescript tests to read the types properly within the project
      • Updated the build step to include the .d.ts file in dist, and updated the package.json definition with the new location of the types file
    • Updated the version of typescript included in the project to latest
      • Added a new tsconfig.json file
    • Reworked typescript tests - Running yarn test will now verify not only that the code is functional, but also that the type definitions work
      • Moved the compile-only tests into a type-tests subdirectory.
      • Added new compile-only tests for both positive and negative cases
      • Added a new tool, check-dts, that will check that test files compile, or that they throw particular errors
      • Duplicated the existing javascript tests to typescript
        • Updated the jest config to run typescript tests as well
        • Added a rule to babel to be able to process the typescript files and updated the babel parser
    • Added the cross-env package to allow for development on windows

    TODO

    • [x] Add & update tests
    • [x] Ensure CI is passing (lint, tests, flow)
    • [x] Update relevant documentation
    opened by grandivory 4
  • chore: Bump hosted-git-info from 2.8.8 to 2.8.9

    chore: Bump hosted-git-info from 2.8.8 to 2.8.9

    Bumps hosted-git-info from 2.8.8 to 2.8.9.

    Changelog

    Sourced from hosted-git-info's changelog.

    2.8.9 (2021-04-07)

    Bug Fixes

    Commits
    Maintainer changes

    This version was pushed to npm by nlf, a new releaser for hosted-git-info since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • chore: Bump lodash from 4.17.20 to 4.17.21

    chore: Bump lodash from 4.17.20 to 4.17.21

    Bumps lodash from 4.17.20 to 4.17.21.

    Commits
    • f299b52 Bump to v4.17.21
    • c4847eb Improve performance of toNumber, trim and trimEnd on large input strings
    • 3469357 Prevent command injection through _.template's variable option
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
Releases(v3.6.1)
Owner
Paul Armstrong
Paul Armstrong
An i18n solution for React/Redux and React Native projects

redux-react-i18n An i18n solution with plural forms support for Redux/React Workers of all countries, unite! Supported languages list with expected co

Dmitry Erzunov 64 Aug 9, 2021
Selector library for Redux

Reselect Simple “selector” library for Redux (and others) inspired by getters in NuclearJS, subscriptions in re-frame and this proposal from speedskat

Redux 18.2k Sep 15, 2021
Logger for Redux

Logger for Redux Now maintained by LogRocket! LogRocket is a production Redux logging tool that lets you replay problems as if they happened in your o

null 5.6k Sep 21, 2021
Ruthlessly simple bindings to keep react-router and redux in sync

Project Deprecated This project is no longer maintained. For your Redux <-> Router syncing needs with React Router 4+, please see one of these librari

React Community 7.9k Sep 20, 2021
Filterable tree view monitor for Redux DevTools

========================= Filterable tree view monitor for Redux DevTools. Actions are collapsed by default but they can be expanded by clicking on th

Brian Vaughn 151 May 7, 2021
Another Redux DevTools Monitor

redux-devtools-inspector This package was merged into redux-devtools monorepo. Please refer to that repository for the latest updates, issues and pull

Alexander Kuznetsov 241 Aug 10, 2021
A mock store for testing Redux async action creators and middleware.

redux-mock-store A mock store for testing Redux async action creators and middleware. The mock store will create an array of dispatched actions which

Redux 2.4k Sep 21, 2021
The ultimate React SSR, Redux-powered example.

Redux server-side The ultimate React SSR, Redux-powered example. But why? Does any of the following sentences describe your SSR adventures? You'd love

Rafał Krupiński 3 Aug 20, 2021
An alternative side effect model for Redux apps

redux-saga redux-saga is a library that aims to make application side effects (i.e. asynchronous things like data fetching and impure things like acce

Redux-Saga 21.8k Sep 24, 2021
Redux DevTools remotely.

Remote Redux DevTools Use Redux DevTools remotely for React Native, hybrid, desktop and server side Redux apps. Installation npm install --save-dev re

Mihail Diordiev 1.8k Sep 16, 2021