Skip to content

Commit 3614cac

Browse files
authored
use ViewComponent 4.0.0.alpha6 (#3556)
1 parent 150d787 commit 3614cac

File tree

9 files changed

+31
-20
lines changed

9 files changed

+31
-20
lines changed

.changeset/angry-panthers-lay.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@primer/view-components": patch
3+
---
4+
5+
use ViewComponent 4.0.0.alpha6 and lookbook 2.3.11
6+

Gemfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ gem "puma", "~> 6.6.0"
3333
# Reduces boot times through caching; required in config/boot.rb
3434
gem "bootsnap", ">= 1.4.2", require: false
3535

36-
gem "lookbook", "~> 2.3.9"
37-
gem "view_component", path: ENV["VIEW_COMPONENT_PATH"] if ENV["VIEW_COMPONENT_PATH"]
36+
gem "lookbook", "~> 2.3.11"
37+
if ENV["VIEW_COMPONENT_PATH"]
38+
gem "view_component", path: ENV["VIEW_COMPONENT_PATH"]
39+
else
40+
gem "view_component", "4.0.0.alpha6"
41+
end
3842

3943
gem "kramdown", "~> 2.5"
4044
gem "sourcemap", "~> 0.1"

Gemfile.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ GEM
126126
loofah (2.24.1)
127127
crass (~> 1.0.2)
128128
nokogiri (>= 1.12.0)
129-
lookbook (2.3.9)
129+
lookbook (2.3.11)
130130
activemodel
131131
css_parser
132132
htmlbeautifier (~> 1.3)
@@ -282,7 +282,7 @@ GEM
282282
unicode-emoji (4.0.4)
283283
uri (1.0.3)
284284
useragent (0.16.11)
285-
view_component (4.0.0.alpha5)
285+
view_component (4.0.0.alpha6)
286286
activesupport (>= 7.1.0, < 8.1)
287287
concurrent-ruby (~> 1)
288288
vite_rails (3.0.19)
@@ -328,7 +328,7 @@ DEPENDENCIES
328328
erblint-github (~> 1.0.1)
329329
kramdown (~> 2.5)
330330
listen (~> 3.9)
331-
lookbook (~> 2.3.9)
331+
lookbook (~> 2.3.11)
332332
matrix (~> 0.4.2)
333333
mocha
334334
primer_view_components!
@@ -349,6 +349,7 @@ DEPENDENCIES
349349
sprockets-rails
350350
thor
351351
timecop
352+
view_component (= 4.0.0.alpha6)
352353
vite_rails (~> 3.0)
353354
webmock
354355
yard (~> 0.9.37)

demo/Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ gem "puma", "~> 6.6.0"
3737
gem "bootsnap", ">= 1.4.2", require: false
3838

3939
gem "primer_view_components", path: "../"
40-
gem "view_component", '>= 3.11.0'
41-
gem "lookbook", "~> 2.3.9" unless rails_version.to_f < 7
40+
gem "view_component", "4.0.0.alpha6"
41+
gem "lookbook", "~> 2.3.11" unless rails_version.to_f < 7
4242

4343
gem "vite_rails", "~> 3.0"
4444
gem "cssbundling-rails", "~> 1.4"

demo/Gemfile.lock

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ GEM
209209
loofah (2.24.1)
210210
crass (~> 1.0.2)
211211
nokogiri (>= 1.12.0)
212-
lookbook (2.3.9)
212+
lookbook (2.3.11)
213213
activemodel
214214
css_parser
215215
htmlbeautifier (~> 1.3)
@@ -346,10 +346,9 @@ GEM
346346
railties (>= 7.1.0)
347347
tzinfo (2.0.6)
348348
concurrent-ruby (~> 1.0)
349-
view_component (3.23.2)
350-
activesupport (>= 5.2.0, < 8.1)
349+
view_component (4.0.0.alpha6)
350+
activesupport (>= 7.1.0, < 8.1)
351351
concurrent-ruby (~> 1)
352-
method_source (~> 1.0)
353352
vite_rails (3.0.19)
354353
railties (>= 5.1, < 9)
355354
vite_ruby (~> 3.0, >= 3.2.2)
@@ -389,7 +388,7 @@ DEPENDENCIES
389388
kuby-core (~> 0.20)
390389
kuby-kind (~> 0.2)
391390
listen
392-
lookbook (~> 2.3.9)
391+
lookbook (~> 2.3.11)
393392
primer_view_components!
394393
pry-byebug
395394
puma (~> 6.6.0)
@@ -402,7 +401,7 @@ DEPENDENCIES
402401
sprockets-rails
403402
stimulus-rails
404403
turbo-rails
405-
view_component (>= 3.11.0)
404+
view_component (= 4.0.0.alpha6)
406405
vite_rails (~> 3.0)
407406

408407
BUNDLED WITH

demo/config/application.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ class Application < Rails::Application
3030
config.active_support.to_time_preserves_timezone = :zone
3131

3232
# Initialize configuration defaults for originally generated Rails version.
33-
config.view_component.default_preview_layout = "component_preview"
33+
config.view_component.previews.default_layout = "component_preview"
34+
config.view_component.previews.enabled = true
35+
config.view_component.previews.controller = "PreviewController"
36+
config.view_component.previews.paths << Rails.root.join("..", "previews")
3437
config.view_component.show_previews = true
35-
config.view_component.preview_controller = "PreviewController"
36-
config.view_component.preview_paths << Rails.root.join("..", "previews")
3738

3839
config.autoload_paths << Rails.root.join("..", "test", "test_helpers", "components")
3940

demo/config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@
101101
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
102102

103103
# Use a custom preview route because of how routes are configured in prod (see routes.rb)
104-
config.view_component.preview_route = "/view-components/rails-app/previews"
104+
config.view_component.previews.route = "/view-components/rails-app/previews"
105105
end

demo/config/environments/test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
config.primer_view_components.raise_on_invalid_options = true
4848

4949
config.autoload_paths << Rails.root.join("..", "test", "forms")
50-
config.view_component.preview_paths << Rails.root.join("..", "test", "previews")
50+
config.view_component.previews.paths << Rails.root.join("..", "test", "previews")
5151

5252
if ENV.fetch("VC_COMPAT_PATCH_ENABLED", "false") == "true"
5353
config.view_component.capture_compatibility_patch_enabled = true

test/performance/bench_octicons.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def setup
1717
def bench_allocations_without_cache
1818
Primer::Beta::Octicon.new(**@options)
1919
Primer::Octicon::Cache.clear!
20-
assert_allocations "3.4" => 26, "3.3" => 30, "3.2" => 30, "3.1" => 28, "3.0" => 28 do
20+
assert_allocations "3.4" => 26, "3.3" => 26, "3.2" => 26, "3.1" => 28, "3.0" => 28 do
2121
Primer::Beta::Octicon.new(**@options)
2222
end
2323
ensure
@@ -26,7 +26,7 @@ def bench_allocations_without_cache
2626

2727
def bench_allocations_with_cache
2828
Primer::Octicon::Cache.preload!
29-
assert_allocations "3.4" => 10, "3.3" => 14, "3.2" => 14, "3.1" => 11, "3.0" => 11 do
29+
assert_allocations "3.4" => 10, "3.3" => 10, "3.2" => 10, "3.1" => 11, "3.0" => 11 do
3030
Primer::Beta::Octicon.new(**@options)
3131
end
3232
end

0 commit comments

Comments
 (0)