Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use handlebars 1.3.0 on latest master upstream #1

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
09ea110
Update version to 0.16
OmarSkalli May 27, 2014
59d899e
Merge pull request #98 from Chetane/update-version
AlexRiedler May 27, 2014
3cc92f5
Fix typo in README
OmarSkalli May 27, 2014
25a69c6
Merge pull request #99 from Chetane/update-version
AlexRiedler May 27, 2014
9e8e3f8
fixes regex matching template names
langalex Jun 19, 2014
b7f6cf9
adds handling .hbs.erb (or other extensions) files
langalex Jun 19, 2014
33df24d
Merge pull request #101 from langalex/regex_bugfix
AlexRiedler Jun 19, 2014
1dbf88f
Merge pull request #102 from langalex/erb_templates
AlexRiedler Jun 19, 2014
84a0949
step 1, refactor
AlexRiedler Sep 21, 2013
828d46e
change how sprocket registers, we need an engine
AlexRiedler Sep 21, 2013
5ef5084
Massive cleanup, chomp trailing newline.
AlexRiedler Sep 21, 2013
11a53e7
remove automatic registration of extensions, temporarily.
AlexRiedler Oct 3, 2013
32846d6
cleanup configuration, and add extension configuration
AlexRiedler Oct 3, 2013
3b6bf7f
cleanup and fix some test issues
AlexRiedler Jun 21, 2014
e73b0ca
Fix extension handling.
AlexRiedler Jun 21, 2014
29eea86
Update changelog and readme
AlexRiedler Jun 21, 2014
7c3d948
AMD Loading based on @pboling approach.
AlexRiedler Jun 22, 2014
5f61e04
Release v0.17
AlexRiedler Jun 22, 2014
6f64b56
Fix engine initialization error on rails during assets precompile, up…
AlexRiedler Jun 28, 2014
70a9e24
Allows assets to precompile properly in Ruby 1.8
blainekasten Aug 18, 2014
66386a7
Merge pull request #108 from blainekasten/master
AlexRiedler Sep 8, 2014
4950dbc
Update version to 0.17.2
AlexRiedler Sep 8, 2014
c6e981f
Update to Handlebars v2.0.0
AlexRiedler Sep 8, 2014
2b90c53
Release v0.18
AlexRiedler Sep 8, 2014
70e3bac
Add Licenses and Homepage to gemspec.
AlexRiedler Sep 8, 2014
b09f1e3
Register extension on Sprockets.
dgraham Oct 18, 2014
6fcb5fb
Extensions must begin with a period separator.
dgraham Oct 18, 2014
b4a4744
Merge pull request #112 from dgraham/rails-4.1
AlexRiedler Nov 6, 2014
59771ba
Add the handlebars asset version to the sprockets versioning path. Fi…
Feb 18, 2015
72575e2
Release v0.18.1
Feb 18, 2015
6d6f196
Update minitest to latest.
Feb 18, 2015
084ee4a
Update to handlebars v3.0.0
Feb 18, 2015
dcf3147
should be asset version.
Feb 19, 2015
4343582
fix a few things if window is not defined.
Feb 19, 2015
9497c57
Release v0.19
Feb 19, 2015
b2df60d
Fix extension handling error and refactor.
Feb 20, 2015
4871883
Release v0.19.1
Feb 20, 2015
128ee0c
Fix some issues with dependencies.
Feb 22, 2015
7d8cae4
Release v0.19.2
Feb 22, 2015
e1102a7
Add window workaround for compiler context.
Feb 23, 2015
ee873f1
Release v0.20
Feb 23, 2015
1cf5256
Release v0.20.1
Feb 25, 2015
c5306b8
Add chomp for partials
Mar 5, 2015
c9c9884
Add test for chomp. Adjust chomp to account for root level partials
Mar 6, 2015
e86b735
Merge pull request #124 from seomoz/chomp_underscore_option
AlexRiedler Mar 6, 2015
ca0a578
relax sprockets dependency
rounders May 8, 2015
0a9357a
Merge pull request #128 from rounders/master
AlexRiedler May 8, 2015
d2f1006
Release v0.20.2
May 8, 2015
4ef0ac4
Update handlebars to v4.0.2
Sep 27, 2015
3a50c94
Bump version.
Sep 27, 2015
a07cc3b
Missing requires needed for tests.
Sep 27, 2015
53443fa
Update to Handlebars v4.0.5
Nov 24, 2015
b08c93c
Sprockets 4 support
tjgrathwell Sep 23, 2015
50ebc8b
Merge pull request #135 from tjgrathwell/sprockets4
AlexRiedler Dec 19, 2015
5dc1fbe
Add Apprails for testing multiple versions.
Dec 20, 2015
b5df919
Get some multi-testing going on with tilt+sprockets versions.
Dec 20, 2015
6abfbfa
Cleanup for next release, fix issues with Sprockets 3.x, slimbars + h…
Dec 20, 2015
f717415
Handle when asset compilation is off in rails.
Dec 20, 2015
a579164
Only load if asset compilation is enabled.
Dec 20, 2015
fd29451
Fix Railties typo in gemspec
zorbash Dec 22, 2015
03cb3ed
Merge pull request #147 from Zorbash/gemspec_typo
AlexRiedler Dec 22, 2015
2001056
Release v0.23.0
Jan 26, 2016
f7779a4
Update CHANGELOG.md for v0.23.0
Jan 27, 2016
70a738c
Fixes a bug that was preventing Rails app startup
disbelief Apr 21, 2016
013c15a
Merge pull request #151 from disbelief/bugfix-engine-config-assets
AlexRiedler Aug 4, 2016
a76c885
Release 0.23.1
Aug 4, 2016
7a92daa
Remove dependency on json, multi_json
jhawthorn May 7, 2017
a303ca9
Merge pull request #158 from jhawthorn/remove_json_deps
AlexRiedler May 8, 2017
fb07330
Bump to 0.23.2
May 8, 2017
a171d6c
Update Changelog for v0.23.2.
May 8, 2017
d826c61
Update Handlebars to v4.1.0
mobilutz Feb 14, 2019
c9cd643
Merge pull request #166 from mobilutz/patch-1
AlexRiedler Feb 14, 2019
d13421b
Use v4.1.0 as grabbed from main source instead of PR.
Feb 14, 2019
4870314
Bump handlebars_assets to 0.23.3
AlexRiedler Feb 20, 2019
c913bb1
Update to 4.1.2 to fix https://www.npmjs.com/advisories/755
nickpith May 31, 2019
0b69711
Update to 4.1.2 to fix https://www.npmjs.com/advisories/755
nickpith May 31, 2019
90b0fe5
Merge pull request #168 from nickpith/patch-1
AlexRiedler Jun 1, 2019
c27bc4b
Bump handlebars_assets to 0.23.4
AlexRiedler Jun 1, 2019
8715830
Update CHANGELOG.md
AlexRiedler Jun 3, 2019
fdfeb9f
Corrected 0.23.4 version in CHANGELOG.md
SrinandanPai Jun 4, 2019
0000563
Merge pull request #170 from SrinandanPai/update_change_log
AlexRiedler Jun 5, 2019
5011aa9
Upgrade Handlebars.js to v4.3.1
AlexRiedler Sep 25, 2019
a7742a8
Bump handlebars_assets to 0.23.5
AlexRiedler Sep 25, 2019
dd35c8e
Fixed typo in README
elainefang Nov 1, 2019
7c9ac16
Upgrade Handlebars.js to v4.5.2
AlexRiedler Nov 15, 2019
d187d92
Bump handlebars_assets to 0.23.6
AlexRiedler Nov 15, 2019
1aeeb71
Upgrade Handlebars.js to v4.5.3
AlexRiedler Nov 21, 2019
2c89bb3
Bump handlebars_assets to 0.23.7
AlexRiedler Nov 21, 2019
9d86ef1
Update changelog.
AlexRiedler Nov 21, 2019
ed98741
Upgrade Handlebars.js to v4.7.3
AlexRiedler Feb 24, 2020
365bd0e
Bump handlebars_assets to 0.23.8
AlexRiedler Feb 24, 2020
a90a00f
Updating handlebars.js and handlebars.runtime.js to version 4.7.7
Mar 18, 2021
1117d94
Merge pull request #177 from klewis0555/update_handlebars_4.7.7
AlexRiedler Mar 18, 2021
0582cf9
Bump handlebars_assets to 0.23.9
AlexRiedler Mar 18, 2021
84bd95d
Update changelog for 0.23.9
AlexRiedler Mar 18, 2021
ca7ea77
Merge pull request #173 from elainefang/update_readme
AlexRiedler Mar 18, 2021
058bb86
Corrected 0.23.9 version in CHANGELOG.md
SrinandanPai Mar 25, 2021
6d5c64d
Merge pull request #178 from SrinandanPai/patch-1
AlexRiedler Apr 2, 2021
b8b042a
Bring back handlebars 1.3.0 on latest master upstream
benjaminwood Jan 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.bundle
pkg/*
Gemfile.lock
gemfiles/*.lock
15 changes: 15 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
appraise "sprockets-3" do
gem "sprockets", "3.0.0"
end

appraise "sprockets-2" do
gem "sprockets", "2.3.3"
end

appraise "tilt-2" do
gem "tilt", "2.0.1"
end

appraise "tilt-1" do
gem "tilt", "1.4.1"
end
97 changes: 97 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,100 @@
## 0.23.9 (2021-03-18)

* Update Handlebars to v4.7.7

## 0.23.8 (2019-02-24)

* Update Handlebars to v4.7.3

## 0.23.7 (2019-11-20)

* Update Handlebars to v4.5.3

## 0.23.6 (2019-11-14)

* Update Handlebars to v4.5.2

## 0.23.5 (2019-09-25)

* Update Handlebars to v4.3.1

## 0.23.4 (2019-06-03)

* Update Handlebars to v4.1.2

## 0.23.3 (2019-02-20)

* Update Handlebars to v4.1.0

## 0.23.2 (2017-05-07)

* Remove requirement for MultiJSON

## 0.23.1 (2016-08-04)

* Fixes for Issue on Boot with Rails 3 and 4

## 0.23.0 (2016-01-26)

* Fixes for Railties and certain versions of Rails
* Only load if asset compilation is enabled
* Add support for Sprockets 3.x + 4.x - @tjgrathwell

## 0.22.0 (2015-11-23)

* Update Handlebars to v4.0.5

## 0.21.0 (2015-02-24)

* Update Handlebars to v4.0.2

## 0.20.2 (2015-02-24)

* Relax Sprockets Dependencies - @rounders
* Add option to CHOMP underscores on partials - @GreyKn

## 0.20.1 (2015-02-24)

* Actually revert to native HB.js

## 0.20 (2015-02-23)

* Fix issues with window object, revert to native HB.js
* Fix extension handling bug on some versions of rails

## 0.19 (2015-02-18)

* Upgrade to Handlebars v3.0
* Re-fix the issue regarding sprockets

## 0.18.1 (2015-02-18)

* Fix issue regarding sprockets versioning of assets

## 0.18 (2014-09-08)

* Update to handlebars v2.0.0 - @AlexRiedler

## 0.17.2 (2014-09-08)

* Support for Ruby v1.8 - @blainekasten

## 0.17.1 (2014-06-28)

* Fix engine initialization error on rails during assets precompile - @AlexRiedler

## 0.17 (2014-06-22)

* Massive revamp - @AlexRiedler
* Changed how sprockets is registered - @AlexRiedler
* AMD loading - @AlexRiedler, based on @pboling changes (THANKS!)
* Fix extension being too liberal issues - @langalex

## 0.16 (2014-05-27)

* README clarification - @jithugopal
* Upgrade `handlebars` to 1.3 - @neodude

## 0.15 (2013-12-06)

* Allow use of ember and other handlebars simultaneously - @rbhitchcock
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Yea, I think so too. That is why I wrote **handlebars_assets**. Give your Handle

Using `sprockets` with Sinatra or another framework? **handlebars_assets** works outside of Rails too (as of v0.2.0)

# BREAKING CHANGES AS OF v0.17

@AlexRiedler has made some larger changes to this repository for going forward; If you have existing monkey patches they may not work, and the configuration schema has changed slightly to handle multiple extensions for the same compilation pipeline.

If you have any problems, please post an issue! I will attempt to fix ASAP

# BREAKING CHANGE AS OF v0.9.0

My pull request to allow `/` in partials was pulled into Handlebars. The hack that converted partial names to underscored paths (`shared/_time` -> `_shared_time`) is no longer necessary and has been removed. You should change all the partial references in your app when upgrading from a version prior to v0.9.0.
Expand Down Expand Up @@ -286,6 +292,7 @@ Les Hill, follow me on [Github](https://github.com/leshill) and [Twitter](https:
* Parker Selbert (@sorentwo) : README section for `multiple_frameworks`
* Francisco QV (@panchoqv) : README clarification
* Dylan Markow (@dmarkow) : README cleanup
* Peter Boling (@pboling) : AMD Loading

# Contributing

Expand Down
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require "rubygems"
require "bundler/setup"
require "bundler/gem_tasks"
require 'rake/testtask'
require "rake/testtask"

Rake::TestTask.new do |t|
t.libs << 'test'
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/rails_4_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "rails", "4.1.14"
gem "rails-sprockets", "2.3.3"

gemspec :path => "../"
8 changes: 8 additions & 0 deletions gemfiles/rails_4_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "rails", "4.2.5"
gem "rails-sprockets", "2.3.3"

gemspec :path => "../"
8 changes: 8 additions & 0 deletions gemfiles/rails_5.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "rails", "5.0.0.beta1"
gem "rails-sprockets", "3.0.0"

gemspec :path => "../"
7 changes: 7 additions & 0 deletions gemfiles/sprockets_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "sprockets", "2.3.3"

gemspec :path => "../"
7 changes: 7 additions & 0 deletions gemfiles/sprockets_3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "sprockets", "3.0.0"

gemspec :path => "../"
7 changes: 7 additions & 0 deletions gemfiles/tilt_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "tilt", "1.4.1"

gemspec :path => "../"
7 changes: 7 additions & 0 deletions gemfiles/tilt_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "tilt", "2.0.1"

gemspec :path => "../"
24 changes: 13 additions & 11 deletions handlebars_assets.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ Gem::Specification.new do |s|
s.name = "handlebars_assets"
s.version = HandlebarsAssets::VERSION
s.authors = ["Les Hill"]
s.licenses = ["MIT"]
s.email = ["[email protected]"]
s.homepage = ""
s.homepage = "https://github.com/leshill/handlebars_assets"
s.summary = "Compile Handlebars templates in the Rails asset pipeline."
s.description = "Compile Handlebars templates in the Rails asset pipeline."
s.description = "A Railties Gem to compile hbs assets"

s.rubyforge_project = "handlebars_assets"

Expand All @@ -18,14 +19,15 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_runtime_dependency "execjs", ">= 1.2.9"
s.add_runtime_dependency "tilt"
s.add_runtime_dependency "multi_json"
s.add_runtime_dependency "sprockets", ">= 2.0.3"
s.add_runtime_dependency "execjs", "~> 2.0"
s.add_runtime_dependency "tilt", ">= 1.2"
s.add_runtime_dependency "sprockets", ">= 2.0.0"

s.add_development_dependency "debugger"
s.add_development_dependency "haml"
s.add_development_dependency "rake"
s.add_development_dependency "slim"
s.add_development_dependency 'json', '~> 1.7.7'
s.add_development_dependency "minitest", '~> 5.5'
s.add_development_dependency "haml", '~> 4.0'
s.add_development_dependency "rake", '~> 10.0'
s.add_development_dependency "slim", '~> 3.0'
s.add_development_dependency "appraisal"

s.post_install_message = "Remember to rake assets:clean or rake assets:purge on update! this is required because of handlebars updates"
end
61 changes: 48 additions & 13 deletions lib/handlebars_assets.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,58 @@
require "handlebars_assets/version"
require 'handlebars_assets/version'

module HandlebarsAssets
PATH = File.expand_path("../../vendor/assets/javascripts", __FILE__)
autoload(:Config, 'handlebars_assets/config')
autoload(:Handlebars, 'handlebars_assets/handlebars')
autoload(:HandlebarsTemplate, 'handlebars_assets/handlebars_template')
autoload(:HandlebarsProcessor, 'handlebars_assets/handlebars_template')

PATH = File.expand_path('../../vendor/assets/javascripts', __FILE__)

def self.path
PATH
end

autoload(:Config, 'handlebars_assets/config')
autoload(:Handlebars, 'handlebars_assets/handlebars')
autoload(:TiltHandlebars, 'handlebars_assets/tilt_handlebars')
def self.configure
yield Config
end

def self.register_extensions(sprockets_environment)
if Gem::Version.new(Sprockets::VERSION) < Gem::Version.new('3')
Config.handlebars_extensions.each do |ext|
sprockets_environment.register_engine(ext, HandlebarsTemplate)
end
if Config.haml_enabled? && Config.haml_available?
Config.hamlbars_extensions.each do |ext|
sprockets_environment.register_engine(ext, HandlebarsTemplate)
end
end
if Config.slim_enabled? && Config.slim_available?
Config.slimbars_extensions.each do |ext|
sprockets_environment.register_engine(ext, HandlebarsTemplate)
end
end
else
sprockets_environment.register_mime_type 'text/x-handlebars-template', extensions: Config.handlebars_extensions
if Config.slim_enabled? && Config.slim_available?
sprockets_environment.register_mime_type 'text/x-handlebars-template', extensions: Config.slimbars_extensions
end
if Config.haml_enabled? && Config.haml_available?
sprockets_environment.register_mime_type 'text/x-handlebars-template', extensions: Config.hamlbars_extensions
end
sprockets_environment.register_transformer 'text/x-handlebars-template', 'application/javascript', HandlebarsProcessor
end
end

if defined?(Rails) && defined?(::Rails::Engine)
require 'handlebars_assets/engine'
else
require 'sprockets'
Sprockets.register_engine '.hbs', TiltHandlebars
Sprockets.register_engine '.handlebars', TiltHandlebars
Sprockets.register_engine('.hamlbars', TiltHandlebars) if HandlebarsAssets::Config.haml_available?
Sprockets.register_engine('.slimbars', TiltHandlebars) if HandlebarsAssets::Config.slim_available?
def self.add_to_asset_versioning(sprockets_environment)
sprockets_environment.version += "-#{HandlebarsAssets::VERSION}"
end
end

# Register the engine (which will register extension in the app)
# or ASSUME using sprockets
if defined?(Rails)
require 'handlebars_assets/engine'
else
require 'sprockets'
::HandlebarsAssets.register_extensions(Sprockets)
end
Loading