Skip to content

Immutable middleware is not being tree-shaken in production #363

Closed
@markerikson

Description

@markerikson

Per recent Twitter discussion with @mweststrate and @Andarist , it turns out all my attempts to ensure that redux-immutable-invariant-middleware isn't being included in prod builds... didn't work out:

https://twitter.com/acemarke/status/1228092154830098432

So, RTK users are currently getting an extra couple K in their prod bundles that shouldn't be there.

Per #78 , it seems that RISM doesn't shake right because it's not a proper module or something like that.

Looking at https://github.com/leoasis/redux-immutable-state-invariant , it hasn't been updated in 3 years. If I look at the author's Github profile, they're not entirely inactive, as there's a few one-off commits in the last few months, but the lack of activity on the repo suggests we're unlikely to be able to poke them and get an improved version published.

Given that, I'm planning to fork redux-immutable-state-invariant, copy it completely into the RTK codebase, and ensure that it's getting shaken properly in production.

Other related notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions