Mock Jira Developer Tool
Install and Use:
npm i my-jira-dev-tool
import { loadDevTools } from "jira-dev-tool";
loadDevTools(() => {
ReactDOM.render(
<React.StrictMode>
<AppProviders>
<App />
</AppProviders>
</React.StrictMode>,
document.getElementById("root")
);
});
两大功能介绍
1. Distributed back-end service
Two major problems in the back-end services of traditional teaching projects:
- The service is fragile, the number of requests is limited, and it is unstable. If the students are down, they will not be able to use it.
- Students have limited control over the back-end database, for example, they cannot easily reset the database
This developer tool uses MSW 以 Service Worker as The principle realizes the "distributed backend"
which is:
- All requests are proxied by Service Worker
- After the back-end logic is processed, use localStorage as the database to add, delete, modify, and check operations
In this way, an independent back-end service and database are installed on each student’s browser, and it is no longer affected by any centralized service. Click "Empty Database" to reset the back-end service
2. Precise control of HTTP requests
The robustness of the project has been ignored by many teaching projects, and as a best practice project, robustness is a point of focus
This developer tool can accurately control the time, failure probability, and failure rules of HTTP requests