-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
refactor(v2): simplify code by removing wip i18n & translation #1431
Conversation
@@ -15,7 +15,7 @@ module.exports = { | |||
moduleNameMapper: { | |||
'^@lib/(.*)$': '<rootDir>/packages/docusaurus/lib/$1', | |||
}, | |||
testPathIgnorePatterns: ['/node_modules/', '__fixtures__'], | |||
testPathIgnorePatterns: ['loadSetup.js', '/node_modules/', '__fixtures__'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadSetup is an utility test function to help me setup fixtures easily.
@@ -7,7 +7,7 @@ | |||
|
|||
import '@babel/polyfill'; | |||
import path from 'path'; | |||
import loadSetup from '../../../docusaurus/test/loadSetup'; | |||
import loadSetup from '../../../docusaurus/lib/server/load/__tests__/loadSetup'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we'll create @docusaurus/test-utils in the future to easily load up fixtures. Not going to do it in this PR.
Deploy preview for docusaurus-2 ready! Built with commit c51d902 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also moved all the test to be co-located with its corresponding files.
Awesome! Great clean up :D
@@ -7,7 +7,7 @@ | |||
|
|||
import '@babel/polyfill'; | |||
import path from 'path'; | |||
import loadSetup from '../../../docusaurus/test/loadSetup'; | |||
import loadSetup from '../../../docusaurus/lib/server/load/__tests__/loadSetup'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should create test utils as separate modules. It's quite fragile for packages to cross module boundaries like this and import from other modules via relative paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was thinking of that as well. Gonna do it soon, this PR is so big already. I haven't removed the logic on plugin-docs also. (doing it now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed the comment above about @docusaurus/test-utils because this PR has 100+ changed files 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Been working it for few hours too :| I'll double check again and again lol. ~4,000 lines of code deleted. gg
Deploy preview for docusaurus-preview ready! Built with commit c51d902 |
Motivation
I removed i18n and translation from the codebase. It's better to not ship a WIP code when we release the first alpha public release.
I also did some refactoring with how we deal with some components like
<Head>
so that we don't retype the same thing over and over againI also moved all the
test
to be co-located with its corresponding files.So the format will be like
Instead of
(Write your motivation here.)
Have you read the Contributing Guidelines on pull requests?
(Write your answer here.)
Test Plan
Netlify works
CI Test passes