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

doc: frontend doc rework #30

Merged

Conversation

davecoates
Copy link
Contributor

@davecoates davecoates commented Jun 3, 2024

  • Add documentation for templatetags in page so we have full control over formatting. The autofunction solution doesn't work well for templatetags as it can't properly extract any arguments
  • Add an overview page
  • Put all API style docs under the API section
  • Enhance the alliance_ui docs
  • Many other minor fixes and enhancements

Generated docs are here

@davecoates davecoates requested a review from micahklaz June 3, 2024 07:18
@davecoates davecoates force-pushed the doc/rework-frontend-docs branch 2 times, most recently from 1801013 to 1254327 Compare June 3, 2024 07:35
- Add documentation for templatetags in page so we have full control over formatting.
  The autofunction solution doesn't work well for templatetags as it can't properly extract
  any arguments
- Add an overview page
- Put all API style docs under the API section
- Enhance the alliance_ui docs
@davecoates davecoates force-pushed the doc/rework-frontend-docs branch from 1254327 to a1632f1 Compare June 3, 2024 08:57
this should make it work better with PR previews
Copy link
Collaborator

@micahklaz micahklaz left a comment

Choose a reason for hiding this comment

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

Couple typos and a question

- In production it is handled by ``production-ssr-server.ts`` which works with the production built files.

Currently, the only thing that gets rendered on the server is React components. :class:`~alliance_platform.frontend.templatetags.react.ComponentSSRItem`
is used to describe the component that needs to be rendered. See it's documentation for details on how each component
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo: it's -> its

<!-- Named export -->
{% component "components/Table" "Column" %}Header{% endcomponent %}
<!-- Pass a comopnent as a prop to another component -->
{% component "components/Icons" "Menu" as menu_icon %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need an endcomponent tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, added


Performs dev specific checks and may render some HTML to communicate messages to user

Currently check if the dev server is running for this project, and if not displays an error.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo: check -> checks

prefixed with `ssr:` for server side rendering options, `component:` for general component options, or `container:`
for options relating to the container the component is rendered into.

- ``ssr:disabled=True`` - if specified, no server side rendering will occur for this component
Copy link
Collaborator

Choose a reason for hiding this comment

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

If rendering on the client, will this automatically handle <Suspense> and displaying some sort of loading icon? If not, is that something we want to support (perhaps as an additional ssr argument), or should mention in the documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suspense isn't applicable here as it's not loading it within a React tree. We could support an option for it, e.g. ssr:placeholder=... to allow rendering something.

I'll add a note about it when SSR is disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#31 tracks this

@davecoates davecoates requested a review from micahklaz June 5, 2024 02:59
@davecoates davecoates merged commit 0709c28 into fix/render-component-ssr-explicit-disable Jun 6, 2024
9 checks passed
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.

2 participants