Open aquaductape opened 4 years ago
I have two applications that are built using create react app. One with react snap, and the other without it. Testing with LightHouse and GTmetrix, the one with react snap resulted in a lower score than the one without it.
create react app
source code with react snap source code without react snap
live demo with react snap live demo without react snap
Lighthouse GTmetrix
react snap index.ts
index.ts
import "react-app-polyfill/ie11"; import "react-app-polyfill/stable"; import "focus-visible"; import React from "react"; import { hydrate, render } from "react-dom"; import "./scss/index.scss"; import App from "./App"; import * as serviceWorker from "./serviceWorker"; const rootElement = document.getElementById("root"); if (rootElement && rootElement.hasChildNodes()) { hydrate(<App />, rootElement); } else { render(<App />, rootElement); }
react snap package.json
package.json
... "scripts": { "start": "react-scripts start", "build": "GENERATE_SOURCEMAP=false react-scripts build", "postbuild": "react-snap", "test": "react-scripts test", "eject": "react-scripts eject" }, "reactSnap": { "inlineCss": true }, ...
without react snap index.ts
import "react-app-polyfill/ie11"; import "react-app-polyfill/stable"; import "focus-visible"; import React from "react"; import ReactDOM from "react-dom"; import "./scss/index.scss"; import App from "./App"; import * as serviceWorker from "./serviceWorker"; ReactDOM.render(<App />, document.getElementById("root"));
no postBuild or reactSnap in package.json
the page size is still the same 700 kb for index.html?
I have two applications that are built using
create react app
. One with react snap, and the other without it. Testing with LightHouse and GTmetrix, the one with react snap resulted in a lower score than the one without it.source code with react snap source code without react snap
live demo with react snap live demo without react snap
React Snap
Lighthouse
GTmetrix
![2020-06-05_22-19](https://user-images.githubusercontent.com/29286430/83936692-e2bb5d00-a77a-11ea-8df0-ad5ae90e0d96.png)
Without React Snap
Lighthouse
GTmetrix
![2020-06-05_22-20](https://user-images.githubusercontent.com/29286430/83936704-f49d0000-a77a-11ea-9439-bbefb034c17a.png)
react snap
index.ts
react snap
package.json
without react snap
index.ts
no postBuild or reactSnap in
package.json