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

Converted webpack-compilation-hash javascript file to typescript #23439

Merged

Conversation

chrisq21
Copy link
Contributor

Description

Converts gatsby/src/redux/reducers/webpack-compilation-hash.js to Typescript as gatsby/src/redux/reducers/webpack-compilation-hash.ts.

Added an interface called ISetWebpackCompilationHashAction in gatsby/src/redux/types.ts.

Updated gatsby/src/redux/reducers/index.js to pull in webpackCompilationHashReducer with import instead of require

Related Issues

Related to the Typescript migration efforts #21995


export const webpackCompilationHashReducer = (
state: IGatsbyState["webpackCompilationHash"] = ``,
action: ISetWebpackCompilationHashAction
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be ActionsUnion as every reducer gets called for dispatches of any type.

Copy link
Contributor

@blainekasten blainekasten left a comment

Choose a reason for hiding this comment

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

This is great! If you make the one small change I'll merge it! 🎉

@blainekasten
Copy link
Contributor

Also you need to merge in master as we have conflicts

The conflicts were in redux/reducers/index and redux/types.
…on` in redux/types.

Also, `ActionsUnion` is now set as `webpackCompilationHashReducer`'s `action` parameter type.
@chrisq21 chrisq21 requested a review from a team as a code owner April 27, 2020 22:16
@chrisq21
Copy link
Contributor Author

@blainekasten Sounds good! I just merged in master, resolved the conflicts, and added ISetWebpackCompilationHashAction to ActionsUnion 👍

@@ -14,6 +14,7 @@ Since 2015 Serverless has been providing a platform to unify all the tools softw
Any new front-end technologies had to mesh well with the existing site’s architecture. “The Serverless site has a blog and a documentation section, both of which pull Markdown files from GitHub repositories,” says Narayan. “We needed a way to pull those Markdown files while still maintaining a very fluent experience for the content contributors.”

## Ready to (re)launch with Gatsby 🚀

Copy link
Contributor Author

@chrisq21 chrisq21 Apr 28, 2020

Choose a reason for hiding this comment

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

Prettier was throwing errors for missing the line breaks that are added here. @blainekasten Let me know if you'd like me to remove them.

Copy link
Contributor

@blainekasten blainekasten left a comment

Choose a reason for hiding this comment

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

This looks great to me, let's merge it!

Thank you so much for contributing to our TypeScript refactor! We have more work to do and we would love to have you stay involved in our transition. Please submit more PRs! 💜

@blainekasten blainekasten merged commit d004090 into gatsbyjs:master Apr 28, 2020
@gatsbot
Copy link

gatsbot bot commented Apr 28, 2020

Holy buckets, @chrisq21 — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. We’ve got Gatsby t-shirts, stickers, hats, scrunchies, and much more. (You can also unlock even more free swag with 5 contributions — wink wink nudge nudge.) See gatsby.dev/swag for details.
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

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.

3 participants