whatisgithub

What is view-bundle?

chamber-orchestra/view-bundle — explained in plain English

Analysis updated 2026-05-18

229PHPAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A Symfony plug-in that auto-converts PHP data objects into JSON API responses so developers stop writing repetitive serialization code by hand.

Mindmap

mindmap
  root((View Bundle))
    Problem
      Repetitive JSON code
      Manual serialization
    Solution
      Typed view classes
      Auto property mapping
      Drops null values
    Performance
      Build time precompute
      Versioned cache files
    Requirements
      PHP 8.5
      Symfony 8.0

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Define a typed PHP class as an API response template instead of hand-writing JSON conversion.

USE CASE 2

Automatically drop null values and format collections when returning API responses.

USE CASE 3

Speed up production JSON serialization using pre-computed mapping cache files.

What is it built with?

PHPSymfony

How does it compare?

chamber-orchestra/view-bundlephenaproxima/starshot-prototypephpacker/phpacker
Stars229118415
LanguagePHPPHPPHP
Setup difficultymoderatemoderateeasy
Complexity3/53/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires PHP 8.5+ and Symfony 8.0.

So what is it?

View Bundle is a plug-in for Symfony, a PHP web framework, that removes repetitive boilerplate when building JSON APIs. The specific problem it solves: every time a controller sends data back to the client, a developer normally has to manually convert internal data objects into the right JSON structure. This bundle automates that conversion. You define the shape of your API response as a typed PHP class, essentially a template describing what the JSON should look like. The bundle then automatically reads matching properties from your actual data objects, maps them into that template, drops any null values, and sends the result as a properly formatted JSON response. Collections of items are handled the same way, using a typed list view that maps each item individually. For performance in production, the bundle pre-computes all the mapping information at build time so it does not have to do the slow reflection-based lookup on every single request. This pre-computation is stored in versioned cache files that update cleanly when you deploy new code. You would reach for this if you are building a REST API in PHP with Symfony and are tired of writing the same JSON serialization plumbing in every controller. It requires PHP 8.5 or later and Symfony 8.0.

Copy-paste prompts

Prompt 1
Show me how to install View Bundle in a Symfony 8 project.
Prompt 2
Help me write a typed view class for this API response using View Bundle.
Prompt 3
Explain how View Bundle's build-time cache files work and when they need to be regenerated.

Frequently asked questions

What is view-bundle?

A Symfony plug-in that auto-converts PHP data objects into JSON API responses so developers stop writing repetitive serialization code by hand.

What language is view-bundle written in?

Mainly PHP. The stack also includes PHP, Symfony.

How hard is view-bundle to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is view-bundle for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.