Skip to content

Commit 70f617f

Browse files
authored
Merge pull request #173 from oanelson/167
Edits. Closes #167.
2 parents c5155a0 + 06fd4d2 commit 70f617f

File tree

10 files changed

+63
-33
lines changed

10 files changed

+63
-33
lines changed

docs/developer-documentation/concepts/offline-first.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
sidebar_position: 2
33
---
4-
#Offline-First
4+
5+
# Offline-First
56

67
Offline-first design prioritizes web app functionality even without internet connectivity. This means building the app so users can interact with it uninterrupted, even without a stable network.
78

docs/developer-documentation/technical-decision-log/dexie.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ description: Simplifies working with IndexedDB
44
---
55

66
# Dexie for Offline Data
7+
[Dexie](https://dexie.org/) simplifies working with IndexedDB.
78

8-
- **Why we chose this:** Dexie simplifies working with IndexedDB, crucial for RADFish applications that require robust offline capabilities. This aligns with the need for reliable data storage and retrieval in environments with intermittent connectivity.
9-
- **Trade-offs:** Using a wrapper around IndexedDB like Dexie abstracts some low-level control but significantly eases development complexity, making it a worthwhile trade-off for enhancing offline experience in RADFish applications.
9+
## Why we chose this
10+
Dexie makes IndexedDB development less complex. IndexedDB is crucial for RADFish applications that require offline capabilities. RADFish apps need reliable data storage and retrieval with intermittent internet connectivity.
1011

11-
LocalForage and PouchDB are alternatives that offer similar abstraction over IndexedDB with additional features like automatic synchronization with remote databases. However, Dexie's simpler API and focus on IndexedDB specifically make it more suitable for RADFish's client-side DB needs.
12+
## Trade-offs
13+
Using a wrapper around IndexedDB like Dexie abstracts some low-level control. However, it significantly eases development complexity, making it a worthwhile trade-off.
1214

13-
---
15+
## Alternatives
16+
[LocalForage](https://github.com/localForage/localForage) and [PouchDB](https://github.com/pouchdb/pouchdb) are alternatives that offer similar abstraction over IndexedDB. They offer additional features like automatic synchronization with remote databases. However, Dexie's simpler API and focus on IndexedDB make it more suitable for RADFish's client-side DB needs.

docs/developer-documentation/technical-decision-log/index.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ sidebar_position: 6
44

55
# RADFish Technical Decision Log
66

7-
{/* Write top text here */}
7+
This section provides justification for the technologies and frameworks we chose for RADFish. Most pages include "Why we chose this", "Trade-offs", and "Alternatives" sections. These demonstrate pros, cons, and other options that were considered, respectively.
88

9+
For more information about this section, read the [statement of purpose](https://nmfs-radfish.github.io/radfish/developer-documentation/technical-decision-log/purpose).
910

1011
```mdx-code-block
1112
import DocCardList from '@theme/DocCardList';

docs/developer-documentation/technical-decision-log/jsdocs.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ sidebar_position: 8
33
description: Accessible and easy to adopt
44
---
55

6-
# JavaScript w/JS Docs
6+
# JavaScript with JSDoc
77

8-
- **Why we chose this:** JavaScript, complemented by JS Docs, offers broad accessibility and ease of adoption for government contractors. This choice supports RADFish’s goal of standardizing frontend development without imposing the stricter typing system of TypeScript, balancing flexibility with documentation needs.
9-
- **Trade-offs:** The absence of TypeScript’s compile-time type checking increases reliance on runtime testing. However, for RADFish’s diverse and evolving project requirements, JavaScript’s flexibility is more beneficial, allowing for broader adoption among government contractors.
8+
[JSDoc](https://jsdoc.app/about-getting-started) is an automatic API documentation generator.
109

11-
TypeScript provides static typing out of the box, offering compile-time type checking and reducing runtime errors. However, adopting TypeScript involves a steeper learning curve and potentially longer development times. Given RADFish's emphasis on ease of adoption and the existing familiarity within the developer community with JavaScript, JS Docs offers a balanced approach, providing some benefits of TypeScript without its overhead.
10+
## Why we chose this
11+
JavaScript offers broad accessibility and ease of adoption for government contractors. Combined with JS Docs, this helps standardize frontend development. JavaScript’s flexibility allows for broader adoption among government contractors. It also adapts to RADFish's diverse and evolving project requirements. JS Docs also doesn't impose the stricter typing system of TypeScript.
1212

13-
Additionally, TypeScript can always be leveraged by teams that wish to use it as migrating from JS to TypeScript is relatively straightforward and there are tools available to automate this process.
13+
## Trade-offs
14+
TypeScript provides static typing, offering compile-time type checking, which reduces runtime errors. The absence of TypeScript’s compile-time type checking may increase reliance on runtime testing. However, adopting TypeScript involves a steeper learning curve and potentially longer development times. RADFish leverages most developers' familiarity with JavaScript. JS Docs offers a balanced approach, providing some benefits of TypeScript without its overhead.
1415

15-
---
16+
## Alternatives
17+
[TypeScript](https://www.typescriptlang.org/) can still be adopted by teams that wish to use it. Migrating from JS Docs to TypeScript is relatively straightforward. There are tools available to automate this process.

docs/developer-documentation/technical-decision-log/mock-service-worker.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ description: Required for offline functionality
44
---
55

66
# Mock Service Worker
7+
[Mock Service Worker (MSW)](https://mswjs.io/) simulates API responses during development and testing.
78

8-
- **Why we chose this:** RADFish's requirement for offline functionality makes Mock Service Worker (MSW) invaluable for simulating API responses during development and testing. This allows developers to build and test applications without dependency on real backend services, crucial for offline-capable applications and for developing apps without a backend to test against.
9-
- **Trade-offs:** Relying on MSW for development might mask integration issues with actual backend services if human error is made in the setup of MSW and a real endpoint is overridden by the mock endpoint. Nonetheless, the benefits of seamless offline development and testing are crucial for RADFish's goals.
9+
## Why we chose this
10+
NOAA applications must work offline. MSW lets developers build and test applications without dependency on real backend services. This helps develop applications with offline functionality without a backend to test against.
1011

11-
JSON Server or Mirage JS provide similar mocking capabilities with more emphasis on full-fledged backend simulation. However, MSW's integration with service workers and its ability to intercept network requests at the browser level offer more realistic testing scenarios for RADFish's offline functionality, making it preferable despite JSON Server or Mirage JS's ease of setup for simpler backends.
12+
## Trade-offs
13+
Relying on MSW for development might mask integration issues with actual backend services. For example, an error in MWS setup could result in a real endpoint being overridden by the mock endpoint. However, the benefits of offline development and testing are crucial for RADFish's goals.
1214

13-
---
15+
## Alternatives
16+
[JSON Server](https://www.npmjs.com/package/json-server) or [Mirage JS](https://miragejs.com/) provide similar mocking capabilities. They emphasize full-fledged backend simulation. They emphasize full-fledged backend simulation and ease of setup for simpler backends. However, MSW's integrates with service workers and can intercept network requests at the browser level. These features offer more realistic testing scenarios for RADFish's offline functionality.

docs/developer-documentation/technical-decision-log/prettier.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ sidebar_position: 7
33
description: Ensures consistent code quality and style
44
---
55

6-
# Prettier/ESLint
6+
# Prettier and ESLint
77

8-
- **Why we chose this:** Consistency in code quality and style is crucial for collaborative projects like RADFish. Prettier and ESLint automate formatting and linting, ensuring code adheres to best practices and is accessible to all developers working on NOAA projects.
9-
- **Trade-offs:** Enforcing a specific coding style may require initial adjustments for developers. However, the long-term benefits of maintainable and error-free code outweigh these adjustments. Also, these standards can be enforced automatically via code editor configuration setups eg. the “on-save” linting of VSCode.
8+
[Prettier](https://prettier.io/) is an automatic code formatter. [ESLint](https://eslint.org/) analyzes code to find problems and errors in a process known as _linting_.
109

11-
TSLint (now deprecated in favor of ESLint) and Stylelint are alternatives focused on TypeScript and CSS, respectively. While they offer specialized linting capabilities, the combination of Prettier and ESLint covers a broader range of RADFish's code quality needs across JavaScript and styling with a unified setup, making them more suitable than using separate tools for different languages.
10+
## Why we chose this
11+
Consistency in code quality and style is crucial for collaborative projects like RADFish. Prettier and ESLint automate formatting and linting. This ensures all code adheres to best practices and is accessible to all developers working on NOAA projects.
1212

13-
---
13+
## Trade-offs
14+
Enforcing a specific coding style may require initial adjustments for developers. However, the long-term benefits of maintainable and error-free code outweigh this adjustment period. Also, these standards can be enforced automatically via code editor configuration setups. For example, developers can use the the “on-save” linting of VSCode.
15+
16+
## Alternatives
17+
[TSLint](https://palantir.github.io/tslint/) (deprecated in favor of ESLint in 2019) and [Stylelint](https://stylelint.io/) are alternatives to ESLint. They focus on on TypeScript and CSS, respectively. While they offer specialized linting capabilities, the combination of Prettier and ESLint covers a broader range of RADFish's code quality needs. Prettier and ESLint provide JavaScript styling and linting with a unified setup, making them more suitable than using separate tools for different languages.

docs/developer-documentation/technical-decision-log/purpose.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ description: Provides clarity around technical decisions
55

66
# Purpose
77

8-
In order to provide transparency and clarity around the technical decisions we have made, we wanted to provide a technical decision justification for the chosen technologies and frameworks of RADFish.
8+
This section provides justification for the technologies and frameworks we chose for RADFish. This provides transparency and clarity around the technical decisions we have made.
99

10-
Each technology and framework selected for RADFish aims to create a cohesive, efficient, and compliant environment for developing NOAA's frontend applications. The choices reflect a balance between ease of use, compliance with federal standards, and the unique operational requirements of NOAA applications, such as offline functionality and support across a myriad of devices. The chosen stack is designed to optimize developer productivity, application performance, and user experience within the context of NOAA fishery reporting programs.
10+
NOAA's frontend applications have unique requirements, such as:
11+
12+
- **Offline functionality.** Our users do not always have reliable internet access. Our applications must work offline.
13+
- **Cross-platform performance.** Our applications must work on both mobile and desktop devices. They must work on a variety of operating systems and browsers.
14+
- **Regulation compliance.** Federal web applications must meet regulation standards, such as 508 Compliance.
15+
16+
Our choices must balance ease of use for our developers while meeting these challenges. We selected technologies and frameworks to create a cohesive, efficient, and compliant environment. The chosen stack optimizes developer productivity, application performance, and user experience.
1117

1218
---

docs/developer-documentation/technical-decision-log/tanstack.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ sidebar_position: 11
33
description: Offers flexible state management
44
---
55

6-
# Tanstack for State Management
6+
# TanStack for State Management
7+
[TanStack](https://tanstack.com/) provides utilities for state management, tables, and querying.
78

8-
- **Why we chose this:** Tanstack (React Query and React Table) offers efficient solutions for managing server state and table state in RADFish applications. This is particularly useful for handling NOAA's complex data structures and multi-entry forms, providing an improved user experience with less boilerplate code.
9-
- **Trade-offs:** The adoption of Tanstack requires familiarity with its API and concepts, which may present a learning curve. However, the productivity gains and enhanced user experience in handling NOAA’s data-centric applications make it a great choice for RADFish's goals.
9+
## Why we chose this
10+
TanStack helps manage server state and table state in RADFish applications. NOAA applications have complex data structures and multi-entry forms. TanStack creates an improved user experience with less boilerplate code.
11+
12+
## Trade-offs
13+
Using Tanstack requires familiarity with its API and concepts, which may present a learning curve. However, it handles NOAA’s data-centric applications and provides an enhanced user experience.

docs/developer-documentation/technical-decision-log/trussworks.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ description: Adherence to US Web Design Standards
55

66
# Trussworks Component Library
77

8-
- **Why we chose this:** Trussworks Component Library’s adherence to USWDS ensures RADFish applications meet federal standards for accessibility and design. This alignment with NOAA’s branding guidelines and 508 compliance requirements makes it a strategic choice.
9-
- **Trade-offs:** The use of a specific component library might restrict design flexibility. However, the consistency and compliance it brings to RADFish applications are invaluable, especially for government projects.
8+
The [Trussworks component library](https://github.com/trussworks/react-uswds) is a set of standard components from React libraries and the [U.S. Web Design System (USWDS)](https://designsystem.digital.gov/).
109

11-
Material-UI and Ant Design offer extensive component libraries with customizable themes. However, Trussworks' specific focus on USWDS compliance and its integration with React makes it a better fit for RADFish, despite the broader design options available in Material-UI or Ant Design
10+
## Why we chose this
11+
Trussworks component library adheres to USWDS standards. This ensures RADFish applications meet federal standards for accessibility and design. It also aligns with NOAA’s branding guidelines and 508 compliance requirements.
1212

13-
---
13+
## Trade-offs
14+
Using a specific component library might restrict design flexibility. However, using a single component library provides consistency. Trussworks also meets compliance standards, which is invaluable for government projects.
15+
16+
## Alternatives
17+
[Material-UI](https://mui.com/material-ui/) and [Ant Design](https://ant.design/) offer extensive component libraries with customizable themes. These provides broader design options. However, Trussworks' specific focus on USWDS compliance and its integration with React makes it a better fit for RADFish.

docs/developer-documentation/technical-decision-log/workbox.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ description: Service worker management for improved caching
44
---
55

66
# Workbox
7+
[Workbox](https://developer.chrome.com/docs/workbox) is a collection of service worker libraries and tooling.
78

8-
- **Why we chose this:** Workbox streamlines service worker management and offline capabilities essential for RADFish. It simplifies caching strategies and offline data handling, critical for NOAA PWAs used in an offline fashion.
9-
- **Trade-offs:** Workbox’s abstraction layer may obscure some of the finer details of service worker implementation. However, the ease of integrating robust offline functionalities justifies its use within RADFish. The ease of implementation also makes the service worker functionality more approachable for cases where NOAA developers need to modify the RADFish-provided setup.
9+
## Why we chose this
10+
Workbox streamlines service worker management and offline capabilities essential for RADFish. It simplifies caching strategies and offline data handling. This is critical for NOAA PWAs used offline.
1011

11-
---
12+
## Trade-offs
13+
Workbox’s abstraction layer may obscure some of the finer details of service worker implementation. However, the ease of integrating robust offline functionalities justifies its use within RADFish. The ease of implementation makes it more approachable for NOAA developers. Developers can easily modify the RADFish-provided setup as well.

0 commit comments

Comments
 (0)