Skip to content

Conversation

@rohenaz
Copy link
Contributor

@rohenaz rohenaz commented Oct 23, 2025

Alpha → Master: Major Platform Upgrade

This PR brings significant infrastructure modernization, performance optimizations, and UX improvements from the alpha branch to production.


Infrastructure & Performance

Technology Stack Upgrades

  • Next.js 16.0.3 with React 19 and Turbopack (default bundler)
  • TypeScript 5.9.3 with improved type safety
  • @bsv/sdk 1.8.7 (from 1.1.30) with latest BSV functionality
  • @tanstack/react-query 5.90.5 for modern data fetching
  • js-1sat-ord v0.1.85 with bundled @bsv/templates
  • Migrated from react-markdown to @next/mdx for better Next.js compatibility
  • AI SDK v5 with ollama-ai-provider-v2 integration
  • React Compiler enabled for automatic optimization

Vercel Performance Optimizations

  • Bun Runtime enabled for faster JavaScript execution
  • Fluid Compute enabled - up to 95% cost savings on I/O-bound functions
  • Removed --turbopack flag (default in Next.js 16)
  • 24-hour OG image caching - fixes excessive crawler invocations
  • 5-minute API caching on inscription/BSV20 calls

Build & Package Management

  • Migrated from binary bun.lockb to text-based bun.lock for better git diffs
  • Added transpilePackages for ESM dependency compatibility
  • Consolidated fee rate configuration to 100 sat/kb across the platform

Home Page Overhaul

New Feed System

  • Created /api/feed route with randomized weighted algorithm
  • Supports images, videos, audio, and 3D models
  • 60-item initial load with infinite scroll
  • Cache expiration and background refill
  • Drag-to-scroll functionality

Hydration & Performance Fixes

  • Fixed blank page loading issues from mounted state anti-pattern
  • Connected server data to TanStack Query with initialData
  • Removed silent error handling that returned null
  • Fixed infinite scroll with proper cursor management
  • Simplified FlowLoader from 4+ parallel API calls to single endpoint

New Features

  • Full-screen artifact modal viewer with consolidated codebase
  • 3D models in feed with placeholder icons
  • Audio artifacts in feed
  • View transitions with iOS safe-area support
  • Info button integration

OpenGraph & Image Handling

Critical Performance Fix

  • Fixed excessive function invocations from OpenGraph crawlers
  • Implemented 24-hour caching on all OG image routes (collection, holders, market, outpoint, publisher)
  • This was causing massive unnecessary API calls

ALPHA/BETA Detection

  • Fixed OG images showing "BETA" on alpha.1sat.market
  • Now checks for git-alpha in Vercel deployment URLs
  • Proper hostname handling for custom domains

Image Components

  • Replaced img tags with ImageWithFallback across the app
  • Fixed image stretching and overflow in modals
  • Proper Next.js Image localPatterns configuration

Outpoint Page Refactor

Architecture Improvements

  • New layout system with server-side data fetching (layout.tsx, +103 lines)
  • Split into server/client components for better performance:
    • ArtifactViewer (+89 lines)
    • clientOutpointPage (+105 lines)
    • collectionServer (+51 lines)
    • inscriptionContent (+59 lines)
    • listingServer (+36 lines)
    • ownerServer (+28 lines)
    • timelineContent (+59 lines)
    • tokenContent (+50 lines)

Fixes

  • Fixed outpoint linking to use current listing UTXO instead of origin
  • Added loading states for tab transitions
  • Improved tab system (removed activeTab prop, added actualOwner)
  • Fixed TypeScript build errors

Collection Page

Timeout Protection

  • Added 8-second timeout on API calls with AbortController
  • Prevents Vercel 504 errors from slow upstream APIs
  • Graceful error messages for users

Bug Fixes

  • Fixed infinite loop with invalid outpoints
  • Better error handling in collection fetching

Authentication & Signing

Bitcoin Auth Integration

  • Sign page completely refactored (+168 lines)
    • Base64 encoding for OAuth callbacks
    • Redirect instead of POST for better UX
    • postMessage to notify opener window
    • Hide signature display, show connection button
    • Proper React hooks dependency management

Wallet Improvements

  • Better wallet unlock detection (check both encryptedBackup signal and showUnlockWalletButton)
  • Improved OAuth flow UX
  • New SigmaAvatar component (+71 lines) for BSV wallet provider integration

Market & Trading

API & Performance

  • Updated market paging with better limit handling
  • Added 5-minute cache to inscription/BSV20 API calls
  • All market pages updated for async route params (Next.js 15+ compatibility)

Components

  • MarketMenu updates for new TanStack Query patterns
  • Buy/Sell/List modals with proper type handling
  • TokenMarket page improvements

UI/UX Enhancements

New Components

  • ScrollToTop component (+43 lines) with auto-hide
  • Button Group component (+61 lines)
  • Skeleton component (+15 lines) for loading states
  • SigmaAvatar component (+71 lines)

Component Fixes

  • JDenticon hydration fix (use data URLs)
  • Better modal sizing and spacing
  • Ordinal name in modal title bar
  • Improved Vivi button for new AI SDK

Hydration Error Fixes

  • Fixed nested table in p tag
  • Removed nested Link in Collections
  • Removed nested tbody elements
  • Fixed view-transition-name duplicates
  • Fixed [object Object] 404 errors

Content Rendering

Markdown/MDX Migration

  • Migrated from react-markdown to @next/mdx
  • Added mdx-components.tsx configuration
  • Fixed ESM import errors with character-entities
  • Markdown component completely refactored

Media Components

  • Audio component bug fixes and feed integration
  • Video fixes: height constraints for visible controls
  • HTML artifacts: full-width display, proper iframe sizing
  • Model viewer improvements with type definitions

Testing Infrastructure

New Test Files

  • test-all-pages.mjs (+74 lines) - Page load testing
  • test-homepage.mjs (+77 lines) - Homepage specific tests
  • test-infinite-scroll.mjs (+74 lines) - Scroll behavior tests
  • test-market-detailed.mjs (+48 lines) - Market page tests
  • test-scroll-button.mjs (+33 lines) - Scroll button tests
  • test-tabs.spec.ts (+61 lines) - Tab navigation tests
  • tests/page-transitions.spec.ts (+120 lines) - Transition tests

Documentation

  • Created CLAUDE.md (+100 lines)
    • Project overview and architecture
    • Development commands
    • Important patterns and security notes
    • Tech stack details

Technical Improvements

TanStack Query Configuration

  • 5-minute staleTime
  • 10-minute gcTime
  • Disabled refetchOnWindowFocus
  • Disabled refetchOnMount
  • Single retry strategy

Utilities & Helpers

  • HTTP Client: better fetch caching and error handling
  • Time utils (+42 lines): new formatting helpers
  • Encryption utils: proper BufferSource type assertions
  • Transaction, inscribe, and sweep utils improvements

Type Definitions

  • Removed unnecessary src/types/react.d.ts
  • Added src/model-viewer.d.ts for 3D models

Critical Bug Fixes

  • Fixed Collections page infinite loop
  • Fixed artifact visibility in grid
  • Fixed video height constraints
  • Fixed modal view transitions
  • Fixed CSS syntax errors
  • Fixed TypeScript build errors
  • Fixed Vercel build errors
  • Fixed React hooks warnings
  • Fixed home page hydration mismatches
  • Fixed OG image crawler performance issues

Performance Impact

Cost Savings

  • Fluid Compute: Up to 95% reduction in function costs
  • OG image caching: Massive reduction in unnecessary API calls
  • Feed API optimizations: 60% fewer external API calls on home page

User Experience

  • Faster page loads with Bun runtime
  • Smoother transitions with view animations
  • Better mobile experience (iOS safe-area support)
  • Improved infinite scroll performance
  • Reduced hydration errors and layout shifts

Migration Notes

Breaking Changes

  • Next.js 15+ async params pattern required
  • React 19 compatibility needed
  • MDX replaces react-markdown (different API)

Compatibility

  • All existing features maintained
  • No database migrations required
  • Environment variables unchanged

Review Checklist

  • All tests passing
  • TypeScript builds without errors
  • No hydration mismatches
  • OG images working correctly
  • Feed system functional
  • Market pages operational
  • Wallet functionality intact
  • Performance improvements verified
  • Cost optimizations enabled

Ready for production deployment

rohenaz and others added 16 commits May 23, 2025 01:43
…hain-exchange-rate-api"

This reverts commit 6f41d9e, reversing
changes made to 72ea4bc.
- Add 24hr cache to opengraph-image routes (main culprit)
- Add 5min cache to inscription/bsv20 API calls in httpClient
- Fix async headers() call in main opengraph
- Prevent duplicate API calls across components
- Install bitcoin-auth dependency for standard BSV authentication
- Update server component to pass callback and state query params as props
- Implement callback flow in sign page:
  * Decode hex message using Utils.toArray and Utils.toUTF8
  * Generate authToken with getAuthToken from bitcoin-auth
  * POST authToken to callback URL when present
  * Redirect to redirectUrl from callback response
- Maintain backward compatibility for manual signature copy
- Use parseAuthToken to extract signature for display

Implements BSV_WALLET_PROVIDER_SPEC.md for Sigma Auth integration
Major updates:
- @bsv/sdk: 1.1.30 -> 1.8.7
- @tanstack/react-query: 5.59.19 -> 5.90.5
- typescript: 5.6.3 -> 5.9.3
- Next.js types and tooling updates

Build verified successful after updates
Sends wallet-connected event to window.opener with state for verification.
This allows the parent window to refresh the wallet list before the
popup redirects away.
- Remove bun.lockb (binary format)
- Add bun.lock (text format, better for git)
- Update CLAUDE.md to use bun commands instead of npm
- Added @ai-sdk/react and ollama-ai-provider-v2 dependencies.
- Refactored chat API routes to utilize the new ollama-ai-provider-v2 for improved functionality.
- Updated return types in chat API responses for consistency.
- Adjusted type assertions in the airdrop modal for better type safety.
…lity functions

- Updated type assertions for key, iv, and data parameters in encryption and decryption functions to use BufferSource.
- Utilized BSV SDK Utils for decoding base64 public keys to ensure compatibility.
- Improved type safety across encryption-related functions.
@vercel
Copy link
Contributor

vercel bot commented Oct 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
1sat-website Ready Ready Preview Comment Dec 12, 2025 0:40am

rohenaz and others added 3 commits October 22, 2025 21:33
- Update Next.js to 15.5.6, React to 19, React DOM to 19
- Enable Turbopack in dev script for faster builds
- Migrate all dynamic route pages to async params pattern (Next.js 15 requirement)
- Update API route handlers to handle Promise-based params
- Fix searchParams to be async in page components
- Await headers() calls in server components and metadata functions
- Update programmatic route handler calls to use Promise.resolve()
- Fix model-viewer custom element types with proper React module augmentation
- Update @google/model-viewer to latest version
Upgrade to Next.js 15 with React 19 and Turbopack
Add decode-named-character-reference and character-entities to
transpilePackages to resolve Next.js 15 ESM import errors.
This is the recommended Next.js 15 solution for handling CJS/ESM
module compatibility issues with Turbopack.
Add entire react-markdown dependency chain to transpilePackages
and configure Turbopack resolveAlias to handle ESM imports correctly.

This ensures all packages in the markdown parsing chain are
transpiled consistently for Next.js 15 + Turbopack.
- Remove react-markdown dependency (had ESM/CommonJS issues with Turbopack)
- Install @next/mdx and next-mdx-remote-client for proper Next.js 15 MDX support
- Update next.config.mjs to use @next/mdx with createMDX wrapper
- Create mdx-components.tsx file (required by @next/mdx)
- Refactor markdown.tsx component to use MDXClient from next-mdx-remote-client/csr
- Remove transpilePackages workarounds that didn't resolve Vercel build errors
- Add proper type checking for SerializeResult to handle compilation errors

This resolves the "Can't import the named export 'characterEntities'" error
that was failing Vercel deployments on the alpha branch.
- Keep @next/mdx configuration for project MDX file support
- Use next-mdx-remote-client/csr for remote markdown from ORDFS
- Remove unnecessary marked package
- Remove mdx-components.tsx (not needed for remote MDX)
- Build succeeds locally with webpack - testing Vercel deployment

This properly follows Next.js docs for handling remote markdown content
without transpilePackages hacks.
- Update next.config.mjs to include .md and .mdx file extensions for MDX processing
- This enhancement allows for better handling of markdown files in the project

This change aligns with the ongoing improvements for remote markdown rendering using @next/mdx.
rohenaz and others added 5 commits December 4, 2025 16:58
- Added CollectionFilters component for filtering collection items by traits and price range.
- Integrated filtering logic into CollectionList and MarketLayout components.
- Updated layout styles for better responsiveness and removed unnecessary footer components.
- Refactored fetchCollectionData to support filtering for collection items and market listings.
- Improved state management for filter changes to trigger data reloads.
- Updated ArtifactModal to hide the close button by default and added a close button for better user experience.
- Refactored FlowGrid to improve column layout based on window width, utilizing a custom hook for responsive design.
- Optimized artifact rendering with memoization and improved visibility tracking using IntersectionObserver.
- Adjusted loading skeletons and added fallback content for better loading states.
- Cleaned up unused code and improved overall component structure for maintainability.
…agement

- Updated query keys in WalletHistory for better clarity and organization.
- Removed unnecessary state updates in AudioArtifact to streamline performance.
- Enhanced conditional fetching in WalletHistory to ensure queries are only executed when relevant addresses are provided.
- Refactored various components to improve clarity and maintainability, including the addition of type imports for better type safety.
- Updated state management in components to utilize hooks more effectively, ensuring better performance and responsiveness.
- Cleaned up unused code and improved overall organization across multiple files, enhancing readability and reducing complexity.
…maintainability

- Updated multiple components, including layout and modal components, to enhance structure and responsiveness.
- Improved state management and type safety across several files, ensuring better performance and clarity.
- Cleaned up unused code and optimized rendering logic for better user experience.
- Added new utility functions and hooks to streamline functionality and improve code organization.
- Modified the SearchBar component to enhance the loading state display and improve input styling.
- Updated the development script in package.json to specify a custom port for the development server.
…and refactor infinite scroll to use scroll events.
…t API calls that interleave images and videos.
claude and others added 2 commits December 6, 2025 03:42
- Replace Daisy UI tabs with ShadCN-compatible styled tabs (inscribe tabs, general tabs)
- Migrate toggle to ShadCN Switch component (bsv20.tsx)
- Replace Daisy UI tooltips with ShadCN Tooltip components (bsv20, holders, fund.tsx)
- Migrate file-input to ShadCN Input component (bsv21.tsx)
- Replace Daisy UI table classes with ShadCN Table components (TokenListings, ModelListings)
- Update semantic colors: text-info/bg-info to Alert, text-success to green-500, text-error to destructive
- Replace hardcoded colors (#111, #555, #222, #333) with ShadCN semantic colors (card, muted, muted-foreground, border)
- Replace custom buttons with ShadCN Button component
- Update all form inputs to use ShadCN Input component
- Add Select component for action type dropdown in bsv20.tsx
- Add Slider component for bulk minting iterations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants