Closed fmvilas closed 3 years ago
@fmvilas Great description for bet!
It's using the term "topics" instead of "channels".
I make search for topics
in React component repo and I only found two occurrences but only related to TS typings, while in the rendered part I did not find any topics
occurrence.
It's not working with AsyncAPI 2.0.0 (or I can't make it work)
It's very strange 😅 Nobody reported to us that version 2.0.0 does not render. Maybe you have a old revision in forked repo. Please try https://asyncapi.github.io/asyncapi-react/
It's not handling additionalItems.
It's also not handling:
correlationId
https://github.com/asyncapi/html-template/commit/d77c1c6ef0a1df956c3dbf745a1e33a210e1f675anyOf
, allOf
or anyOf
Some things like 3. point should be easy to fix, when we'll go from inlined retrieving schema schema.info.contact.email
etc. to parser-js api. We must also remember that in cycle time someone can contribute to our component, so if we decided to merge changes, we should also update "new" version of component.
Maybe this is a implementation details, but I suggest to create separate branch in component repo and contribute to it before merging changes - we can "break" functionality between PRs.
Oh yeah, I was looking at https://www.asyncapi.com/asyncapi-react 🤦 We need to get rid of it. Thanks, Maciej!
Maybe this is a implementation details, but I suggest to create separate branch in component repo and contribute to it before merging changes - we can "break" functionality between PRs.
As you feel more comfortable :)
Let's forget about the theme feature of the component for now. It will only have a single "theme" and it's the one matching the styles of the HTML template. We'll add support for themes on the future UI library instead.
Does this mean the current style of react component will go away and nobody will able to apply it as a legacy?
@derberg Good point! Kyma for example should use fiori... Hmmm... 🤔 Person working on this task should try to "wrap" Tailwind CSS to existing classes. Problem reached by you should be also addressed here. @fmvilas What do you think?
They will not be able to use "this new version of the component" but we'll make it customizable in a future cycle (most probably the next one). In the next version, we can make sure customization is good enough to meet the needs of the Kyma team and others.
definitely, my comment was there to make it explicit, like clear for others what will happen with new version + make sure we all are also familiar and remember what needs to be done next.
I was not thinking about Kyma much as they anyway update once a year when their security tools spot some vulnerability in some dependency 😆 I was thinking here about more active users, like folks from Spotify for example, or WSO2 that I think started integrating recently.
Now I'm thinking that maybe there should be some issue here https://github.com/asyncapi/asyncapi-react/issues, even pinned to the Issues tab so it is clear that next weeks will influence the architecture of the component. Would be great to ask people there if actually anyone is going to miss the current feel and look
Would be great to ask people there if actually anyone is going to miss the current feel and look
That would be great indeed. Would you mind asking it yourself? I'm starting to handle many issues 😅
I will, on react repo and html-template repo :)
@magicmatatjahu thanks man, keep in mind that in html-template repo there is already an issue about it I think, just reuse and pin this one I guess
We should also try to fix issues related to accessibility. Reference issue -> https://github.com/asyncapi/html-template/issues/163
@asyncapi/react-component@1.0.0-next.1
is published with @asyncapi/html-template@0.21.0
:) Any bugs/errors should be reported in the mentioned repositories.
On This Page
Summary
Problem Overview
We're currently maintaining two HTML documentation views: the HTML template and the React component.
Solution Overview
Improve the React component so it matches the features and look & feel of the HTML template. Once it's done, make the HTML template use the React component to generate the HTML output.
Positive Side-Effects
Solution guidelines
While this task may sound easy, there are a bunch of small features/details that are not present in the React component:
components
.allOf
, which is incorrect behavior.additionalItems
.correlationId
asyncapi/html-template@d77c1c6We should make sure these features are present in the React component. Otherwise, people will be losing features with the switch from the HTML template to React.
When it comes to making the HTML template render the React component, my suggestion is that we have a look at the following ReactDOMServer and ReactDOM methods:
ReactDOMServer.renderToNodeStream()
ReactDOM.hydrate()
I found this article very helpful: https://dev.to/marvelouswololo/how-to-server-side-render-react-hydrate-it-on-the-client-and-combine-client-and-server-routes-1a3p
One possible solution here is to make the HTML template an empty template with a
generate:after
hook where we do all the rendering process.Boundaries
Don’t go too far refactoring the React component
Don't worry about the architecture of the React component. We'll dedicate time to converting it to a UI library in the next cycles.
Don't support theming
Let's forget about the
theme
feature of the component for now. It will only have a single "theme" and it's the one matching the styles of the HTML template. We'll add support for themes on the future UI library instead.Watch out for those little details
Those that may be present on the HTML template but not on the React component.
Watch out for template parameters
The HTML template supports some parameters like
singleFile
,baseHref
,version
,sidebarOrganization
, and others. We should make sure they still work.Long-Term Vision
The idea is to start moving towards a single source of truth for our UI components. This is just the first step before we start working on the UI library which will offer many components instead of just a single big one.
In the near future, we'll also have our own design system for those who want to create custom AsyncAPI components that still match our look & feel.