-
Notifications
You must be signed in to change notification settings - Fork 1
178 - Update application container documentation #180
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
thgaskell
left a comment
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 like the content, but I think this is explaining too much outside of the React component scope. Some of this content should be moved to the JavaScript library documentation and/or the Building Your Application sections.
| - Offline: Shows a warning toast with "Application is offline". | ||
| - Online: Shows an informational toast with "Application is online". | ||
|
|
||
| 4. **Lifecycle Hooks** |
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.
Lifecycle hooks are part of the JavaScript library, not the React component.
| ? "/mockServiceWorker.js" | ||
| : "/service-worker.js", | ||
| }, | ||
| mocks: { |
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.
The mocks property isn't officially supported. Mocks are currently handled by the mock service worker.
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 see, so the mocks property can be removed?
I was looking back at the mock-api example, should it be updated as well? - https://github.com/NMFS-RADFish/boilerplate/tree/main/examples/mock-api
| }); | ||
| ``` | ||
| ### The Custom Storage |
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.
| ### The Custom Storage | |
| ### Custom Storage |
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.
This entire section may be better moved to the JavaScript library documentation rather than under the container code.
| import React from "react"; | ||
| import ReactDOM from "react-dom/client"; | ||
| import { Application } from "@nmfs-radfish/radfish"; | ||
| import App from "./App"; |
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.
Remove this for documentation usage. Just use <Application /> component.
| // 4. Finally, render your React app, passing "app" | ||
| root.render( | ||
| <React.StrictMode> | ||
| <App application={app} /> |
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.
This is too indirect for component documentation.
It just needs to demonstrate:
const myApp = new Application(/*...*/);
// ...
<Application application={myApp} />| > “Here’s my initialized Application instance. Use it to set up offline support, register service workers, coordinate data storage, and etc..” | ||
| ```jsx | ||
| // App.jsx |
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.
It would be clearer to explain this section without using App.js file. It's a little too indirect. The documentation shouldn't be imposing patterns that we use in the templates.
|
Thanks for the feedback and suggestions!
|
issue #178
Applicationbetweenradfishandreact-radfishpackage