@react95/cra-template 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react95/cra-template",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "The official React95 template for Create React App.",
5
5
  "keywords": [
6
6
  "react",
@@ -28,5 +28,5 @@
28
28
  "bugs": {
29
29
  "url": "https://github.com/React95/React95/issues"
30
30
  },
31
- "gitHead": "ce77184b22f46c18b61b45c59b80f69b68be3759"
31
+ "gitHead": "c2c7248b6f5e7b1da8bcff621fa4cd8bfbf53425"
32
32
  }
@@ -1,23 +1,30 @@
1
1
  import React from 'react';
2
- import ReactDOM from 'react-dom';
2
+ import ReactDOM from 'react-dom/client';
3
3
  import { ThemeProvider, GlobalStyle } from '@react95/core';
4
4
  import { ClippyProvider } from '@react95/clippy';
5
5
 
6
6
  import './index.css';
7
7
  import App from './App';
8
8
  import * as serviceWorker from './serviceWorker';
9
+ import reportWebVitals from './reportWebVitals';
9
10
 
10
- ReactDOM.render(
11
+ const root = ReactDOM.createRoot(document.getElementById('root'));
12
+
13
+ root.render(
11
14
  <ThemeProvider>
12
15
  <GlobalStyle />
13
16
  <ClippyProvider>
14
17
  <App />
15
18
  </ClippyProvider>
16
19
  </ThemeProvider>,
17
- document.getElementById('root'),
18
20
  );
19
21
 
20
22
  // If you want your app to work offline and load faster, you can change
21
23
  // unregister() to register() below. Note this comes with some pitfalls.
22
24
  // Learn more about service workers: https://bit.ly/CRA-PWA
23
25
  serviceWorker.unregister();
26
+
27
+ // If you want to start measuring performance in your app, pass a function
28
+ // to log results (for example: reportWebVitals(console.log))
29
+ // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
30
+ reportWebVitals();
@@ -0,0 +1,13 @@
1
+ const reportWebVitals = onPerfEntry => {
2
+ if (onPerfEntry && onPerfEntry instanceof Function) {
3
+ import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4
+ getCLS(onPerfEntry);
5
+ getFID(onPerfEntry);
6
+ getFCP(onPerfEntry);
7
+ getLCP(onPerfEntry);
8
+ getTTFB(onPerfEntry);
9
+ });
10
+ }
11
+ };
12
+
13
+ export default reportWebVitals;
package/template.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "package": {
3
3
  "dependencies": {
4
- "@testing-library/jest-dom": "^5.11.4",
5
- "@testing-library/react": "^12.1.3",
6
- "@testing-library/user-event": "^12.1.10",
7
- "web-vitals": "^1.0.1",
8
- "styled-components": "^5.1.0",
9
- "@xstyled/styled-components": "^1.17.1",
4
+ "@react95/clippy": "latest",
10
5
  "@react95/core": "latest",
11
6
  "@react95/icons": "latest",
12
- "@react95/clippy": "latest"
7
+ "@testing-library/jest-dom": "^5.14.1",
8
+ "@testing-library/react": "^13.0.0",
9
+ "@testing-library/user-event": "^13.2.1",
10
+ "@xstyled/styled-components": "^3.6.0",
11
+ "styled-components": "^5.3.5",
12
+ "web-vitals": "^2.1.4"
13
13
  }
14
14
  }
15
15
  }