{"id":17772555,"url":"https://github.com/jamesplease/marionette.base-view","last_synced_at":"2026-01-19T06:33:16.030Z","repository":{"id":34628320,"uuid":"38578239","full_name":"jamesplease/marionette.base-view","owner":"jamesplease","description":"A better View for Marionette.","archived":false,"fork":false,"pushed_at":"2015-08-30T21:40:01.000Z","size":233,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-14T19:59:20.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesplease.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-05T17:51:34.000Z","updated_at":"2022-01-23T07:06:20.000Z","dependencies_parsed_at":"2022-09-11T06:50:27.814Z","dependency_job_id":null,"html_url":"https://github.com/jamesplease/marionette.base-view","commit_stats":null,"previous_names":["jmeas/marionette.base-view"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jamesplease/marionette.base-view","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesplease%2Fmarionette.base-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesplease%2Fmarionette.base-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesplease%2Fmarionette.base-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesplease%2Fmarionette.base-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesplease","download_url":"https://codeload.github.com/jamesplease/marionette.base-view/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesplease%2Fmarionette.base-view/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28562405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T21:39:45.873Z","updated_at":"2026-01-19T06:33:16.015Z","avatar_url":"https://github.com/jamesplease.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# marionette.base-view\n\nA better View for Marionette.\n\n[![Travis build status](http://img.shields.io/travis/jmeas/marionette.base-view.svg?style=flat)](https://travis-ci.org/jmeas/marionette.base-view)\n[![Code Climate](https://codeclimate.com/github/jmeas/marionette.base-view/badges/gpa.svg)](https://codeclimate.com/github/jmeas/marionette.base-view)\n[![Test Coverage](https://codeclimate.com/github/jmeas/marionette.base-view/badges/coverage.svg)](https://codeclimate.com/github/jmeas/marionette.base-view)\n[![Dependency Status](https://david-dm.org/jmeas/marionette.base-view.svg)](https://david-dm.org/jmeas/marionette.base-view)\n[![devDependency Status](https://david-dm.org/jmeas/marionette.base-view/dev-status.svg)](https://david-dm.org/jmeas/marionette.base-view#info=devDependencies)\n\n### Installation\n\nThe quickest way to use this library is through npm or Bower.\n\n```sh\nbower install marionette.base-view\nnpm install marionette.base-view\n```\n\n### Motivation\n\nI made this library for two reasons:\n\n#### Too many views\n\nMarionette has too many views. In the next version of Marionette, version 3, LayoutView and ItemView will\nbe merged into the same thing, and it will simply be called `Marionette.View`. This is a good thing. The distinction\nbetween the two is that LayoutViews can have child views, whereas ItemViews can not. This is insufficient to\nwarrant having two separate constructors, I think.\n\nThis library extends from `LayoutView`, so it prepares you for Marionette v3.\n\n#### Regions\n\nI believe that Regions are an unnecessary abstraction within Marionette. By this I mean that Regions are not a thing that\ndevelopers should interact with directly. Instead, I think of them as an implementation detail that allows Marionette to\nmanage child views in a memory-safe way.\n\nIn my mind, Regions are analogous to `Backbone.sync`. Sure, it's the method what powers all of the AJAX requests within Backbone,\nbut most of the time you can (and should) ignore it and just deal with the API provided by Models and Collections. So it goes\nwith Regions.\n\nThis library provides you with some API sugar that allows you to never use regions directly.\n\n### Recommended Usage\n\nThere are two basic guidelines for using this library: one for each motive described above.\n\n1. You should use this instead of ItemViews and LayoutViews in all situations. Also, your base CollectionView and CompositeView\nprototypes should be updated to use this instead of ItemViews.\n\n2. You should never specify a `regions` hash for your views, nor should you use any method exposed by LayoutView that contains the word\n`region`.\n\n### Basic Example\n\n```js\n// Extend it like usual\nvar MyView = BaseView.extend({\n  template: myTemplate,\n\n  onShow() {\n    // Don't bother with specifying regions. Just use selectors.\n    this.showChildView('.navbar-container', new NavBar());\n\n    // Later, you could get the navbar by calling...\n    var navbar = this.getChildView('.navbar-container');\n  }\n});\n```\n\n### API\n\n#### `showChildView( selector, view )`\n\nDisplays `view` in the element matched by `selector`. Under the hood, a region for this element will be created if it does not exist.\n\n### `getChildView( selector )`\n\nReturns the `view`, if there is one, contained in the element matched by `selector`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesplease%2Fmarionette.base-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesplease%2Fmarionette.base-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesplease%2Fmarionette.base-view/lists"}