Skip to content

Commit d0d2d31

Browse files
committed
Drop vendored Trix files in favor of the action_text-trix gem
which will allow applications to bump Trix versions independently of Rails releases. Closes rails#54148
1 parent fb89f44 commit d0d2d31

File tree

9 files changed

+13
-14281
lines changed

9 files changed

+13
-14281
lines changed

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ PATH
4242
rails-html-sanitizer (~> 1.6)
4343
useragent (~> 0.16)
4444
actiontext (8.1.0.alpha)
45+
action_text-trix (~> 2.1.15)
4546
actionpack (= 8.1.0.alpha)
4647
activerecord (= 8.1.0.alpha)
4748
activestorage (= 8.1.0.alpha)
@@ -115,6 +116,8 @@ PATH
115116
GEM
116117
remote: https://rubygems.org/
117118
specs:
119+
action_text-trix (2.1.15)
120+
railties
118121
addressable (2.8.7)
119122
public_suffix (>= 2.0.2, < 7.0)
120123
amq-protocol (2.3.2)

actiontext/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
* The Trix dependency is now satisfied by a gem, `action_text-trix`, rather than vendored
2+
files. This allows applications to bump Trix versions independently of Rails
3+
releases. Effectively this also upgrades Trix to `>= 2.1.15`.
4+
5+
*Mike Dalessio*
6+
17
* Change `ActionText::RichText#embeds` assignment from `before_save` to `before_validation`
28

39
*Sean Doyle*

actiontext/Rakefile

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,4 @@ namespace :test do
2828
end
2929
end
3030

31-
task :vendor_trix do
32-
require "importmap-rails"
33-
require "importmap/packager"
34-
35-
packager = Importmap::Packager.new(vendor_path: "app/assets/javascripts")
36-
imports = packager.import("trix", from: "unpkg")
37-
imports.each do |package, url|
38-
url.gsub!("esm.min.js", "umd.js")
39-
puts %(Vendoring "#{package}" to #{packager.vendor_path}/#{package}.js via download from #{url})
40-
packager.download(package, url)
41-
42-
css_url = url.gsub("umd.js", "css")
43-
puts %(Vendoring "#{package}" to #{packager.vendor_path}/#{package}.css via download from #{css_url})
44-
45-
response = Net::HTTP.get_response(URI(css_url))
46-
if response.code == "200"
47-
File.open(Pathname.new("app/assets/stylesheets/trix.css"), "w+") do |file|
48-
file.write response.body
49-
end
50-
end
51-
end
52-
end
53-
5431
task default: :test

actiontext/actiontext.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ Gem::Specification.new do |s|
3939

4040
s.add_dependency "nokogiri", ">= 1.8.5"
4141
s.add_dependency "globalid", ">= 0.6.0"
42+
s.add_dependency "action_text-trix", "~> 2.1.15"
4243
end
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
actiontext.js linguist-generated
22
actiontext.esm.js linguist-generated
3-
trix.js linguist-vendored

0 commit comments

Comments
 (0)