Skip to content

Commit 2c2ed8f

Browse files
committed
chore: update @browser-echo packages to version 1.1.0 in example apps and package dependencies
1 parent b7bdeac commit 2c2ed8f

File tree

14 files changed

+365
-104
lines changed

14 files changed

+365
-104
lines changed

example/next-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"react-dom": "19.1.1"
1515
},
1616
"devDependencies": {
17-
"@browser-echo/mcp": "1.0.2",
18-
"@browser-echo/next": "1.0.2",
17+
"@browser-echo/mcp": "1.1.0",
18+
"@browser-echo/next": "1.1.0",
1919
"@eslint/eslintrc": "^3",
2020
"@tailwindcss/postcss": "^4.1.12",
2121
"@types/node": "^24.3.0",

example/nuxt-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
},
1717
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac",
1818
"devDependencies": {
19-
"@browser-echo/nuxt": "1.0.2"
19+
"@browser-echo/nuxt": "1.1.0"
2020
}
2121
}

example/react-vite-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"react-dom": "^19.1.1"
1515
},
1616
"devDependencies": {
17-
"@browser-echo/vite": "1.0.2",
17+
"@browser-echo/vite": "1.1.0",
1818
"@eslint/js": "^9.17.0",
1919
"@types/react": "^19.1.10",
2020
"@types/react-dom": "^19.1.7",
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import * as React from 'react'
2+
3+
type AnimationHandle = {
4+
rafId: number | null
5+
}
6+
7+
export function MatrixBackground(): JSX.Element {
8+
const canvasRef = React.useRef<HTMLCanvasElement | null>(null)
9+
const handleRef = React.useRef<AnimationHandle>({ rafId: null })
10+
11+
React.useEffect(() => {
12+
const canvas = canvasRef.current
13+
if (!canvas) return
14+
15+
const ctx = canvas.getContext('2d', { alpha: true })
16+
if (!ctx) return
17+
18+
const dpr = Math.max(1, Math.min(2, window.devicePixelRatio || 1))
19+
let width = 0
20+
let height = 0
21+
let columns = 0
22+
let drops: Array<number> = []
23+
24+
const glyphs = ['0', '1']
25+
const baseFont = 14 // logical pixels
26+
const speed = 0.2 // fall speed factor
27+
28+
function resize() {
29+
const { innerWidth, innerHeight } = window
30+
width = innerWidth
31+
height = innerHeight
32+
canvas.width = Math.floor(width * dpr)
33+
canvas.height = Math.floor(height * dpr)
34+
canvas.style.width = `${width}px`
35+
canvas.style.height = `${height}px`
36+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0)
37+
38+
const fontSize = baseFont
39+
ctx.font = `${fontSize}px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`
40+
columns = Math.max(1, Math.floor(width / fontSize))
41+
drops = new Array(columns).fill(0).map(() => Math.floor(Math.random() * 20))
42+
}
43+
44+
function step() {
45+
if (document.hidden) {
46+
handleRef.current.rafId = requestAnimationFrame(step)
47+
return
48+
}
49+
50+
// Trail fade
51+
ctx.fillStyle = 'rgba(0,0,0,0.08)'
52+
ctx.fillRect(0, 0, width, height)
53+
54+
// Draw glyphs
55+
ctx.fillStyle = 'rgba(234,179,8,0.85)' // yellow-500 with alpha
56+
ctx.shadowColor = 'rgba(234,179,8,0.25)'
57+
ctx.shadowBlur = 0
58+
59+
const fontSize = baseFont
60+
for (let i = 0; i < columns; i++) {
61+
const text = glyphs[(Math.random() * glyphs.length) | 0]
62+
const x = i * fontSize
63+
const y = drops[i] * fontSize
64+
ctx.fillText(text, x, y)
65+
66+
// Reset drop randomly after it exits the screen to vary stream lengths
67+
if (y > height && Math.random() > 0.975) {
68+
drops[i] = 0
69+
}
70+
71+
drops[i] += speed + Math.random() * 0.5
72+
}
73+
74+
handleRef.current.rafId = requestAnimationFrame(step)
75+
}
76+
77+
const onResize = () => resize()
78+
resize()
79+
handleRef.current.rafId = requestAnimationFrame(step)
80+
window.addEventListener('resize', onResize, { passive: true })
81+
82+
return () => {
83+
window.removeEventListener('resize', onResize)
84+
if (handleRef.current.rafId != null) cancelAnimationFrame(handleRef.current.rafId)
85+
}
86+
}, [])
87+
88+
return (
89+
<canvas
90+
ref={canvasRef}
91+
className="fixed inset-0 z-0 opacity-20 pointer-events-none bg-transparent"
92+
aria-hidden="true"
93+
/>
94+
)
95+
}
96+
97+

example/tanstack-app/src/routes/__root.tsx

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
1111
import { NotFound } from '~/components/NotFound'
1212
import appCss from '~/styles/app.css?url'
1313
import { seo } from '~/utils/seo'
14-
import { DevLogDemo } from '~/components/DevLogDemo'
1514

1615
export const Route = createRootRoute({
1716
head: () => ({
@@ -70,62 +69,7 @@ function RootDocument({ children }: { children: React.ReactNode }) {
7069
<HeadContent />
7170
</head>
7271
<body>
73-
<DevLogDemo />
74-
<div className="p-2 flex gap-2 text-lg">
75-
<Link
76-
to="/"
77-
activeProps={{
78-
className: 'font-bold',
79-
}}
80-
activeOptions={{ exact: true }}
81-
>
82-
Home
83-
</Link>{' '}
84-
<Link
85-
to="/posts"
86-
activeProps={{
87-
className: 'font-bold',
88-
}}
89-
>
90-
Posts
91-
</Link>{' '}
92-
<Link
93-
to="/users"
94-
activeProps={{
95-
className: 'font-bold',
96-
}}
97-
>
98-
Users
99-
</Link>{' '}
100-
<Link
101-
to="/route-a"
102-
activeProps={{
103-
className: 'font-bold',
104-
}}
105-
>
106-
Pathless Layout
107-
</Link>{' '}
108-
<Link
109-
to="/deferred"
110-
activeProps={{
111-
className: 'font-bold',
112-
}}
113-
>
114-
Deferred
115-
</Link>{' '}
116-
<Link
117-
// @ts-expect-error
118-
to="/this-route-does-not-exist"
119-
activeProps={{
120-
className: 'font-bold',
121-
}}
122-
>
123-
This Route Does Not Exist
124-
</Link>
125-
</div>
126-
<hr />
12772
{children}
128-
<TanStackRouterDevtools position="bottom-right" />
12973
<Scripts />
13074
</body>
13175
</html>
Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,55 @@
11
import { createFileRoute } from '@tanstack/react-router'
2+
import { DevLogDemo } from '../components/DevLogDemo'
3+
import { MatrixBackground } from '../components/MatrixBackground'
4+
25
export const Route = createFileRoute('/')({
36
component: Home,
47
})
58

69
function Home() {
710
return (
8-
<div className="p-2">
9-
<h3>Welcome Home!!!</h3>
11+
<div className="min-h-screen bg-gray-950 text-gray-200">
12+
<MatrixBackground />
13+
<div className="relative p-8">
14+
<header className="text-center mb-10">
15+
<h1 className="text-5xl font-bold text-white font-mono tracking-tight">
16+
BROWSER ECHO
17+
</h1>
18+
<p className="mt-2 text-sm text-yellow-400 font-mono uppercase tracking-widest">
19+
Dev Log Demo • Network & Console
20+
</p>
21+
<div className="mt-4 flex justify-center gap-2">
22+
<span className="px-3 py-1 border border-yellow-500/40 text-yellow-300 rounded-sm text-xs font-mono">
23+
Console Logs
24+
</span>
25+
<span className="px-3 py-1 border border-yellow-500/40 text-yellow-300 rounded-sm text-xs font-mono">
26+
Network Capture
27+
</span>
28+
<span className="px-3 py-1 border border-yellow-500/40 text-yellow-300 rounded-sm text-xs font-mono">
29+
Error Tracking
30+
</span>
31+
</div>
32+
</header>
33+
34+
<div className="max-w-4xl mx-auto">
35+
<div className="bg-black/60 rounded-sm border border-yellow-500/40 p-6">
36+
<div className="mb-4 text-yellow-300 font-mono text-xs">
37+
~/dev/browser-echo-demo
38+
</div>
39+
40+
<DevLogDemo />
41+
</div>
42+
43+
<footer className="mt-10 text-center text-gray-400 font-mono text-xs">
44+
<p>Open your terminal to see logs</p>
45+
<p className="mt-1">
46+
<span className="text-yellow-400">[browser]</span> console •
47+
<span className="text-yellow-400 ml-2">[network]</span> http/ws •
48+
<span className="text-yellow-400 ml-2">[error]</span> exceptions
49+
</p>
50+
</footer>
51+
</div>
52+
</div>
1053
</div>
1154
)
1255
}

example/vue-vite-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"vue": "^3.5.18"
1313
},
1414
"devDependencies": {
15-
"@browser-echo/vite": "1.0.2",
15+
"@browser-echo/vite": "1.1.0",
1616
"@vitejs/plugin-vue": "^6.0.1",
1717
"typescript": "~5.9.2",
1818
"vite": "^7.1.3",

packages/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"react-dom": ">=18.0.0"
4242
},
4343
"dependencies": {
44-
"@browser-echo/core": "^1.1.0"
44+
"@browser-echo/core": "workspace:*"
4545
},
4646
"scripts": {
4747
"build": "unbuild",

packages/nuxt/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@nuxt/kit": ">=3.11.0"
2626
},
2727
"dependencies": {
28-
"@browser-echo/core": "^1.1.0"
28+
"@browser-echo/core": "workspace:*"
2929
},
3030
"scripts": {
3131
"build": "unbuild",

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"react-dom": ">=18.0.0"
2727
},
2828
"dependencies": {
29-
"@browser-echo/core": "^1.1.0"
29+
"@browser-echo/core": "workspace:*"
3030
},
3131
"scripts": {
3232
"build": "unbuild",

0 commit comments

Comments
 (0)