Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mutable field from action types #59221

Merged

Commits on Dec 4, 2023

  1. Remove mutable field from action types

    Similar in spirit to vercel#58938.
    
    The app router reducer state used to be managed by useReducer, so it was
    written to be resilient to rebasing — the same action may be processed
    multiple times. Now that we've lifted the reducer outside of React
    (vercel#56497), each action runs only a single time. So we can simplify some
    of the logic.
    
    The purpose of the `mutable` field was so that if an action is
    processed multiple times, state could be reused between each run; for
    example, to prevent redundant network fetches. Now that this scenario
    can no longer happen, we can remove it.
    
    I had to update some of the unit tests in navigate-reducer because they
    were written with the assumption that the reducer was called
    multiple times. As far as I can tell, most of this behavior is covered
    by e2e tests anyway, so I don't think it's too risky.
    acdlite committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    cece1de View commit details
    Browse the repository at this point in the history