{"repo":"thoughtbot/props_template","free":true,"listed":false,"github":"https://github.com/thoughtbot/props_template","clone":"git clone https://github.com/thoughtbot/props_template.git","description":"A very fast json builder for Rails","language":"Ruby","stars":200,"topics":["erb","jbuilder","json","rails","react","superglue"],"license":"MIT","category":"ui-components","readme_excerpt":"PropsTemplate PropsTemplate is a direct-to-Oj, JBuilder-like DSL for building JSON. It has support for Russian-Doll caching, layouts, and can be queried by giving the root a key path. It's fast. PropsTemplate bypasses the steps of hash building and serializing that other libraries perform by using Oj's StringWriter in rails mode. It's really fast. props template is second only to panko while being feature packed. The Props::Base class that be used standalone is the fastest among all JSON serializers. Results derived from alba benchmarks. Caching is fast too. While other libraries spend time unmarshaling, merging hashes, and serializing to JSON; PropsTemplate simply takes the cached string and uses Oj's push json. Example: PropsTemplate is very similar to JBuilder, and selectively retains some conveniences and magic. Installation and run bundle . Optionally add the core ext to an initializer if you want to dig into your templates. And create a file in your app/views folder like so: You can also add a layout. API json.set! or json.\\ Defines the attribute or structure. All keys are not formatted by default. See Change Key Format to change this behavior. The inline form defines key and value Parameter Notes :--- :--- key A json object key value A value or an [options][#options] object enabled with partial The block form defines key and structure Parameter Notes :--- :--- key A json object key options Additional hash options or a options object block Additional json.set! s or json","default_branch":null,"files":null,"tree":[],"storefront":"/r/thoughtbot","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/thoughtbot/props_template/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}