- 
                Notifications
    You must be signed in to change notification settings 
- Fork 45
chore: use mosaic consistently #175
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
Conversation
| We didn't use mosaic for a reason. | 
| FWIW, on my macbook rendering the stress test storybook.. I don't know where those numbers were coming from in #113... master 
 
 this PR 
 
 IMHO the stress test example with expanded depth of 5 is not a use case we need to serve 🤷♂️. We don't ever (or should not, right?) set default expand depth to larger than 2, which means realistically we'll never be rendering anything close to the second example above. 145ms versus 200ms for a stress test style use case is not a huge deal IMHO. | 
| 
 I will admit that to me the 1.37x slowdown is a notable one, particularly if we speak of tens or hundreds of ms and take into account the fact we usually don't render JSV alone, but a whole docs page that has its own set of accompanying components. 60ms equals almost 4 frames. To be clear - not saying Mosaic is bad or anything. It's a neat library, I'm just not really convinced we should be trying to make use of it at all costs where we clearly take a perf hit here that could have been avoided. | 
# Conflicts: # src/components/SchemaRow/SchemaRow.tsx
| What's in place now just isn't really a good option - I guess we could look for another way that doesn't involve mosaic, buttt.. 🤷♂️. JSV IS using mosaic right now, just a "private" API from mosaic (hardcoded classnames that come from mosaic css). Check this out though: 
 With the two changes above (I yalc'd that mosaic PR into JSV), the perf is basically the same as on main branch: | 
# Conflicts: # src/components/shared/Validations.tsx
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.
With the new mosaic memoization this is 👌.
| 🎉 This PR is included in version 4.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 | 





Element's HttpOperation Request parameters component is using Mosaic's spacing but JSV is not. This results in a 1px difference between the parameters and the body section. This hurts my eyeballs. 🙈
https://github.com/stoplightio/elements/blob/350e46ae4facb93c42997dd97cd57be98b947b88/packages/elements-core/src/components/Docs/HttpOperation/Parameters.tsx#L38
Thus I took it upon myself to use Mosaic consistently within this lib.