Skip to content

Commit

Permalink
fix dev env + add sierpinski
Browse files Browse the repository at this point in the history
  • Loading branch information
pivanov committed Jan 6, 2025
1 parent e47f9f7 commit b1dcb6b
Show file tree
Hide file tree
Showing 51 changed files with 3,052 additions and 1,610 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";
import "bippy/dist/scan/index";
import "bippy/scan";

export default function SlowComponent() {
const largeArray = Array.from({ length: 10000 }, (_, i) => i);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ReactScanV1 from "bippy/dist/scan/index";
import * as ReactScanV1 from "bippy/scan";
import React, { useState, useEffect } from "react";

export default function Counter() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://x.com/jjenzz/status/1859954446140334277
import { instrument, getNearestHostFibers, createFiberVisitor } from "bippy"; // must be imported BEFORE react
import * as React from "react";
import * as BippyScan from "bippy/dist/scan/index";
import * as BippyScan from "bippy/scan";

BippyScan;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ export default defineConfig({
tailwindcss(),
],
define: {
__VERSION__: `"v${JSON.parse(fs.readFileSync('../package.json', 'utf8')).version}"`,
__VERSION__: `"v${JSON.parse(fs.readFileSync('../../package.json', 'utf8')).version}"`,
},
resolve:
process.env.NODE_ENV === 'production'
? {}
: {
alias: {
bippy: path.resolve(__dirname, '../packages/bippy/dist'),
bippy: path.resolve(__dirname, '../../packages/bippy/dist'),
},
},
});
59 changes: 59 additions & 0 deletions examples/sierpinski/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>React Scan</title>
<meta name="title" content="React Scan" />
<meta
name="description"
content="React Scan automatically detects and highlights components that cause performance issues in your React app. Drop it in anywhere – script tag, npm, you name it!"
/>

<meta property="og:type" content="website" />
<meta property="og:url" content="https://react-scan.million.dev" />
<meta property="og:title" content="React Scan" />
<meta
property="og:description"
content="React Scan automatically detects and highlights components that cause performance issues in your React app. Drop it in anywhere – script tag, npm, you name it!"
/>
<meta
property="og:image"
content="https://react-scan.million.dev/banner.png"
/>

<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://react-scan.million.dev" />
<meta property="twitter:title" content="React Scan" />
<meta
property="twitter:description"
content="React Scan automatically detects and highlights components that cause performance issues in your React app. Drop it in anywhere – script tag, npm, you name it!"
/>
<meta
property="twitter:image"
content="https://react-scan.million.dev/banner.png"
/>

<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Geist+Mono:[email protected]&family=Geist:[email protected]&display=swap"
rel="stylesheet"
/>

<link rel="icon" href="/logo.svg" type="image/svg+xml" />

<meta
name="keywords"
content="react, performance, debugging, developer tools, web development, javascript"
/>
<meta name="author" content="Aiden Bai" />
<meta name="theme-color" content="#8b5cf6" />
<link rel="canonical" href="https://react-scan.million.dev" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
12 changes: 12 additions & 0 deletions examples/sierpinski/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"module": "ESNext",
"target": "ESNext"
},
"exclude": [
"node_modules",
"**/node_modules/*",
"dist"
],
"moduleResolution": "NodeNext"
}
21 changes: 21 additions & 0 deletions examples/sierpinski/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"private": "true",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@vercel/analytics": "^1.4.0",
"babel-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
"react": "19.0.0-rc.1",
"react-dom": "19.0.0-rc.1",
"bippy": "^0.1.1",
"sugar-high": "^0.7.5",
"vite-plugin-inspect": "^0.8.7"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.4.3"
}
}
Loading

0 comments on commit b1dcb6b

Please sign in to comment.