Fix styled component inconsistent naming and missing component definition#246
Merged
bernaferrari merged 10 commits intobernaferrari:mainfrom Jan 3, 2026
Merged
Conversation
a3626a
commented
Jan 3, 2026
| return `\n<${componentName}>${content}</${componentName}>`; | ||
| } | ||
| const wrapperComponentName = | ||
| cssCollection[layoutBuilder.cssClassName!]?.componentName || "div"; |
Contributor
Author
There was a problem hiding this comment.
if mode === "styled-components", and after layoutBuilder.build(),
layoutBuilder always has cssClassName
bernaferrari
approved these changes
Jan 3, 2026
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.
Issues Found
Problem 1 : Inconsistent Naming
Expected: Styled Component must be defined and referenced with same name.
Actual: Styled Component is defined as
StyledDescriptionspanbut referenced asStyledDescriptionProblem 2 : Missing Text Wrapper Definition
Expected: Wrapper component for text is defined properly.
Actual: Wrapper component for text is not defined at all.
Changes
[Major] Save component name in
cssCollectionfor better consistencycssCollection[Major] Always render both wrapper and segment component for htmlText
[Minor] Change getComponentName
Testing
Problem 1
Now it is consistent. (+ New wrapper component is added)
Problem 2
Wrapper component is correctly defined
Some Notes
Automated tests are necessary for this project.
Intermediate representation will greatly increase maintainability. CSS Collection can be expanded into IR. IR will have classname, data attributes, styles, component names ALWAYS(not conditionally). IR will be conditaionally referenced by each render mode(html, svelte, style-component ...).