SolidJS: The Complete Guide
A comprehensive guide to reactive web development with SolidJS and TypeScript
This repository is dedicated to tracking and addressing any issues, feedback, or suggestions related to the book. Your insights are invaluable, whether it's to report errors, share thoughts on the book, or suggest ways to improve the content.
Please feel free to open an issue if:
- You’ve found an error in the text or examples.
- You have questions or would like further clarification on any topic.
- You have suggestions on improving the book’s structure, examples, or depth.
Your feedback not only helps improve the book for all readers but also contributes to building a better learning resource for the SolidJS community.
The book is available for purchase:
About the Book
Solid may seem simple on the surface, but its internal workings involve complex interactions that can sometimes be tricky to explain.
It is a comprehensive book that aims to teach you the ins and outs of Solid, covering its core principles, the inner workings, and the API. By the end of this book, you will have a thorough understanding of SolidJS to write efficient applications.
The book goes beyond just showing you how to use SolidJS; it explains the reasoning and underlying principles behind the library, helping you understand why certain approaches or features work the way they do. With this deeper comprehension, you’ll be well-equipped to build your own projects confidently.
I did my best to organize the topics in a way not to overwhelm the readers and to enhance progressive learning, with examples that focus on the subject matter without introducing unnecessary complexity.
I would love to hear your feedback on how the book has helped you understand SolidJS better, or any questions you might have!
Thank you for your interest and contributions.
Available Formats:
- PDF
- Epub
- Azw3 (on solid.courses only)
Table of Contents
- Chapter 01: Introduction
- The Solid Version Used
- Contact and Feedback
- Requirements
- Trying Solid via Online Playground
- Creating a Project From a Template
- Note For React Developers
- Chapter 02: Setting Up a Development Environment
- Chapter 03: On SolidJS
- The Problem Solid Solves
- How Solid Works?
- Reactive Data
- Composable UI
- The Advantages of Solid Over Its Alternatives
- Chapter 04: How Solid’s Reactive System Works
- Observer Pattern
- The Essence of Reactive Core
- The Uses of Computations
- Chapter 05: Tracking State With Signals
- Overwriting the comparison logic
- Updating Signals
- Transforming Signals
- Destructuring Signals
- Batching Updates
- Chapter 06: Running Side-Effects with Effects
- Effects Can Be Nested
- Explicit Tracking
- Opting Out of Tracking
- Handling External Dependencies
- Chapter 07: Caching Values with Memos
- Chapter 08: Rules of JSX
- Elements Should Be Closed
- JSX Elements Can Be Nested
- Expressions Can Be Used Inside JSX Elements
- Elements Can Have Attributes
- Missing Attribute Values Default to
true
- Comments
- Whitespaces Are Trimmed
- Chapter 09: Composing User Interfaces
- Components Should Return A Single Root Element
- Components Accept Data Through Their
props
- Adding Static Types To Components
- Components Can Have Children
- How Components Are Rendered
- Solid runs fine-grained updates
- Conditional Rendering
- Reactive
props
- Props should be treated as
read-only
- Destructuring Props Changes The Rendering Order
- Best Practices
- Chapter 10: Working With Props
- Passing Data From Parent To Child
- Providing Controlled Access To Parent’s Data
- Passing Data From Child To Parent
- Sharing State Between Children
- Destructuring And Spreading Props
- Forwarding Multiple Props At Once
- Validating Props
- Chapter 11: Sharing Data Through the Context API
- How Context API Works
- Best Practices
- Chapter 12: Component Lifecycle
onMount
onCleanup
- Best Practices
- Chapter 13: Accessing DOM Nodes With
ref
- Forwarding Refs
- Using refs with external libraries
- Best Practices
- Chapter 14: Working with Computations
createComputed
createRenderEffect
createEffect
createMemo
createDeferred
createReaction
- Chapter 15: Handling Errors
ErrorBoundary
catchError
- Handling Asynchronous Errors
- Handling Event Handling Errors
- Chapter 16: Working with Owners
- Running functions with a given owner
- Running effects in asynchronous context
- Chapter 17: Styling Elements
- Using Inline Styles
- Applying Style Definitions
- Applying classes based on a condition
- Using The Imperative API
- Chapter 18: Reactive Utilities
batch
untrack
on
createRoot
mergeProps
splitProps
mapArray
and indexArray
observable
from
startTransition
and useTransition
- Chapter 19: A Better Conditional Rendering
Switch
and Match
- Chapter 20: Working with Lists
For
mapArray
- Index
indexArray
- Selecting Items with Selectors
- Chapter 21: Rendering Components Outside Component Hierarchy
- Chapter 22: Managing Complex States with Stores
- Accessing Data
- Updating Stores
- Limitations Related to Reactivity
- Store Utilities
produce
reconcile
unwrap
createMutable
- Chapter 23: Abstracting Behavior With Custom Directives
- Extending JSX Type With Custom Directives
- Using Imported Directives
- Chapter 24: Working with Asynchronous Data
- Decoupling Fetching From Rendering
- Chapter 25: Using Resource API for Data Fetching
- Info Object
- Resource Actions
- Handling Errors
- Chapter 26: Managing Loading States with Suspense
- Chapter 27: Achieving Better Consistency with Transitions
- Chapter 28: Coordinating Loading States
- Chapter 29: Code Splitting and Lazy Loading
- Chapter 30: Handling Events
- Using the
on
namespace
- Using the
on:
Namespace
- Using the
oncapture:
Namespace
- Using Custom Properties
- Using Refs
- Using Custom Directives
- Passing Data to the Event Handlers
- Chapter 31: Dynamically Rendering Components
- Chapter 32: Server Side Rendering
- Targeting The Server Context
- Targeting the Development Build
- Rendering A Solid App
- Chapter 33: Solid Without JSX
- Solid with Tagged Template Literals
- Solid with Hyperscript
- Drawbacks
- A1: Setting Development Environment Using Webpack
- Index
- About the Author