debugbar 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -3
- data/app/controllers/debugbar/polling_controller.rb +4 -0
- data/app/helpers/debugbar/tag_helpers.rb +4 -2
- data/build_extension.sh +8 -0
- data/config/routes.rb +2 -0
- data/debugbar.gemspec +2 -0
- data/lib/debugbar/buffers/cache_buffer.rb +4 -0
- data/lib/debugbar/buffers/memory_buffer.rb +4 -0
- data/lib/debugbar/buffers/null_buffer.rb +4 -0
- data/lib/debugbar/buffers/request_buffer.rb +4 -0
- data/lib/debugbar/engine.rb +30 -4
- data/lib/debugbar/middlewares/track_current_request.rb +5 -2
- data/lib/debugbar/version.rb +1 -1
- data/public/debugbar.js +50 -24
- metadata +4 -7
- data/build_client.sh +0 -8
- data/build_demo.sh +0 -18
- data/build_fixtures.rb +0 -32
- data/build_gem.sh +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5baf46392ef6971651278629311c31ce702eff3c07cf85f1e46a0975f9535474
|
4
|
+
data.tar.gz: fce99f252cd68cfbd6d81b87276c6f3a0218371aa6069a6007a7def71b674769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f5f1f3108f0c6f5d2d5140f23c61aac35e79ba4e233d4c4c83978bd19b3e0b48acbe5d53b9dbf768d6e757e96ae8347101e128cc0a3dea513300f9967f70d82
|
7
|
+
data.tar.gz: ef27aa4a78e8f398ef2c8dc3bf30f5437b911f18913a0653b3b654e2e343854f052e374123fea5e478239f438c3b431c57ac7cd07d86069e223dec4d169695b1
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,27 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## v0.4.3 - 2025-02-04
|
4
4
|
|
5
|
-
*
|
5
|
+
* Small fixes - See [#54](https://github.com/julienbourdeau/debugbar/issues/54) and [#56](https://github.com/julienbourdeau/debugbar/issues/56)
|
6
6
|
|
7
|
+
## v0.4.2 - 2025-01-11
|
8
|
+
|
9
|
+
* Mount `Debugbar::Engine` automatically from the gem to simplify setup - See [#51](https://github.com/julienbourdeau/debugbar/pull/51)
|
10
|
+
* Fix error if ActiveCable is not available - See [#53](https://github.com/julienbourdeau/debugbar/pull/53)
|
11
|
+
|
12
|
+
### Attention needed
|
13
|
+
|
14
|
+
It's not breaking (yet) but if you have the following block in your `config/routes.rb`, please remove it!
|
15
|
+
|
16
|
+
```diff
|
17
|
+
- if defined? Debugbar
|
18
|
+
- mount Debugbar::Engine => Debugbar.config.prefix
|
19
|
+
- end
|
20
|
+
```
|
21
|
+
|
22
|
+
## v0.4.1 - 2025-01-07
|
23
|
+
|
24
|
+
* Small fix when response is not set ([2227f4d7](https://github.com/julienbourdeau/debugbar/commit/2227f4d7e5d97ddb4b55cabd779d2bf46f9edf33))
|
7
25
|
|
8
26
|
## v0.4.0 - 2025-01-07
|
9
27
|
|
@@ -42,7 +60,7 @@
|
|
42
60
|
In order to support Turbo Drive, I had to split the helper into two parts. Before the JavaScript file was loaded,
|
43
61
|
directly in the body, but it has to be loaded in the head now.
|
44
62
|
|
45
|
-
If you were passing
|
63
|
+
If you were passing configuration t `debugbar_javascript`, you must now pass it to `debugbar_body`.
|
46
64
|
|
47
65
|
```diff
|
48
66
|
<!DOCTYPE html>
|
@@ -1,8 +1,10 @@
|
|
1
1
|
module Debugbar::TagHelpers
|
2
2
|
def debugbar_head
|
3
|
-
|
3
|
+
html = <<-HTML
|
4
4
|
<script defer src="#{Debugbar.config.prefix}/assets/script"></script>
|
5
5
|
HTML
|
6
|
+
|
7
|
+
Debugbar.config.enabled? ? raw(html) : ""
|
6
8
|
end
|
7
9
|
|
8
10
|
def debugbar_body(opt = {})
|
@@ -27,7 +29,7 @@ module Debugbar::TagHelpers
|
|
27
29
|
</script>
|
28
30
|
HTML
|
29
31
|
|
30
|
-
raw
|
32
|
+
Debugbar.config.enabled? ? raw(html) : ""
|
31
33
|
end
|
32
34
|
|
33
35
|
def debugbar_javascript(opt = {})
|
data/build_extension.sh
ADDED
data/config/routes.rb
CHANGED
data/debugbar.gemspec
CHANGED
@@ -24,6 +24,8 @@ Gem::Specification.new do |spec|
|
|
24
24
|
bin/ test/ spec/ features/ fixtures/
|
25
25
|
client/
|
26
26
|
.git .circleci appveyor Gemfile package.json package-lock.json .prettierrc
|
27
|
+
release.sh build_client.sh build_demo.sh build_fixtures.rb build_gem.sh
|
28
|
+
extension.zip
|
27
29
|
]
|
28
30
|
|
29
31
|
spec.files = Dir.chdir(__dir__) do
|
data/lib/debugbar/engine.rb
CHANGED
@@ -17,9 +17,14 @@ module Debugbar
|
|
17
17
|
end
|
18
18
|
|
19
19
|
initializer 'debugbar.override_config' do |app|
|
20
|
-
|
21
|
-
app.config.action_cable.
|
22
|
-
|
20
|
+
if defined? ActionCable
|
21
|
+
next if app.config.action_cable.allowed_request_origins.is_a?(Array) && app.config.action_cable.allowed_request_origins.any?
|
22
|
+
next if app.config.action_cable.allowed_request_origins.is_a?(Regexp)
|
23
|
+
|
24
|
+
unless app.config.action_cable.disable_request_forgery_protection
|
25
|
+
app.config.action_cable.disable_request_forgery_protection = true
|
26
|
+
log "Debugbar: Action Cable request forgery protection is enabled. This can cause issues with Debugbar. Overriding setting config.action_cable.disable_request_forgery_protection = true now. Update your configuration to get rid of this message."
|
27
|
+
end
|
23
28
|
end
|
24
29
|
|
25
30
|
if defined? HttpLog
|
@@ -47,7 +52,7 @@ module Debugbar
|
|
47
52
|
initializer 'debugbar.init' do |app|
|
48
53
|
# Display error message if running in multi-process mode without proper configuration
|
49
54
|
if ENV["WEB_CONCURRENCY"].to_i > 1
|
50
|
-
cache_nok = %i[null_store memory_store].include?(Rails.configuration.cache_store.
|
55
|
+
cache_nok = %i[null_store memory_store].include?(Rails.configuration.cache_store.to_sym)
|
51
56
|
action_cable_nok = ActionCable.server.config.cable[:adapter].to_s == "async"
|
52
57
|
adapter_nok = app.config.debugbar.buffer_adapter != :cache
|
53
58
|
|
@@ -84,6 +89,27 @@ module Debugbar
|
|
84
89
|
Debugbar::RequestBuffer.init(adapter)
|
85
90
|
end
|
86
91
|
|
92
|
+
initializer "debugbar.append_routes" do |app|
|
93
|
+
# Before 0.5.0, I asked people to mount the engine manually
|
94
|
+
# This will probably throw an error at some point to be ultimately removed
|
95
|
+
app.routes.append do
|
96
|
+
already_mounted = app.routes.routes.any? do |route|
|
97
|
+
route&.app&.app == ::Debugbar::Engine
|
98
|
+
end
|
99
|
+
|
100
|
+
if already_mounted
|
101
|
+
logger = Logger.new(STDOUT)
|
102
|
+
logger.warn 'Debugbar: The Debugbar engine is manually mounted in your `config/routes.rb`. The engine is now mounted automatically by the gem. Remove "mount Debugbar::Engine => Debugbar.config.prefix" from your routes to get rid of this message.'
|
103
|
+
|
104
|
+
unless Debugbar.config.enabled?
|
105
|
+
logger.warn "Debugbar: The Debugbar is disabled but the routes are loaded because the Debugbar::Engine is mounted manually in your `config/routes.rb`. It's recommended not to mount the engine manually since Debugbar 0.5.0"
|
106
|
+
end
|
107
|
+
else
|
108
|
+
mount Debugbar::Engine => Debugbar.config.prefix
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
87
113
|
initializer 'debugbar.helper' do
|
88
114
|
ActiveSupport.on_load(:action_controller) do
|
89
115
|
ActionController::Base.helper(Debugbar::TagHelpers)
|
@@ -12,7 +12,8 @@ module Debugbar
|
|
12
12
|
|
13
13
|
return @app.call(env) if Debugbar::Current.ignore?
|
14
14
|
|
15
|
-
|
15
|
+
req_id = SecureRandom.uuid
|
16
|
+
Debugbar::Current.new_request!(req_id)
|
16
17
|
|
17
18
|
status, headers, body = @app.call(env)
|
18
19
|
|
@@ -29,7 +30,9 @@ module Debugbar
|
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
32
|
-
|
33
|
+
# We can't use Rails.application.url_helper here because 1. we have to set up manually the hosts, 2. the route I
|
34
|
+
# want is inside the engine routes and I didn't manage to access them via the helper
|
35
|
+
headers["X-Debugbar-Url"] = "#{ActionDispatch::Request.new(env).base_url}#{Debugbar.config.prefix}/get/#{req_id}"
|
33
36
|
|
34
37
|
[status, headers, body]
|
35
38
|
end
|
data/lib/debugbar/version.rb
CHANGED