-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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: mutate config in normalizeConfig and handleLocalBackend fns #4846
refactor: mutate config in normalizeConfig and handleLocalBackend fns #4846
Conversation
66021ef
to
79bc07e
Compare
9c3c997
to
cc0bd0e
Compare
Seems like latest commits from master cause e2e tests to fail |
👀 |
ca4add6
to
54789f2
Compare
Hm... now I have no idea why it fails. When I run e2e tests locally they pass. |
@erezrokah I think I'm gonna need your help with it (( |
Sorry for the delay @smashercosmo. I'm clearing some stuff off my plate and we'll review the PRs this week. |
54789f2
to
353dbd9
Compare
@smashercosmo This seems like an issue with Cypress https://github.com/netlify/netlify-cms/pull/4846/checks?check_run_id=1791036988#step:7:1195 |
I'm going to try and revert the Cypress version per cypress-io/cypress#14663 |
353dbd9
to
a05dc3a
Compare
a05dc3a
to
e74a152
Compare
6de7f8c
to
bd31c24
Compare
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.
Sorry for the delay @smashercosmo, thank you for another great PR which makes our codebase much cleaner and easier to understand.
I decided to keep the methods non-mutating as personally I believe they make the code easier to follow.
hm... @erezrokah I understand you concern, but if you want to keep methods immutable, I would suggest we just use immer instead of object spreads. |
That's a good point. I wasn't sure if the the nesting was deep enough to justify that. |
@erezrokah another question not directly related to this PR but to netlify-cms code style in general. I noticed that you're using both function expressions and function declarations across codebase, but seems like there is no logic in when either is being used. I would propose to use function expressions only in inline callbacks and declarations in all other cases. Because it's easier to distinguish function from a simple variable when function is declared as declaration. Good: |
Another good point. We mostly care about consistency (which we don't have). |
Well, surely I can, but should I then fix all of the eslint errors? 🙂 |
I'm mostly interested on how many errors we get :) we can apply the rule for specific parts of the codebase and slow fix errors, or add it as a warning? |
618 errors 🙂 I'll check if it can be fixed by some codemod |
Summary
Another atomic PR to make #4776 easier to merge
Test plan
Run current tests