Chapter 2: Understanding the web platform
The chapter introduction argues that the web platform is powerful by default, even though a focus on libraries and frameworks can obscure its advantages.
After this chapter you will be able to
- Overlooked web platform strengths. Explain why developers may overlook the web platform’s built-in strengths when considering Vanilla Web.
- Standards-based application longevity. Explain why building on web standards can reduce maintenance and help applications keep working over time, in contrast to relying heavily on versioned frameworks.
- Rendering engines and compatibility. Explain what rendering engines do, identify the three major engine families, and describe why a Vanilla app must accommodate differences among them.
- Browser as application runtime. Describe the browser's role as a built-in runtime for Vanilla apps, including how JavaScript execution relates to rendering.
- Installed web app model. Describe how a PWA uses the browser engine outside a tab and what installation does and does not require from a Vanilla developer.
- Native browsers versus web views. Distinguish OS-provided in-app browsers from custom web-view browsers, including their storage and compatibility implications.
- Additive native network protocols. Explain why a Vanilla Web app can choose and combine network protocols according to its needs without requiring a framework.
- URL parts and boundaries. Describe the main parts of a URL and distinguish an origin from a site and an app's scope.
- HTTP and secure origins. Explain HTTP's role in loading web resources and why Vanilla apps should generally use HTTPS, including the localhost exception.
- Persistent WebSocket communication. Distinguish WebSockets from HTTP request-response communication and describe when their native API is useful.
- WebRTC peer connections. Describe what WebRTC connects directly and the role a signaling server still plays.
- Browser isolation and origins. Explain how the browser sandbox and Same-Origin Policy limit what a web page can access.
- Roles of security standards. Distinguish the purposes of CORS, CSP, Secure Contexts, and the newer protections named in this section.
- Browser permissions and fallbacks. Describe who controls access to sensitive browser features and how an app should request and handle that access.
- MPA and SPA navigation. Distinguish an MPA’s server-served URLs and new browser navigations from an SPA’s initial navigation followed by client-side routing, and describe how a project can combine the two.
- Static site publishing models. Distinguish a directly shipped static site from SSG, which builds deployable HTML files from templates and content, and describe how SSG can be paired with CSR for interactive parts.
- Server client and universal rendering. Distinguish SSR’s rendering on each server request from CSR’s browser-side rendering, and explain how Universal Rendering combines an initial server-rendered page with client-side hydration.
- Interactive islands and hydration. Explain how Islands Architecture keeps most of a page as static HTML while independently hydrating interactive regions, and why those regions fit self-contained Vanilla Web Components.
- Vanilla project layers. Describe what semantic HTML, CSS, and JavaScript each contribute to a Vanilla project.
- Design patterns in Vanilla projects. Explain what a design pattern is and why choosing one matters especially in a Vanilla project.
- Responsive and adaptive layouts. Distinguish Responsive Web Design from Adaptive Design as approaches to fitting different devices and contexts.
- Native browser capabilities. Explain that browsers provide Web APIs for capabilities beyond HTML and CSS manipulation, and that Vanilla JavaScript can call them directly without a framework.
- Stable and experimental API choices. Distinguish stable, broadly available APIs from experimental ones, and describe how to use an experimental API without making the whole app depend on one browser.
- Baseline compatibility statuses. Explain what Baseline’s Newly available and Widely available statuses mean, and interpret a yearly label such as Baseline 2024.
- Control through fewer layers. Explain why using fewer dependencies and relying on browser capabilities can give developers more control over performance, security, and long-term maintenance. Describe this as a pragmatic choice rather than a rule against all tools.
- Vanilla UI benchmark performance. Explain what the cited UI benchmark compares and why Vanilla implementations often perform well in its raw update tests.
- Core Web Vitals measures. Describe Core Web Vitals as an initial way to assess real-world performance and name the three metrics and the user-facing qualities they capture.
- Native accessibility defaults. Explain how semantic HTML makes a Vanilla page more accessible, and how ARIA can extend native elements when needed.
- URL-based app distribution. Explain how sharing a URL gives users immediate access to a web app without an app store, review process, or signed binary, and why a Vanilla project avoids additional distribution obstacles.
- Benefits of web discardability. Explain how users can try and leave a web app without installation or cleanup, and how that low commitment helps adoption and lets developers ship and remove experiments quickly.
- Design for ephemeral usage. Describe why a discardable web app should work well for users who may visit only once or return on another device, including the design priorities the section identifies.
- Framework-free modern web apps. Explain that modern web apps can do more than display linked documents, and that Vanilla projects can provide modern capabilities without a framework.
- Web app installability requirements. Explain how a Web App Manifest and secure origin can let a browser offer installation, and note that some browsers can install a site without a manifest using defaults.
- Service Worker offline role. Explain that a website registers a Service Worker as a background script that can intercept network requests and serve cached assets or fallback pages when the app needs them.
- Browser storage choices. Distinguish the storage options by the kinds of data this section assigns to them: small key/value pairs, larger structured datasets, HTTP request/response pairs, user files, and data shared with the server.
- Storage loss and recovery. Explain why browser storage alone may not be dependable for critical data and what precaution the section recommends.
- Built-in locale formatting. Explain that JavaScript’s Intl APIs provide locale-sensitive formatting and related features, so many internationalization tasks do not require a library.
- Formatting versus content translation. Distinguish Intl’s localization features from translating content, and describe the sources a multilingual app can use for translated text.
- Browser device capabilities. Explain that modern browsers provide standard, permission-gated APIs for device features, allowing Vanilla JavaScript apps to do things that might otherwise seem to require native code.
- Browser-based AI benefits. Explain that machine learning tasks can run directly in the browser rather than on a server, and why that can help privacy-sensitive apps and avoid cloud token costs.
- Vanilla AI API approach. Describe how a Vanilla developer can treat AI as another API surface: load a model, run inference, and display the result without a special framework.
- Flexible development tool choices. Explain that Vanilla Web projects do not require a particular editor or tool suite, and that their standard web format also lets many AI chatbots create and test apps in a web view.
- Build-free deployment and optional checks. Explain that Vanilla Web source can be deployed unchanged because build tools are not required, while optional tools can provide formatting, code-quality checks, audits, testing, or CI/CD.
- Flexible but disciplined organization. Explain how Vanilla Web lets developers choose a simpler project structure without abandoning organization. Contrast that freedom with framework-prescribed structures, and explain why style guidelines still matter.
- Dependency and upgrade exposure. Explain why relying more on the codebase and browser-native implementations can reduce security, reliability, and maintenance risks compared with a large third-party dependency tree.
- Selective framework integration. Explain how a Vanilla Web app can add a framework to one part of an existing app without rewriting the rest, and why adding vanilla code to a heavily framework-dependent app may be harder.
- Vanilla project cost savings. Explain why a vanilla approach can reduce operational and maintenance costs, and why that can appeal to small companies or indie developers.
- Reduced Tooling Complexity Tax. Explain why a Vanilla project can be simpler to start, debug, and maintain than a project dependent on a framework build chain.
- Optional Performance Build Tools. Distinguish using build tools to optimize a Vanilla app from needing them to make the app runnable.
- Flexible Vanilla Web deployment. Explain how a Vanilla Web frontend is deployed and why it does not require a particular tool, server, or hosting service. Distinguish those frontend requirements from any backend or cloud services an individual project may use.
Section by section
Introduction
The chapter introduction argues that the web platform is powerful by default, even though a focus on libraries and frameworks can obscure its advantages.
- Overlooked web platform strengths: Explain why developers may overlook the web platform’s built-in strengths when considering Vanilla Web.
Why it matters: This explains why the chapter looks closely at what Vanilla Web already offers.
Key terms: web platform, Vanilla Web, libraries, frameworks
2.1 Building blocks
This section explains why web standards provide a stable foundation for Vanilla Web applications compared with versioned frameworks.
- Standards-based application longevity: Explain why building on web standards can reduce maintenance and help applications keep working over time, in contrast to relying heavily on versioned frameworks.
Why it matters: It explains the book’s case for choosing the web platform as an application foundation. - Collaborative standards development: Describe how open collaboration and browser-vendor participation shape web standards.
Why it matters: The collaborative process helps explain why standards provide a predictable foundation.
Key terms: web standards, backward compatibility, Vanilla Web, interoperability, specifications
2.1.1 Rendering engines
The section explains how rendering engines run Vanilla Web code across browsers, installed apps, embedded views, and emerging AI-driven environments.
- Rendering engines and compatibility: Explain what rendering engines do, identify the three major engine families, and describe why a Vanilla app must accommodate differences among them.
Why it matters: A standards-based app still needs to work across engines with different feature availability. - Browser as application runtime: Describe the browser's role as a built-in runtime for Vanilla apps, including how JavaScript execution relates to rendering.
Why it matters: Vanilla development can rely on substantial capabilities already supplied by the browser. - Agentic consumption of web content: Explain how agentic browsers can consume web content differently and why structured markup matters to them.
Why it matters: Good web structure can help both human users and agents acting on their behalf. - Installed web app model: Describe how a PWA uses the browser engine outside a tab and what installation does and does not require from a Vanilla developer.
Why it matters: The same web code can offer an app-like installed experience without becoming a separate native implementation. - Native browsers versus web views: Distinguish OS-provided in-app browsers from custom web-view browsers, including their storage and compatibility implications.
Why it matters: The same link may behave differently depending on whether its host opens a browser-managed view or its own web view. - Web code in host ecosystems: Describe how Vanilla web code can reach mini apps and AI chat environments, while accounting for host-specific requirements.
Why it matters: Web standards help one codebase reach environments beyond a conventional website.
Key terms: rendering engines, Blink, WebKit, Gecko, feature detection, progressive enhancement, browser, rendering engine, execution engine, JavaScript runtime
2.1.2 Network protocols
This section explains how Vanilla Web apps use native browser networking, from URL boundaries and HTTPS to real-time and peer-to-peer communication.
- Additive native network protocols: Explain why a Vanilla Web app can choose and combine network protocols according to its needs without requiring a framework.
Why it matters: You can select the communication each feature needs instead of treating a framework or one protocol as an all-or-nothing choice. - URL parts and boundaries: Describe the main parts of a URL and distinguish an origin from a site and an app's scope.
Why it matters: These distinctions help you interpret URLs and the security boundaries that affect Web APIs. - HTTP and secure origins: Explain HTTP's role in loading web resources and why Vanilla apps should generally use HTTPS, including the localhost exception.
Why it matters: Serving over HTTPS preserves access to browser capabilities, while the native Fetch API handles most ordinary HTTP requests. - Persistent WebSocket communication: Distinguish WebSockets from HTTP request-response communication and describe when their native API is useful.
Why it matters: This helps you recognize when live two-way messaging merits a persistent connection rather than ordinary HTTP requests. - WebRTC peer connections: Describe what WebRTC connects directly and the role a signaling server still plays.
Why it matters: It distinguishes direct peer-to-peer traffic from both server-mediated messaging and the setup needed to establish a call. - Browser as universal client: Describe the broader range of direct browser capabilities mentioned beyond the three main protocols.
Why it matters: It encourages checking built-in browser capabilities before adding another dependency.
Key terms: Vanilla, HTTPS, WebSockets, WebRTC, native APIs, URL, protocol, host, port, origin
2.1.3 Web security
Explains the browser-enforced security foundations of web apps and the developer practices that work with them.
- Browser isolation and origins: Explain how the browser sandbox and Same-Origin Policy limit what a web page can access.
Why it matters: These browser-enforced limits are the starting point for understanding web security. - Roles of security standards: Distinguish the purposes of CORS, CSP, Secure Contexts, and the newer protections named in this section.
Why it matters: Choosing a protection starts with recognizing which security problem it addresses. - Browser permissions and fallbacks: Describe who controls access to sensitive browser features and how an app should request and handle that access.
Why it matters: An app can use sensitive features without assuming that users will grant access. - Direct security responsibilities: Explain the developer practices the section recommends and why a library or framework does not replace browser security.
Why it matters: Using Vanilla Web does not remove security work, and adding a framework does not substitute for platform protections.
Key terms: sandbox, Same-Origin Policy (SOP), origin, CORS, CSP, Secure Contexts, Trusted Types, COOP/COEP, permission model, permissions
2.1.4 Application architecture
This section explains the navigation, rendering, and user interface engine choices made when starting a Vanilla Web project.
- MPA and SPA navigation: Distinguish an MPA’s server-served URLs and new browser navigations from an SPA’s initial navigation followed by client-side routing, and describe how a project can combine the two.
Why it matters: This choice determines how users move between parts of an application. - Static site publishing models: Distinguish a directly shipped static site from SSG, which builds deployable HTML files from templates and content, and describe how SSG can be paired with CSR for interactive parts.
Why it matters: The distinction clarifies when content is prepared and what the deployed server must do. - Server client and universal rendering: Distinguish SSR’s rendering on each server request from CSR’s browser-side rendering, and explain how Universal Rendering combines an initial server-rendered page with client-side hydration.
Why it matters: These models identify where rendering work happens and why Universal Rendering needs coordinated server and client technology. - Incremental static regeneration: Explain how ISR differs from plain SSG by regenerating pre-rendered pages after deployment, and state why it depends on hosting and caching infrastructure.
Why it matters: ISR shows how static delivery can accommodate changing content, but not without platform support. - Interactive islands and hydration: Explain how Islands Architecture keeps most of a page as static HTML while independently hydrating interactive regions, and why those regions fit self-contained Vanilla Web Components.
Why it matters: Islands offer a way to add focused interactivity without making the entire page a client-rendered application. - User interface engine choices: Distinguish the section’s HTML, CSS, and JavaScript interface from 2D Canvas and 3D Canvas/WebGL interfaces, including the kinds of applications given for each.
Why it matters: Choosing an interface engine shapes how the application draws its UI.
Key terms: multi-page application (MPA), single-page application (SPA), client-side, custom routing system, Static Site, Static Site Generation (SSG), Client-Side Rendering (CSR), Server-Side Rendering (SSR), Universal Rendering, hydration
2.1.5 HTML, CSS, and JavaScript
This section explains the roles of HTML, CSS, and JavaScript in a Vanilla project and introduces WebAssembly as an optional complement for demanding computation.
- Vanilla project layers: Describe what semantic HTML, CSS, and JavaScript each contribute to a Vanilla project.
Why it matters: These distinct roles provide a foundation for building an app with the web platform itself. - WebAssembly alongside JavaScript: Explain when a Vanilla project might use WebAssembly and why it complements rather than replaces JavaScript.
Why it matters: WebAssembly offers a performance option without changing the project’s Vanilla approach or removing JavaScript.
Key terms: semantic HTML, CSS layer, JavaScript, ECMAScript modules, WebAssembly, Wasm, WebAssembly API
2.2 Design Patterns
The section explains why Vanilla Web projects need deliberate design-pattern choices and introduces patterns for adaptable layouts, broad compatibility, reusable components, and installable apps.
- Design patterns in Vanilla projects: Explain what a design pattern is and why choosing one matters especially in a Vanilla project.
Why it matters: In a Vanilla project, you have to make these practice and implementation choices yourself. - Responsive and adaptive layouts: Distinguish Responsive Web Design from Adaptive Design as approaches to fitting different devices and contexts.
Why it matters: The distinction gives you two ways to think about adapting a layout without treating them as mutually exclusive. - Compatibility components and app patterns: Describe the problems addressed by Progressive Enhancement, Web Components, and Progressive Web Apps at the level introduced here.
Why it matters: These patterns address different needs: compatibility, reusable interface pieces, and an installable app experience.
Key terms: design pattern, Vanilla project, Responsive Web Design (RWD), Adaptive Design (AD), Progressive Enhancement (PE), feature detection, Web Components, Progressive Web Apps (PWA)
2.2.1 Web APIs
This section introduces native Web APIs and explains how to choose them using compatibility checks and Baseline status.
- Native browser capabilities: Explain that browsers provide Web APIs for capabilities beyond HTML and CSS manipulation, and that Vanilla JavaScript can call them directly without a framework.
Why it matters: Looking for a native API first may let you use a capability without adding a library. - Stable and experimental API choices: Distinguish stable, broadly available APIs from experimental ones, and describe how to use an experimental API without making the whole app depend on one browser.
Why it matters: This approach lets an app benefit from newer capabilities without requiring every browser to support them. - Baseline compatibility statuses: Explain what Baseline’s Newly available and Widely available statuses mean, and interpret a yearly label such as Baseline 2024.
Why it matters: Baseline helps you judge whether cross-browser support is recent enough that users may still need a fallback. - Older API security restrictions: Describe the section’s qualification that some older web APIs changed or acquired security restrictions, despite such compatibility updates now being rare.
Why it matters: A browser capability may have security requirements even when its API still exists.
Key terms: Web APIs, browser APIs, Vanilla mindset, stable APIs, experimental APIs, progressively enhance, feature detection, gracefully degrade, Baseline, Newly available
2.3 The power of Vanilla Web
This section explains why Vanilla Web’s fewer layers can give developers more control and a simpler way to reason about an app.
- Control through fewer layers: Explain why using fewer dependencies and relying on browser capabilities can give developers more control over performance, security, and long-term maintenance. Describe this as a pragmatic choice rather than a rule against all tools.
Why it matters: This explains the practical benefit the section claims for choosing Vanilla Web. - Simpler platform mental model: Describe the section’s simple division of responsibilities among HTML, CSS, and JavaScript, and explain why avoiding extra machinery makes the app easier to reason about.
Why it matters: A simpler mental model helps developers understand the app without accounting for unnecessary framework machinery.
Key terms: Vanilla Web, dependencies, fewer layers, HTML, CSS, JS, mental model
2.3.1 Web performance
Explains why well-designed Vanilla sites can perform well, how raw UI benchmarks compare them with frameworks, and how Core Web Vitals measure user-facing performance.
- Vanilla UI benchmark performance: Explain what the cited UI benchmark compares and why Vanilla implementations often perform well in its raw update tests.
Why it matters: The comparison helps distinguish a raw UI speed advantage from a guarantee that every Vanilla app will be fast. - Core Web Vitals measures: Describe Core Web Vitals as an initial way to assess real-world performance and name the three metrics and the user-facing qualities they capture.
Why it matters: These metrics turn a general claim that a site feels fast into user-facing things you can check. - Conditions for Vanilla performance: Explain why Vanilla's performance advantage depends on good design and how the section suggests checking user-facing results.
Why it matters: Avoiding a framework removes some costs, but measuring a well-designed site is more useful than assuming it performs well.
Key terms: JS Framework Benchmark, vanilla DOM implementation, diffing and reconciliation, Web Vitals, Core Web Vitals, Largest Contentful Paint (LCP), Interaction to Next Paint (INP), Cumulative Layout Shift (CLS), effective design patterns, semantic HTML
2.3.2 Accessibility
This section explains why Vanilla Web can make accessibility the default by using meaningful native HTML and testing the result.
- Native accessibility defaults: Explain how semantic HTML makes a Vanilla page more accessible, and how ARIA can extend native elements when needed.
Why it matters: Choosing the right HTML element gives users and assistive technologies a better starting point than recreating its behavior yourself. - Accessibility-first development practice: Describe the accessibility discipline advocated for Vanilla projects: choose the correct element for the job and test it with fundamental accessibility tools rather than treating accessibility as a later add-on.
Why it matters: Native defaults help most when accessibility guides element choices from the start and the result is tested.
Key terms: a11y, semantic HTML, ARIA attributes, focus management, accessibility first, div soup, fundamental accessibility tools
2.3.3 Distribution
This section explains why URLs make Vanilla Web apps easy to distribute and why URL design matters to users.
- URL-based app distribution: Explain how sharing a URL gives users immediate access to a web app without an app store, review process, or signed binary, and why a Vanilla project avoids additional distribution obstacles.
Why it matters: A shareable URL makes an app immediately accessible to people with a browser. - URLs as user experience: Describe how URLs can link to specific parts of an app and be shared through QR codes, NFC tags, or native apps; explain why clean, readable URLs matter.
Why it matters: A well-designed URL helps people reach, trust, and share the right part of an app.
Key terms: distribution, URL, Vanilla project, deep link, Text Fragments, UX, QR codes, NFC tags
2.3.4 Discardability
Explains why web apps are easy to try and discard, and why developers should design for brief or one-time use.
- Benefits of web discardability: Explain how users can try and leave a web app without installation or cleanup, and how that low commitment helps adoption and lets developers ship and remove experiments quickly.
Why it matters: It explains a practical advantage of publishing an app on the Web. - Design for ephemeral usage: Describe why a discardable web app should work well for users who may visit only once or return on another device, including the design priorities the section identifies.
Why it matters: An app should be useful without assuming the user has an ongoing relationship with it.
Key terms: discardability, commitment barrier, ephemeral usage, fast loading, stateless design, progressive enhancement
2.4 Modern web apps
This section establishes that Vanilla Web projects can build modern web apps without a framework.
- Framework-free modern web apps: Explain that modern web apps can do more than display linked documents, and that Vanilla projects can provide modern capabilities without a framework.
Why it matters: It helps you recognize that modern app capabilities are available when building with Vanilla Web.
Key terms: modern web apps, Vanilla projects, framework, installable, offline-capable
2.4.1 Installability
This section explains how installability lets a Vanilla Web app appear on a home screen or desktop, chiefly through a Web App Manifest.
- Web app installability requirements: Explain how a Web App Manifest and secure origin can let a browser offer installation, and note that some browsers can install a site without a manifest using defaults.
Why it matters: You can make a website installable without a framework or compilation step. - Native-like web app experience: Describe why the manifest is a useful addition for Vanilla developers and what kind of launch experience it can help provide.
Why it matters: Installability can make a web app feel at home on a device while it remains a web app.
Key terms: installability, Web App Manifest, secure origin, Install, Service Workers, native-like launch experience
2.4.2 Offline support
This section explains how Service Workers support offline behavior in Vanilla apps and why graceful offline behavior matters to users.
- Service Worker offline role: Explain that a website registers a Service Worker as a background script that can intercept network requests and serve cached assets or fallback pages when the app needs them.
Why it matters: This explains the basic browser capability behind an app that continues to work offline. - Flexible offline strategies: Describe how the low-level Service Worker API lets a Vanilla app choose what to cache and how to update it, starting with static assets before adopting more complex strategies.
Why it matters: You can add useful offline behavior without committing to a framework or implementing every strategy at once. - Offline experience and trust: Justify treating offline behavior as part of the user experience: connections may be unavailable, and an app that fails gracefully is more trustworthy than one that breaks.
Why it matters: Thinking about connectivity as a UX concern helps you avoid leaving users with a broken app.
Key terms: Service Worker, network requests, cache assets, fallback pages, static assets, background sync, stale-while-revalidate, offline, UX, fails gracefully
2.4.3 Data Storage
This section matches browser storage options to different kinds of data and warns that client-side storage needs a recovery plan.
- Browser storage choices: Distinguish the storage options by the kinds of data this section assigns to them: small key/value pairs, larger structured datasets, HTTP request/response pairs, user files, and data shared with the server.
Why it matters: Matching data to a storage option helps you choose an appropriate browser feature. - Combining built-in storage: Explain how an app can combine browser storage options without a library, using the section’s examples of settings, cached API responses, and user-generated data. Describe where a developer can inspect that stored data.
Why it matters: You can use the right store for each part of an app without adding a storage library. - Storage loss and recovery: Explain why browser storage alone may not be dependable for critical data and what precaution the section recommends.
Why it matters: A recovery plan prevents browser storage loss from becoming permanent loss of important data.
Key terms: Local Storage, Session Storage, IndexedDB, Cache API, File System Access API, Cookies, developer tools, quotas, eviction policies, Storage API
2.4.4 Internationalization
This section explains what the browser’s internationalization APIs handle, where content translation requires additional resources, and what practical work remains for a multilingual app.
- Built-in locale formatting: Explain that JavaScript’s Intl APIs provide locale-sensitive formatting and related features, so many internationalization tasks do not require a library.
Why it matters: You can use browser features for common localization work before adding dependencies. - Formatting versus content translation: Distinguish Intl’s localization features from translating content, and describe the sources a multilingual app can use for translated text.
Why it matters: Formatted dates and numbers do not provide the translated words an app needs. - Multilingual app organization: Describe the practical work that remains when using built-in internationalization APIs in a multilingual app.
Why it matters: Built-in APIs reduce tooling needs but do not remove the work of organizing and testing multilingual content.
Key terms: Intl, internationalization APIs, Unicode-aware HTML and CSS, content translation, translation dictionary, Translation API, locales, RTL layouts, Intl.PluralRules
2.4.5 Capabilities API
This section explains that permission-gated browser APIs give Vanilla JavaScript access to device capabilities once associated with native apps.
- Browser device capabilities: Explain that modern browsers provide standard, permission-gated APIs for device features, allowing Vanilla JavaScript apps to do things that might otherwise seem to require native code.
Why it matters: You may be able to build a device-enabled feature entirely for the browser rather than assuming it needs a native app.
Key terms: Capabilities APIs, permissions, Vanilla JS, web API
2.4.6 Client-side AI
This section explains how Vanilla Web apps can run AI in the browser, why that can be useful, and the current limits of built-in AI APIs.
- Browser-based AI benefits: Explain that machine learning tasks can run directly in the browser rather than on a server, and why that can help privacy-sensitive apps and avoid cloud token costs.
Why it matters: It explains when running AI in the browser may be preferable to sending work to a cloud service. - Vanilla AI API approach: Describe how a Vanilla developer can treat AI as another API surface: load a model, run inference, and display the result without a special framework.
Why it matters: It connects browser AI to the book's broader approach of using web capabilities directly. - Built-in AI API availability: Distinguish the high-level Summarizer API from the lower-level Prompt API as examples, and state that these recent built-in APIs are available only in some Chromium browsers at the time described.
Why it matters: The examples illustrate what built-in browser AI can offer without suggesting that the APIs work everywhere yet.
Key terms: client-side AI, machine learning models, API surface, inference, Vanilla developers, Summarizer, Prompt API, Chromium browsers, Baseline
2.5 Developer experience
This section explains how Vanilla Web development can use familiar tools, optional local-development conveniences, and optional quality checks without requiring a build process.
- Flexible development tool choices: Explain that Vanilla Web projects do not require a particular editor or tool suite, and that their standard web format also lets many AI chatbots create and test apps in a web view.
Why it matters: You can start with tools you already like rather than adopting a required development stack. - Optional local development conveniences: Describe how a framework-style local development workflow can be added with a local server and tools such as live reload, and how browser developer tools can support editing and debugging in the browser.
Why it matters: You can retain a convenient development workflow without assuming it comes built in. - Build-free deployment and optional checks: Explain that Vanilla Web source can be deployed unchanged because build tools are not required, while optional tools can provide formatting, code-quality checks, audits, testing, or CI/CD.
Why it matters: You can keep deployment simple while choosing quality tools when they are useful.
Key terms: Vanilla Web, web view, local server, live-reload, browser developer tools, Workspace, build tools, source code, lightweight toolchains, ESLint
2.5.1 Simple and more secure organization
This section explains how Vanilla Web can simplify project organization while reducing dependency-related security and maintenance risks.
- Flexible but disciplined organization: Explain how Vanilla Web lets developers choose a simpler project structure without abandoning organization. Contrast that freedom with framework-prescribed structures, and explain why style guidelines still matter.
Why it matters: Choosing your own structure can remove unnecessary complexity, provided you keep the code organized. - Dependency and upgrade exposure: Explain why relying more on the codebase and browser-native implementations can reduce security, reliability, and maintenance risks compared with a large third-party dependency tree.
Why it matters: It explains why a simpler dependency footprint can make an app easier to trust and maintain over time.
Key terms: Vanilla Web, project structure, style guidelines, dependencies, dependency tree, browser’s native implementations, backward-compatibility
2.5.2 Interoperability with libraries and frameworks
The section explains how Vanilla Web lets developers add libraries and frameworks selectively, while modern frameworks are adopting more platform-like approaches.
- Selective framework integration: Explain how a Vanilla Web app can add a framework to one part of an existing app without rewriting the rest, and why adding vanilla code to a heavily framework-dependent app may be harder.
Why it matters: Starting with Vanilla Web does not rule out using a framework when a particular part of the app needs one. - À la carte tool choice: Describe how a Vanilla Web app can combine libraries and direct platform features from different sources, choosing each for the job rather than relying on one all-encompassing framework.
Why it matters: You can choose a small, suitable tool for a feature without making it the foundation of the whole app. - Frameworks moving toward platform: Explain the two ways the section says modern frameworks are becoming more vanilla-like: producing an initial load resembling static HTML and aligning more directly with Web Components standards.
Why it matters: These trends show that framework development is also drawing on strengths the section associates with Vanilla Web.
Key terms: Vanilla Web, framework-agnostic, vendor, ecosystem, a la carte flexibility, Chart.js, WebGL, Alpine.js, server-side rendering (SSR), static site generation (SSG)
2.5.3 Cost reduction
This section explains how a vanilla approach can lower business costs and overhead.
- Vanilla project cost savings: Explain why a vanilla approach can reduce operational and maintenance costs, and why that can appeal to small companies or indie developers.
Why it matters: These savings can make a project easier to sustain with a small budget or team.
Key terms: vanilla approach, dependency updates, static files, CDN, minimal overhead
2.5.4 Reduced Complexity Tax
This section explains how Vanilla Web reduces the complexity tax by keeping dependencies, server choices, build tools, and package managers optional rather than making them prerequisites.
- Reduced Tooling Complexity Tax: Explain why a Vanilla project can be simpler to start, debug, and maintain than a project dependent on a framework build chain.
Why it matters: Fewer required tools mean fewer things that can break before or after an app is shipped. - Portable Server Client Separation: Describe how separating server responsibilities from client-side enhancement makes a Vanilla frontend portable across backend technologies and hosting arrangements.
Why it matters: Keeping the frontend independent leaves room to change how and where the server runs. - Optional Performance Build Tools: Distinguish using build tools to optimize a Vanilla app from needing them to make the app runnable.
Why it matters: Optimization can remain a choice instead of becoming a condition for running the app. - Optional Package Manager Infrastructure: Explain when package managers remain useful in Vanilla projects and why they need not be required to run the app.
Why it matters: Keeping packages optional reduces dependency overhead without ruling out useful libraries or tools.
Key terms: complexity tax, node_modules, build chain, web standards, server-side simplicity, client JS, portable, build step, build tools, build pipeline
2.5.5 Deploying the apps
A Vanilla Web frontend can be deployed by sending its files to a web server, without a Vanilla-specific server or deployment tool.
- Flexible Vanilla Web deployment: Explain how a Vanilla Web frontend is deployed and why it does not require a particular tool, server, or hosting service. Distinguish those frontend requirements from any backend or cloud services an individual project may use.
Why it matters: You can choose hosting and deployment tools to fit the project rather than to satisfy a Vanilla-specific requirement.
Key terms: Vanilla Web, web server, deployment tool, frontend
2.6 Summary
Where this is used later
- Using polyfills (chapter 5) · Provides context for handling features that an engine does not support.
- Versioning (chapter 5) · Builds on the browser's role in executing the JavaScript source developers ship.
- Semantic HTML (chapter 3) · Develops the semantic HTML identified here as useful structure.
- Accessibility (chapter 3) · Develops accessibility features identified here as signals.
- Web app manifest (chapter 3) · Explains the web app manifest mentioned as a source of installability.
- Credentials and cookies (chapter 12) · Provides context for differing login sessions when web content opens inside apps.
- Working with HTTP (chapter 12) · HTTP is used to work with remote data.
- Working with WebSockets (chapter 12) · WebSockets are used for live communication.
Concepts explained in this chapter
- progressive enhancementProgressive enhancement is an approach that starts with broadly compatible baseline functionality and adds capabilities when supported by the user's device and browser.
- feature detectionFeature detection is a technique for determining at runtime whether a browser or environment supports a particular capability.
- vanilla webAn approach to building websites and web applications with core web technologies and browser APIs without a framework defining the application architecture.
- progressive web appA progressive web app is a web application that can be installed on an operating system and provide a standalone app-like experience with optional offline operation and operating-system integration.
- rendering engineA rendering engine is browser software that parses web content and produces the rendered document and interactive page experience.
- manifest fileA manifest file is a structured web-application configuration file that declares metadata and installation-related properties.
- Fetch APIA function of the Fetch API that initiates a network request and returns a promise for its response.
- originA web security identity defined by a scheme, host, and port that determines the boundary for same-origin access.
- prerenderingStatic site generation is the process of producing deployable HTML files from templates and content before those files are served to users.
- server-side renderingGenerating HTML on a server for delivery to a browser.
- URLA URL is a standardized textual address that identifies a web resource or navigation destination and can include protocol, host, port, path, query, and fragment components.
- client-side renderingClient-side rendering is the generation or updating of a web interface in the user's browser using client-side code.
- incremental static regenerationIncremental static regeneration is a static-generation technique that regenerates deployed pages in the background on a schedule or when requested.
- multi-page appA multi-page application is a web application whose navigation commonly loads separate HTML documents for different routes or views.
- navigation modelA navigation model is an architectural scheme that determines how URLs and user navigation map to web application content or views.
- partial hydrationIslands architecture is a rendering pattern in which mostly static server-rendered HTML contains independently hydrated interactive regions.
- rendering modelA rendering model is an architectural scheme that determines where and when web-page content is generated.
- single-page applicationA single-page application is a web application that updates its interface within one loaded document rather than performing full document loads for each view.
- static siteA website whose pages are served as prebuilt files rather than assembled by application code for each visitor request.
- universal renderingUniversal rendering is an architecture that renders initial HTML on the server and then enables client-side interactivity through hydration.
- dependencyA dependency is an external software component required by an application or another software component to build or operate.
- BaselineA WebDX initiative that reports when web platform features reach specified levels of availability across major browsers.
- Web APIsA programming interface exposed by a web browser for accessing web-platform or device capabilities.
- Cache Storage APIThe Cache Storage API is a browser API for storing and retrieving request–response pairs, commonly to support offline use and control of network responses.
- Web ComponentsA reusable custom HTML element built using browser standards such as custom elements, shadow DOM, and HTML templates.
- apiAn API surface is the set of interfaces and operations that software exposes for external use.
- API stabilityA stable API is a web API whose behavior and availability are sufficiently established for dependable use across supported browsers.
- performance APIThe Performance API is a browser API for collecting high-resolution timing and performance information.
- semantic markupThe practice of using HTML elements according to their meaning to represent a document's content and structure.
- ECMAScript moduleAn ECMAScript module is a separately scoped JavaScript module with explicit import and export bindings.
- performancePerformance is the speed, responsiveness, and resource efficiency of a software system during operation.
- accessibilityThe degree to which a product or service can be used by people with varied abilities and disabilities.
- CORSCross-origin resource sharing is a web mechanism through which servers use HTTP headers to specify which other origins may access their resources.
- web standardsA public technical specification defining interoperable web languages, APIs, protocols, or platform behavior.
- responsive designResponsive web design is an approach to creating websites that adapt their layout and presentation to different screen sizes, devices, and contexts.
- browser developer toolsBrowser developer tools are utilities for inspecting, debugging, testing, and profiling web pages and applications.
- developer experienceThe overall quality and effectiveness of a software developer's interaction with development tools, systems, and workflows.
- web platformThe collection of browser-provided standards and technologies, including HTML, CSS, and JavaScript, that support web application development.
- service workerA service worker is a browser-managed background script that can intercept network requests and support offline behavior, caching, and other progressive web application features.
- interoperabilityInteroperability is the ability of software systems or components to exchange and use information correctly across their boundaries.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
