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

Bump more navigator frontend deps #8141

Merged
merged 1 commit into from
Dec 3, 2020
Merged

Bump more navigator frontend deps #8141

merged 1 commit into from
Dec 3, 2020

Conversation

cocreature
Copy link
Contributor

@cocreature cocreature commented Dec 2, 2020

Next set of bumps. The main breaking change this time is redux. There is more coming but I’ll try to keep it into somewhat manageable chunks. Don’t be too scared by the diff stats, a lot of it is the yarn.lock.

changelog_begin
changelog_end

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@cocreature cocreature force-pushed the navigator-bump-rest branch 10 times, most recently from 8d7dd72 to 8dd26fa Compare December 2, 2020 22:05
@@ -68,5 +73,8 @@ ReactDOM.render((
document.getElementById('app'),
);

// Dispatch an action for the initial URL so that the reducer can set the
// initial state correctly.
store.dispatch(pathToAction(window.location.pathname));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redux now throws an exception if a middleware dispatches during construction. So the initial dispatch from the router needs to move here.

Router.middleware({ stateToUrl: stateToPath, urlToAction: pathToAction }),
ReduxThunk,
)),
const store: Store<App.State> & {dispatch: ThunkDispatch<App.State, undefined, App.Action>} =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dispatches are now typed much more strictly.

// initial state correctly.
dispatch(urlToAction(window.location.pathname));

return ({ dispatch, getState }: MiddlewareAPI<Dispatch, S>): (next: Dispatch) => Dispatch => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that Dispatch is now parametrized by the action not the state which is why the type parameters here have dropped (defaulting to any which Middleware forces us to use).

@@ -137,7 +137,7 @@ export default class Autosuggest<R>
); }
}
renderSuggestionsContainer={
({containerProps, children}: {containerProps: {}, children: {}[]}) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Types are now sensible by default with the react-autosuggest update.

* added and what the result is (that is, the props the resulting component
* still needs).
*/
export type Connect<Add, To> = (c: React.ComponentType<To & Add>) => React.ComponentClass<To>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The types of react-redux connect got more complex which has turned this into a huge mess with no benefit that I could see so I just inlined compose and avoided the Connect annotation.

changelog_begin
changelog_end
@cocreature cocreature marked this pull request as ready for review December 2, 2020 22:24
Copy link
Contributor

@garyverhaegen-da garyverhaegen-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cocreature cocreature merged commit 92e4c1f into master Dec 3, 2020
@cocreature cocreature deleted the navigator-bump-rest branch December 3, 2020 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants