Skip to content

Add real-world examples and performance benchmarks#97

Open
abhiasmt wants to merge 2 commits intochenglou:mainfrom
abhiasmt:improve-docs-usage-examples
Open

Add real-world examples and performance benchmarks#97
abhiasmt wants to merge 2 commits intochenglou:mainfrom
abhiasmt:improve-docs-usage-examples

Conversation

@abhiasmt
Copy link
Copy Markdown

@abhiasmt abhiasmt commented Apr 3, 2026

Summary

This PR improves developer experience by adding:

  • Real-world usage examples (chat UI, virtualization, responsive layout)
  • Best practices for using prepare() and layout()
  • Performance comparison with DOM-based approaches
  • React integration example
  • Simple benchmark script

Motivation

While Pretext is powerful, new users may struggle to understand:

  • When to use prepare() vs layout()
  • How it fits into real-world applications
  • Its performance benefits compared to DOM measurement

This PR aims to bridge that gap and improve adoption.

Changes

  • Updated README.md with new sections:
    • Real-world use cases
    • Best practices
    • Performance comparison
    • React example
  • Added /benchmarks/simple-benchmark.ts

Impact

  • Improves onboarding for new developers
  • Makes performance benefits clearer
  • Encourages correct usage patterns

Let me know if you'd like me to expand examples (Vue, Canvas, etc.)

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.

1 participant