Code cleanup#969
Merged
Merged
Conversation
# Conflicts: # src/Footer/index.js # src/components/Documentation/SidebarMenu/index.js
shcheklein
approved these changes
Feb 4, 2020
Contributor
|
Thanks @iAdramelk. Massive but greatly explained PR!
Let's try remembering to close css: migrate from styled comps to plan css or css-modules #792 when that happens. Thanks! |
Contributor
Author
|
@jorgeorpinel Thanks! I think that #658 and #777 are still valid, but I'd place them on hold for now, before we finish with Gatsby and decide where to migrate styles. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We are preparing to migrate from
nextjstogatsby, and to make migration easier, I made some code cleanup. Cleanup goals were to make folder structure more comfortable to use with gatsby, separate next-specific code from react components and remove as muchnext.jsstuff that we didn't need as possible.There is a lot of changes. To make it easier to review and read, I tried to group different tasks to different commits, so it will probably be easier to read it commit by commit then to read full diff.
What have been done:
src/pagesfolder, but we are storing our components here too. To make it easier to navigate and distinguish between them, I moved components to the subfoldersrc/components.Component/index.js, but some older components are namedComponent/Component.js, I renamed all such components to the newer format.src/components) and one responsible for routing, header data and getting initial props from API (left in thepagesfolder). Because I will need to refactor pages logic fromnextjstogatsby, it will be easier to do if there is no presentational logic in them.gatsby, we wouldn't needstyled-componentsanymore. To make replacing them easier in the future, I moved them all to separate files with the same logic as was used on the community page.next/linkin our files; this way, we will only need to replace forgatsby-linkin one place. Also, here I removed some cases ofnext/routerusage that we don't need.