Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ end
gem "actionpack-action_caching", "~> 1.2"
gem "active_record_union", "~> 1.3"
gem "acts-as-taggable-on", "~> 5.0"
gem "acts_as_follower", github: "thepracticaldev/acts_as_follower", branch: "master"
# gem "acts_as_follower", github: "thepracticaldev/acts_as_follower", branch: "master"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пара гемов оказались не доступны - заменил на одноименные форки.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

блин, странно, мне казалось я это фиксил

gem "acts_as_follower", github: 'tcocca/acts_as_follower', branch: "master"
gem "addressable", "~> 2.5", ">= 2.5.2"
gem "administrate", "~> 0.11"
gem "ahoy_email", "~> 0.5"
Expand Down Expand Up @@ -122,7 +123,8 @@ group :development, :test do
gem "derailed", "~> 0.1"
gem "erb_lint", "~> 0.0", require: false
gem "faker", git: "https://github.com/stympy/faker.git", branch: "master"
gem "fix-db-schema-conflicts", github: "thepracticaldev/fix-db-schema-conflicts", branch: "master"
# gem "fix-db-schema-conflicts", github: "thepracticaldev/fix-db-schema-conflicts", branch: "master"
gem "fix-db-schema-conflicts", github: "jakeonrails/fix-db-schema-conflicts", branch: "master"
gem "memory_profiler", "~> 0.9"
gem "parallel_tests", "~> 2.27"
gem "pry-byebug", "~> 3.7"
Expand Down
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
GIT
remote: https://github.com/jakeonrails/fix-db-schema-conflicts.git
revision: ae9135e0bb1fb142dd483f883da0064b8be17732
branch: master
specs:
fix-db-schema-conflicts (3.1.1)
rubocop (>= 0.38.0)

GIT
remote: https://github.com/stympy/faker.git
revision: 9910aa58d92c018abab25d491191576fcc1a7707
Expand All @@ -7,21 +15,13 @@ GIT
i18n (>= 0.7)

GIT
remote: https://github.com/thepracticaldev/acts_as_follower.git
revision: 288690cd99bc470eaee493fce5bfa9fe23157692
remote: https://github.com/tcocca/acts_as_follower.git
revision: c5ac7b9601c4af01eb4d9112330b27be4d694ecc
branch: master
specs:
acts_as_follower (0.2.1)
activerecord (>= 4.0)

GIT
remote: https://github.com/thepracticaldev/fix-db-schema-conflicts.git
revision: 4172392392e1a8d907f7ab673cb5ddd9a4a31940
branch: master
specs:
fix-db-schema-conflicts (3.0.2)
rubocop (>= 0.38.0)

GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
Expand Down
9 changes: 9 additions & 0 deletions app/controllers/stories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ class StoriesController < ApplicationController
before_action :set_cache_control_headers, only: %i[index search show]

def index
push_headers = [
"<#{view_context.asset_path('bell.svg')}>; rel=preload; as=image",
"<#{view_context.asset_path('menu.svg')}>; rel=preload; as=image",
"<#{view_context.asset_path('connect.svg')}>; rel=preload; as=image",
"<#{view_context.asset_path('stack.svg')}>; rel=preload; as=image",
"<#{view_context.asset_path('lightning.svg')}>; rel=preload; as=image",
]
response.headers["Link"] = push_headers.join(", ")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌


add_param_context(:username, :tag)
return handle_user_or_organization_or_podcast_index if params[:username]
return handle_tag_index if params[:tag]
Expand Down
6 changes: 3 additions & 3 deletions app/views/articles/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<div class="on-page-nav-controls" id="on-page-nav-controls">
<div class="on-page-nav-label">
<div class="wide-nav-links">
<a class="nav-chronofiter-link <%= "selected" if ["week", "month", "year", "infinity", "latest"].exclude?(params[:timeframe]) %>" href="<%= list_path %>/">
<a class="nav-chronofiter-link <%= "selected" if %w[week month year infinity latest].exclude?(params[:timeframe]) %>" href="<%= list_path %>/">
FEED
</a>
<span class="separator"></span>
Expand Down Expand Up @@ -71,10 +71,10 @@
</div>
</div>
<button class="on-page-nav-butt on-page-nav-butt-left" id="on-page-nav-butt-left" aria-label="nav-button-left">
<img src="<%= asset_path "stack.svg" %>" alt="left-sidebar-nav">
<%= inline_svg("stack.svg", size: "100% * 100%", alt: "left-sidebar-nav") %>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preload дает эффект:
image

Ссылки на сравнение sitespeed, кажется, убрали. Поэтому кажется их придется добавить вручную, чтобы посмотреть результат: https://compare.sitespeed.io/

</button>
<button class="on-page-nav-butt on-page-nav-butt-right" id="on-page-nav-butt-right" aria-label="nav-button-right">
<img src="<%= asset_path "lightning.svg" %>" alt="right-sidebar-nav">
<%= inline_svg("lightning.svg", size: "100% * 100%", alt: "right-sidebar-nav") %>
</button>
</div>

Expand Down
1 change: 1 addition & 0 deletions sitespeed-results/after_with_inline.har
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webpage test after
https://www.webpagetest.org/result/231119_BiDcYF_8TG/

Можно заметить, что картинки отобразились криво - судя по всему, inline_svg плохо дружит с кнопками. Навскидку отрехтовать эту часть не смог, но подумал, что это вне объема нашего упражнения.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sitespeed-results/before.har

Large diffs are not rendered by default.