routerino 2.2.0-rc1 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -12
- package/package.json +1 -1
- package/routerino-forge.js +0 -4
package/README.md
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
For teams who want SPA simplicity with search-friendly static HTML, Open Graph previews, and **no framework lock-in.**
|
|
6
6
|
|
|
7
|
-
<!-- [**Live Example**](https://www.papoir.com) | [**Starter Template**](https://github.com/nerds-with-keyboards/routerino-starter) -->
|
|
8
|
-
|
|
9
7
|
Routerino is a zero-dependency router for React designed for optimal SEO performance in client-side rendered applications. Built for modern web architectures like JAMStack applications and Vite-powered React sites, it provides route & meta tag management, sitemap generation, and static site generation or [prerender](https://github.com/prerender/prerender) support to ensure your React applications are fully discoverable by search engines.
|
|
10
8
|
|
|
11
9
|
## Why Routerino?
|
|
@@ -204,7 +202,7 @@ The table below shows all available props with their default values. See the [us
|
|
|
204
202
|
|
|
205
203
|
#### Routerino props
|
|
206
204
|
|
|
207
|
-
All of these are optional, so it's easy to get started with nothing but a bare-bones `<Routerino />` element, to get started with a working sample page. The main props you'll need are `routes` and `title`. See [
|
|
205
|
+
All of these are optional, so it's easy to get started with nothing but a bare-bones `<Routerino />` element, to get started with a working sample page. The main props you'll need are `routes` and `title`. See [RouteConfig props](#routeconfig-props) for the route format.
|
|
208
206
|
|
|
209
207
|
| Prop | Type | Description | Default |
|
|
210
208
|
| ---------------------------------------------- | --------------- | --------------------------------- | ----------------------------- |
|
|
@@ -748,6 +746,8 @@ routerinoForge({
|
|
|
748
746
|
- Caches processed images to speed up subsequent builds
|
|
749
747
|
- Preserves original images while enhancing loading performance
|
|
750
748
|
- Skips external images (http/https), data URIs, and SVGs
|
|
749
|
+
- Smart sizing: Uses aspect-ratio only to prevent layout shift without forcing dimensions
|
|
750
|
+
- Hides images initially with `opacity: 0` to prevent broken image icons during load
|
|
751
751
|
|
|
752
752
|
**Note:** Image optimization requires `ffmpeg` to be installed. Without it, images work normally but without blur placeholders. Install with `brew install ffmpeg` (Mac), `apt install ffmpeg` (Ubuntu), or `choco install ffmpeg` (Windows).
|
|
753
753
|
|
|
@@ -1004,9 +1004,7 @@ If you're starting from scratch and wondering "How do I create a React project w
|
|
|
1004
1004
|
2. We recommend using [Vite](https://vitejs.dev/) for a fast and lean development experience. Vite is a modern build tool that focuses on speed and simplicity. To create a new React project with Vite, run the following command in your terminal:
|
|
1005
1005
|
|
|
1006
1006
|
```
|
|
1007
|
-
|
|
1008
1007
|
npm create vite@latest my-react-app -- --template react
|
|
1009
|
-
|
|
1010
1008
|
```
|
|
1011
1009
|
|
|
1012
1010
|
This command will create a new directory called `my-react-app` with a basic React project structure.
|
|
@@ -1014,17 +1012,13 @@ This command will create a new directory called `my-react-app` with a basic Reac
|
|
|
1014
1012
|
3. Navigate to your new project directory:
|
|
1015
1013
|
|
|
1016
1014
|
```
|
|
1017
|
-
|
|
1018
1015
|
cd my-react-app
|
|
1019
|
-
|
|
1020
1016
|
```
|
|
1021
1017
|
|
|
1022
1018
|
4. Install the project dependencies using npm:
|
|
1023
1019
|
|
|
1024
1020
|
```
|
|
1025
|
-
|
|
1026
1021
|
npm install
|
|
1027
|
-
|
|
1028
1022
|
```
|
|
1029
1023
|
|
|
1030
1024
|
This command will read the `package.json` file in your project and install all the necessary dependencies.
|
|
@@ -1032,14 +1026,12 @@ This command will read the `package.json` file in your project and install all t
|
|
|
1032
1026
|
5. Now, add Routerino to your project as a dependency:
|
|
1033
1027
|
|
|
1034
1028
|
```
|
|
1035
|
-
|
|
1036
1029
|
npm install routerino
|
|
1037
|
-
|
|
1038
1030
|
```
|
|
1039
1031
|
|
|
1040
1032
|
This command will install the latest version of Routerino and save it to your `package.json` file under the `dependencies` section.
|
|
1041
1033
|
|
|
1042
|
-
With these steps, you'll have a new React project set up with Vite as the build tool and Routerino installed as a
|
|
1034
|
+
With these steps, you'll have a new React project set up with Vite as the build tool and Routerino installed as a dependency. You can now start building your application with React & Routerino.
|
|
1043
1035
|
|
|
1044
1036
|
### Full React Example
|
|
1045
1037
|
|
package/package.json
CHANGED
package/routerino-forge.js
CHANGED
|
@@ -316,16 +316,12 @@ async function processImagesInHTML(html, outputDir, config) {
|
|
|
316
316
|
const dataUri = imageData.placeholder;
|
|
317
317
|
|
|
318
318
|
// Create a wrapper span with the blurred background positioned behind
|
|
319
|
-
// Use min-width/min-height to ensure placeholder visibility without forcing size
|
|
320
319
|
let spanStyle = `position: relative; display: inline-block;`;
|
|
321
320
|
|
|
322
321
|
if (imageData.width && imageData.height) {
|
|
323
322
|
// Set aspect-ratio for proper proportions
|
|
324
323
|
const aspectRatio = imageData.width / imageData.height;
|
|
325
324
|
spanStyle += ` aspect-ratio: ${aspectRatio};`;
|
|
326
|
-
// Set minimum dimensions so placeholder shows even if image fails
|
|
327
|
-
// CSS can still override with smaller sizes if needed
|
|
328
|
-
spanStyle += ` min-width: ${imageData.width}px; min-height: ${imageData.height}px;`;
|
|
329
325
|
}
|
|
330
326
|
|
|
331
327
|
// Create the blur background as a pseudo-element that sits behind (z-index: -1)
|