aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-24 19:25:03 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-24 19:25:03 -0800
commit896195f5e377beb68fe743f0eb75d023e16703aa (patch)
treee4943fb662231766796c70dae67ba86f2a269e3e
parent23596b48ca03a74c7555ada3fe1f184d29b777a8 (diff)
downloadbun-896195f5e377beb68fe743f0eb75d023e16703aa.tar.gz
bun-896195f5e377beb68fe743f0eb75d023e16703aa.tar.zst
bun-896195f5e377beb68fe743f0eb75d023e16703aa.zip
slightly clean up react example
-rw-r--r--examples/react/package.json25
-rw-r--r--examples/react/src/App.test.js8
-rw-r--r--examples/react/src/index.jsx6
-rw-r--r--examples/react/src/reportWebVitals.js13
-rw-r--r--examples/react/src/setupTests.js5
5 files changed, 2 insertions, 55 deletions
diff --git a/examples/react/package.json b/examples/react/package.json
index 1bc1b39d0..8e180116e 100644
--- a/examples/react/package.json
+++ b/examples/react/package.json
@@ -2,40 +2,19 @@
"name": "@bun-examples/react",
"version": "0.0.42",
"dependencies": {
- "@testing-library/jest-dom": "^5.11.4",
- "@testing-library/react": "^11.1.0",
- "@testing-library/user-event": "^12.1.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"web-vitals": "^1.0.1"
},
- "scripts": {
- "start": "react-scripts start",
- "build": "react-scripts build",
- "test": "react-scripts test",
- "eject": "react-scripts eject"
- },
+ "scripts": {},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
- "browserslist": {
- "production": [
- ">0.2%",
- "not dead",
- "not op_mini all"
- ],
- "development": [
- "last 1 chrome version",
- "last 1 firefox version",
- "last 1 safari version"
- ]
- },
"devDependencies": {
- "typescript": "^4.4.2",
- "react-refresh": "^0.10.0"
+ "typescript": "latest"
},
"bun-create": {
"postinstall": [
diff --git a/examples/react/src/App.test.js b/examples/react/src/App.test.js
deleted file mode 100644
index 1f03afeec..000000000
--- a/examples/react/src/App.test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import { render, screen } from '@testing-library/react';
-import App from './App';
-
-test('renders learn react link', () => {
- render(<App />);
- const linkElement = screen.getByText(/learn react/i);
- expect(linkElement).toBeInTheDocument();
-});
diff --git a/examples/react/src/index.jsx b/examples/react/src/index.jsx
index 26419cdcb..1d316ddf0 100644
--- a/examples/react/src/index.jsx
+++ b/examples/react/src/index.jsx
@@ -2,7 +2,6 @@ import * as React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
-import reportWebVitals from "./reportWebVitals";
ReactDOM.render(
<React.StrictMode>
@@ -10,8 +9,3 @@ ReactDOM.render(
</React.StrictMode>,
document.getElementById("root")
);
-
-// If you want to start measuring performance in your app, pass a function
-// to log results (for example: reportWebVitals(console.log))
-// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
-reportWebVitals();
diff --git a/examples/react/src/reportWebVitals.js b/examples/react/src/reportWebVitals.js
deleted file mode 100644
index 5253d3ad9..000000000
--- a/examples/react/src/reportWebVitals.js
+++ /dev/null
@@ -1,13 +0,0 @@
-const reportWebVitals = onPerfEntry => {
- if (onPerfEntry && onPerfEntry instanceof Function) {
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
- getCLS(onPerfEntry);
- getFID(onPerfEntry);
- getFCP(onPerfEntry);
- getLCP(onPerfEntry);
- getTTFB(onPerfEntry);
- });
- }
-};
-
-export default reportWebVitals;
diff --git a/examples/react/src/setupTests.js b/examples/react/src/setupTests.js
deleted file mode 100644
index 8f2609b7b..000000000
--- a/examples/react/src/setupTests.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// jest-dom adds custom jest matchers for asserting on DOM nodes.
-// allows you to do things like:
-// expect(element).toHaveTextContent(/react/i)
-// learn more: https://github.com/testing-library/jest-dom
-import '@testing-library/jest-dom';