Skip to content

Conversation

@jaygiang
Copy link
Collaborator

issue #178

  • Explain features
  • Go over usage
  • Explain difference of Application between radfish and react-radfish package

@jaygiang jaygiang linked an issue Feb 11, 2025 that may be closed by this pull request
Copy link
Collaborator

@thgaskell thgaskell left a 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**
Copy link
Collaborator

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: {
Copy link
Collaborator

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.

Copy link
Collaborator Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
### The Custom Storage
### Custom Storage

Copy link
Collaborator

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";
Copy link
Collaborator

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} />
Copy link
Collaborator

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
Copy link
Collaborator

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.

@jaygiang
Copy link
Collaborator Author

Thanks for the feedback and suggestions!

  • Removed any indirect code and made it more concise
  • Removed Custom Storage section. Will figure out where to move it.
  • Removed mock handler option
  • Removed LifeCycle explanation since that's part of the JavaScript library

@jaygiang jaygiang requested a review from thgaskell February 12, 2025 19:34
@jaygiang jaygiang merged commit 6213ad5 into main Feb 12, 2025
1 check passed
@jaygiang jaygiang deleted the 178-update-app-container branch February 12, 2025 21:49
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.

Docs - Update Application Container

3 participants