You are previewing Building Polyfills.

Building Polyfills

Cover of Building Polyfills by Brandon Satrom Published by O'Reilly Media, Inc.
  1. Special Upgrade Offer
  2. Preface
    1. Who This Book Is For
    2. How This Book Is Organized
    3. Conventions Used in This Book
    4. Using Code Examples
    5. Safari® Books Online
    6. How to Contact Us
    7. Acknowledgments
  3. Foreword
  4. I. Building Polyfills
    1. 1. The Current State of Web Polyfills
      1. Polyfilling: Past, Present, and Future
      2. What Is a Polyfill (and What Is It Not)?
      3. Types of Polyfills
      4. Why Polyfills Still Matter
    2. 2. Principles and Practices of Polyfill Development
      1. Building Responsible Polyfills
      2. Principles of Responsible Polyfill Development
    3. 3. Building Your First Polyfill, Part 1: Getting Started
      1. The HTML5 Forms Polyfill
      2. Setting Up Your Polyfill Project
      3. Specifying the API
      4. Deciding What to Build
      5. Adding Basic Features
      6. Beefing Up Your Polyfill with Additional Features
      7. Building Utility Polyfills
      8. Polyfilling Visual Features With CSS
      9. Testing Your Work Across Browsers
    4. 4. Building Your First Polyfill, Part 2: Build Workflows and Cross-Browser Testing
      1. Setting Up Your Project Workflow
      2. Jump-Starting Your Workflow
      3. Adding Unit Tests to Your Polyfill
      4. Automating Cross-Browser Polyfill Testing
      5. Configuring Cross-Browser Tests with Karma
      6. The Bottom Line: Use What Works for You!
    5. 5. Building Your First Polyfill, Part 3: Performance and Edge-Case Testing
      1. Building for Performance
      2. Dealing with Browser-Specific Edge Cases
      3. Mobile-Specific Considerations
  5. II. Prollyfilling and the Future of the Web Platform
    1. 6. The Future of Polyfilling
      1. Polyfilling: Not Just For Older Browsers
      2. Prollyfilling: Extending the Web Forward
      3. Prollyfills In Action: Prollyfilling CSS
      4. Prollyfills in Action: ServiceWorker
      5. Prollyfills in Action: Web Components
      6. Strategies for Polyfilling Experimental APIs
    2. 7. Building Your First Prollyfill
      1. Prollyfills vs. Polyfills: What’s the Difference?
      2. The Resource Priorities Prollyfill
      3. Specifying the API and Deciding What to Build
      4. Setting Up Your Prollyfill Project
      5. Adding Prollyfill Features
      6. What’s Next?
  6. About the Author
  7. Colophon
  8. Special Upgrade Offer
  9. Copyright
O'Reilly logo

Chapter 7. Building Your First Prollyfill

In Chapters 3 through 5, I walked you through the exercise of building a polyfill for the HTML5 Forms spec. Over the course of those three chapters, we talked about how to make a plan for building a polyfill, how to go about initial development, how to configure your library for automated and cross-browser testing, and finally, how to build your polyfill for performance.

In Chapter 6, I introduced the concept of the prollyfill and walked through several examples of popular prollyfilling libraries. In this chapter, we’re going to build on that knowledge, along with what we learned earlier in the book, and build our own prollyfill to test out an experimental web platform feature. Along the way, you’ll learn the ways that building polyfills and prollyfills are similar, and the ways they differ.

Prollyfills vs. Polyfills: What’s the Difference?

Prollyfills, as we discussed in Chapter 6, are quite similar to polyfills in many ways, the biggest difference being that they often target proposals or specifications with in-flux APIs. Sometimes they even target untested or unspecified ideas altogether. In both cases, much of the ideas that surround the prollyfill, including the API, are expected to change greatly as the idea is debated, tested, and possibly accepted for standardization.

In addition, the purpose of building a prollyfill differs from that of a polyfill. Polyfills are typically built to allow developers to rely on new features and APIs across ...

The best content for your career. Discover unlimited learning on demand for around $1/day.