Skip to content

Commit ffe7022

Browse files
authored
chore(readme): update README (#127)
1 parent 335a6f4 commit ffe7022

File tree

5 files changed

+57
-50
lines changed

5 files changed

+57
-50
lines changed
23.9 KB
Loading
20.8 KB
Loading
40.3 KB
Loading
51.3 KB
Loading

README.md

Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,89 +5,97 @@
55
[![License][license-src]][license-href]
66
[![Nuxt][nuxt-src]][nuxt-href]
77

8-
Easily detect Performance, Hydration, and Security issues in your Nuxt application !
8+
**A Nuxt module that provides real-time feedback on your application's performance, accessibility, and security right in your browser.**
99

10-
- [ Release Notes](/CHANGELOG.md)
10+
Nuxt Hints integrates directly into the Nuxt DevTools, giving you actionable insights to improve your web vitals, fix hydration mismatches, and audit third-party scripts without ever leaving your development environment.
11+
12+
- [✨Release Notes](/CHANGELOG.md)
1113

1214
## Features
1315

14-
### 🚀 **Performance Analysis**
15-
- **LCP (Largest Contentful Paint) Optimization**: Identifies images that could benefit from modern formats (WebP, AVIF), proper sizing, fetch priority, and preloading
16-
- **CLS (Cumulative Layout Shift) Detection**: Warns about layout shifts caused by images without dimensions
17-
- **Loading Performance**: Tracks and reports slow-loading elements (>2.5s)
18-
- **Image Best Practices**: Validates proper `width`, `height`, `loading`, and `fetchPriority` attributes
16+
- **🚀 Rich DevTools UI**: A dedicated tab in Nuxt DevTools to visualize issues, inspect elements, and get recommendations.
17+
- **💧 Hydration Mismatch Debugging**: Side-by-side diffing of server-rendered and client-hydrated HTML to pinpoint the exact cause of mismatches.
18+
- **⚡️ Web Vitals Analysis**: Real-time metrics for LCP, INP, and CLS with detailed attribution and element-specific optimization tips.
19+
- **📦 Third-Party Script Auditing**: Dashboard to monitor performance, identify render-blocking scripts, and get security recommendations.
20+
- **🔍 Interactive Diagnostics**:
21+
- **Hover to Highlight**: Hover over an issue in the DevTools to highlight the corresponding element on your page.
22+
- **Click to Inspect**: Click to open the component source file directly in your code editor.
23+
- **💡 Actionable Console Warnings**: Clear, concise console messages that guide you to best practices and performance improvements.
1924

20-
### 📦 **Third-Party Script Monitoring**
21-
- **Script Detection**: Automatically identifies third-party scripts on your pages
22-
- **Performance Tracking**: Measures load times for external scripts with detailed timing breakdowns
23-
- **Security Recommendations**: Suggests adding `crossorigin="anonymous"` for better security and error reporting
24-
- **@nuxt/scripts Integration**: Recommends using `@nuxt/scripts` for better third-party script management
25+
## Visual Interface within Devtools
2526

26-
### 💧 **Hydration Insights**
27-
- **SSR/Client Mismatch Detection**: Helps identify hydration issues between server and client rendering
27+
Nuxt Hints provides a rich, interactive UI inside the Nuxt DevTools panel.
2828

29-
### 🛠️ **Developer Experience**
30-
- **Nuxt DevTools Integration**: Rich UI for visualizing performance issues and recommendations
31-
- **Console Warnings**: Clear, actionable messages with links to web.dev documentation
29+
### Homepage
3230

33-
## Quick Setup
31+
A central hub to see a summary of all detected issues at a glance.
3432

35-
### Quick install using nuxt CLI
33+
![hints devtools homepage screenshot](./.github/assets/devtools-homepage.png.png)
3634

37-
1. run `npx nuxt module add @nuxt/hints`
35+
### Web Vitals
3836

39-
### Manual install
37+
Drill down into Core Web Vitals metrics. See detailed attribution for LCP, INP, and CLS, inspect the problematic elements, and get context-aware advice.
4038

41-
1. Add `@nuxt/hints` dependency to your project
39+
![hints devtools web vitals screenshot](./.github/assets/devtools-webvitals.png.png)
4240

43-
```bash
44-
# Using pnpm
45-
pnpm add -D @nuxt/hints
41+
### Hydration Inspector
4642

47-
# Using yarn
48-
yarn add --dev @nuxt/hints
43+
Debug hydration mismatches with a powerful side-by-side diff viewer. See the exact differences between the server-rendered HTML and the client-side result.
4944

50-
# Using npm
51-
npm install --save-dev @nuxt/hints
52-
```
45+
![hints devtools hydration screenshot](./.github/assets/devtools-hydration.png.png)
5346

54-
2. Add `@nuxt/hints` to the `modules` section of `nuxt.config.ts`
47+
### Third-Party Scripts
5548

56-
```js
57-
export default defineNuxtConfig({
58-
modules: ["@nuxt/hints"],
59-
});
60-
```
49+
Analyze all third-party scripts on your page. The dashboard shows loading times, render-blocking status, and security attributes, helping you identify and mitigate performance bottlenecks.
50+
51+
![hints devtools third-party screenshot](./.github/assets/devtools-thirdparties.png.png)
52+
53+
## Quick Setup
54+
55+
1. Add `@nuxt/hints` dependency to your project:
56+
```bash
57+
# Using pnpm
58+
pnpm add -D @nuxt/hints
6159

62-
That's it! You can now use Nuxt Hints in your Nuxt app ✨
60+
# Using yarn
61+
yarn add --dev @nuxt/hints
62+
63+
# Using npm
64+
npm install --save-dev @nuxt/hints
65+
```
66+
67+
2. Add `@nuxt/hints` to the `modules` section of `nuxt.config.ts`:
68+
```js
69+
export default defineNuxtConfig({
70+
modules: [
71+
'@nuxt/hints'
72+
]
73+
})
74+
```
75+
76+
That's it! Open your Nuxt app, go to the DevTools, and click the Nuxt Hints icon to get started.
6377
6478
## How It Works
6579
6680
### Performance Monitoring
81+
Nuxt Hints uses `web-vitals` to gather Core Web Vitals metrics and automatically logs any metrics that need improvement. It listens for INP, LCP, and CLS and provides detailed attribution for each.
6782
68-
Nuxt Hints uses the **Performance Observer API** to monitor your application.
83+
### Hydration Mismatch Detection
84+
The module hooks into Vue's hydration process to compare the server-rendered DOM with the client-side DOM. When a mismatch is detected, it captures the pre- and post-hydration HTML for inspection.
6985

7086
### Third-Party Script Analysis
71-
72-
The module automatically detects and analyzes third-party scripts.
87+
Using a combination of a Nitro plugin and client-side observers, Nuxt Hints tracks every script loaded on the page, measuring its performance and analyzing its attributes.
7388

7489
### Example Console Output
75-
76-
When Nuxt Hints detects issues, you'll see warnings in console like:
90+
When Nuxt Hints detects issues, you'll see clear warnings in your browser console:
7791
7892
```
7993
[@nuxt/hints:performance] LCP Element should not have `loading="lazy"`
8094
Learn more: https://web.dev/optimize-lcp/#optimize-the-priority-the-resource-is-given
8195
```
8296
8397
```
84-
[@nuxt/hints:performance] LCP Element can be served in a next gen format like `webp` or `avif`
85-
Learn more: https://web.dev/choose-the-right-image-format/
86-
Use: https://image.nuxt.com/usage/nuxt-img#format
87-
```
88-
89-
```
90-
[@nuxt/hints] Third-party script "https://cdn.example.com/script.js" is missing crossorigin attribute.
98+
[@nuxt/hints] Third-party script "https://cdn.example.com/script.js" is missing crossorigin attribute.
9199
Consider adding crossorigin="anonymous" for better security and error reporting.
92100
```
93101
@@ -118,7 +126,6 @@ npm run release
118126
```
119127
120128
<!-- Badges -->
121-
122129
[npm-version-src]: https://img.shields.io/npm/v/@nuxt/hints/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
123130
[npm-version-href]: https://npmjs.com/package/@nuxt/hints
124131
[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxt/hints.svg?style=flat&colorA=18181B&colorB=28CF8D

0 commit comments

Comments
 (0)