Skip to content

Commit

Permalink
Merge branch 'remove-backbone'
Browse files Browse the repository at this point in the history
  • Loading branch information
brentd committed Sep 23, 2016
2 parents e60e4dc + c7e8241 commit e592d27
Show file tree
Hide file tree
Showing 18 changed files with 527 additions and 184 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ lesser changes or bug fixes.

* Your contribution here!

## [0.2.0][2016-09-22]

* Removed support for Backbone-rendered templates. This feature was particularly
complex and prone to failure. It will more than likely return in some form in
the future - for now, if your workflow depends on it, don't upgrade to 0.2.0.
* Removed the dependency on coffee-rails.
* Fixed deprecation warnings from Sprockets 4.

## [0.1.23][] (2016-09-22)

* Add a post-install message regarding future removal of Backbone support.
Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Xray-rails

### Reveal your UI's bones

The dev tools available to web developers in modern browsers are great. Many of us can't remember what life was like before "Inspect Element". But what we see in the compiled output sent to our browser is often the wrong level of detail - what about visualizing the higher level components of your UI? Controllers, templates, partials, Backbone views, etc.
The dev tools available to web developers in modern browsers are great. Many of us can't remember what life was like before "Inspect Element". But what we see in the compiled output sent to our browser is often the wrong level of detail - what about visualizing the higher level components of your UI? Controllers, view templates, partials, JS templates, etc.

Xray is the missing link between the browser and your app code. Press **cmd+shift+x** (Mac) or **ctrl+shift+x** to reveal an overlay of the files that rendered your UI, and click anything to open the file in your editor. [See Xray in action](http://f.cl.ly/items/1A0o3y1y3Q13103V3F1l/xray-rails-large.gif).

Expand All @@ -19,12 +19,11 @@ Xray is intended for Rails 3.1+ and Ruby 1.9+.
So far, Xray can reveal:

* Rails views and partials
* Backbone View instances if using the asset pipeline
* Javascript templates if using the asset pipeline with the .jst extension

## Installation

Xray depends on **jQuery**. Backbone is optional.
Xray depends on **jQuery**.

This gem should only be present during development. Add it to your Gemfile:

Expand All @@ -44,20 +43,15 @@ Restart your app, visit it in your browser, and press **cmd+shift+x** (Mac) or *

#### Note about `config.assets.debug`

For Xray to insert itself into your views automatically, `config.assets.debug = true` (Rails' default) must be set in development.rb. If you disabled this because of slow assets in Rails 3.2.13, [try this monkey patch instead](http://stackoverflow.com/a/15520932/24848) in an initializer.
By default, Xray will insert itself into your views automatically. To do this, `config.assets.debug = true` (Rails' default) must be set in development.rb.

Otherwise, you can insert Xray's scripts yourself, for example like so in application.js:

```js
//= require jquery
//= require xray
...
//= require backbone
//= require xray-backbone
```

Backbone support via `xray-backbone` is optional.

## Configuration

By default, Xray will check a few environment variables to determine
Expand All @@ -80,7 +74,6 @@ For something more complex, use the `$file` placeholder.
## How this works

* At run time, HTML responses from Rails are wrapped with HTML comments containing filepath info.
* Additionally, JS templates and Backbone view constructors are modified during asset compilation.
* A middleware inserts `xray.js`, `xray.css`, and the Xray bar into all successful HTML response bodies.
* When the overlay is shown, `xray.js` examines the inserted filepath info to build the overlay.

Expand Down
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ task "server" do
exec "script/server"
end

namespace :assets do
desc "Compile xray.js.coffee"
task "compile" do
exec "coffee -cp app/assets/javascripts/xray.js.coffee > app/assets/javascripts/xray.js"
end
end

desc "Run all examples"
RSpec::Core::RakeTask.new(:spec) do |t|
# TODO: uncomment this and fix warnings
Expand Down
20 changes: 0 additions & 20 deletions app/assets/javascripts/xray-backbone.js.coffee

This file was deleted.

Loading

0 comments on commit e592d27

Please sign in to comment.