-
Notifications
You must be signed in to change notification settings - Fork 4.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 style engine border styles #43594
Merged
Merged
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0e6cc31
Refactor createBorderGenerateFunction
d243abb
Add missing return type to generateRule
ba50355
Further refactor border styles
52c02c0
Refactor to use exported GenerateFunction type
a08f587
Rename individualProperty to edge
3cb3f01
Rename BorderIndividualProperty to BoxEdges
51212d2
Use singular nouns for tagged unions
983a349
Rename functions to be more consistent
d2e06d1
Add lodash import under external
4339957
Refactor to prefer interfaces
9ced768
Refactor BoxVariants
52532ad
Use camelCase from change-case instead
8b420f4
Rename createBorderGenerateRule -> createBorderGenerateFunction for c…
990f0a1
Replace change-case with camelCaseJoin util function
efdf651
Clean up some types and docs for upperFirst
adb40ef
Add comments explaining the new internal border functions
3ccc54c
Fix eslint errors
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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'd say we don't need an external library here.
There's already a util called
upperFirst
. See the unit test.So, until we need extra functionality, maybe we could do the following:
Or we could roll our own
camelCase
usingupperFirst()
:What do you reckon?
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 was using the lodash version of camelCase first which didn't require adding a dependency, but apparently that is being phased out elsewhere in Gutenberg in favor of change-case.
But adding our own function is easy enough and it can be trimmed a bit more to our use-case, so that's fixed in 990f0a1.