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

refactor(editor-export): Implement Lars feedback and provide default values again #3606

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

CodingDive
Copy link
Contributor

I hope this addresses your comments #3591.

I think it should not change anything about the logic if I'm not mistaken, but maybe it'll prevent future bugs more easily and increase readability by having the default values in a centralized place.

Feel free to make the changes directly in the PR, if I missed something or you had something else in mind.

Copy link

vercel bot commented Apr 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview Apr 9, 2024 2:47pm

Comment on lines 51 to 54
language = 'de',
enableTextAreaExercise = false,
exerciseVisibleInSuggestion = true,
allowImageInTableCells = true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still want to add the default values here in case someone passes in e.g

createBasicPlugin({ language: 'en' as const })

which would make all the booleans undefined, as the defaultPluginConfig won't be applied. Alternative to that, we could do the merge strategy, I sent you in slack.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This duplication makes me a little bit sad, but I still find it cleaner than

...
enableTextAreaExercise = defaultPluginConfig.enableTextAreaExercise,
exerciseVisibleInSuggestion = defaultPluginConfig.exerciseVisibleInSuggestion,
...

Copy link
Contributor

github-actions bot commented Apr 5, 2024

📦 Next.js Bundle Analysis for @serlo/frontend

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 104.38 KB (-1 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@LarsTheGlidingSquirrel LarsTheGlidingSquirrel self-assigned this Apr 9, 2024
@CodingDive CodingDive merged commit f5a97b0 into staging Apr 9, 2024
9 checks passed
@CodingDive CodingDive deleted the refactor/more-defaults-for-plugin-config branch April 9, 2024 14:49
@elbotho elbotho mentioned this pull request Apr 9, 2024
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