Skip to content

Commit 15a9165

Browse files
authored
Chore: v0.2.0 preparation (#356)
* Added new `What's next?` section to readme * Removed experimental feature flags * Updated config * Added highlighting to config * Changed format of config * Updated version * Updated feature list * Updated docs with new features * Refactored README * Fixed filters button * Update version
1 parent 2c64fc9 commit 15a9165

9 files changed

Lines changed: 76 additions & 62 deletions

File tree

README.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div align="center">
44

5-
[![Version Badge](https://img.shields.io/badge/version-v0.1.7-%23b5e1f1)](https://hexdocs.pm/live_debugger)
5+
[![Version Badge](https://img.shields.io/badge/version-v0.2.0-%23b5e1f1)](https://hexdocs.pm/live_debugger)
66
[![Hex.pm Downloads](https://img.shields.io/hexpm/dw/live_debugger?style=flat&label=downloads&color=%23b5e1f1)](https://hex.pm/packages/live_debugger)
77
[![GitHub License](https://img.shields.io/github/license/software-mansion/live-debugger?color=%23b5e1f1)](https://github.com/software-mansion/live-debugger/blob/main/LICENSE)
88

@@ -14,7 +14,8 @@ Designed to enhance your development experience LiveDebugger gives you:
1414

1515
- :deciduous_tree: A detailed view of your LiveComponents tree
1616
- :mag: The ability to inspect assigns for LiveViews and LiveComponents
17-
- :link: Tracing of their callback executions
17+
- :link: Tracing and filtering of their callback executions
18+
- :flashlight: Components highlighting
1819

1920
https://github.com/user-attachments/assets/a09d440c-4217-4597-b30e-f8b911a9094a
2021

@@ -30,7 +31,7 @@ Add `live_debugger` to your list of dependencies in `mix.exs`:
3031
```elixir
3132
defp deps do
3233
[
33-
{:live_debugger, "~> 0.1.7", only: :dev}
34+
{:live_debugger, "~> 0.2.0", only: :dev}
3435
]
3536
end
3637
```
@@ -55,6 +56,16 @@ LiveDebugger has [Igniter](https://github.com/ash-project/igniter) support - an
5556
mix igniter.install live_debugger
5657
```
5758

59+
### DevTools extension
60+
61+
Since version v0.2.0 you can install official LiveDebugger DevTools extension, giving you the ability to interact with its features alongside your application's runtime.
62+
63+
- [Chrome extension](https://chromewebstore.google.com/detail/gmdfnfcigbfkmghbjeelmbkbiglbmbpe?utm_source=item-share-cb)
64+
- Firefox extension - coming soon!
65+
66+
> [!NOTE]
67+
> Ensure the main LiveDebugger dependency is added to your mix project, as the browser plugin alone is not enough.
68+
5869
## Optional configuration
5970

6071
### Browser features
@@ -65,10 +76,13 @@ Some features require injecting JS into the debugged application. They are enabl
6576
# config/dev.exs
6677

6778
# Disables all browser features and does not inject LiveDebugger JS
68-
config :live_debugger, browser_features?: false
79+
config :live_debugger, :browser_features?, false
6980

7081
# Disables only debug button
71-
config :live_debugger, debug_button?: false
82+
config :live_debugger, :debug_button?, false
83+
84+
# Disables only components highlighting
85+
config :live_debugger, :highlighting?, false
7286
```
7387

7488
### Content Security Policy
@@ -88,14 +102,20 @@ In `router.ex` of your Phoenix app, make sure your locally running Phoenix app c
88102
```elixir
89103
# config/dev.exs
90104

105+
# Allows you to disable LiveDebugger manually if needed
106+
config :live_debugger, :disabled?, true
107+
108+
# Time in ms after tracing will be initialized. Useful in case multi-nodes envs
109+
config :live_debugger, :tracing_setup_delay, 0
110+
111+
# LiveDebugger endpoint config
91112
config :live_debugger,
92113
ip: {127, 0, 0, 1}, # IP on which LiveDebugger will be hosted
93114
port: 4007, # Port on which LiveDebugger will be hosted
94-
secret_key_base: "YOUR_SECRET_KEY_BASE", # Secret key used for LiveDebuggerWeb.Endpoint
95-
signing_salt: "your_signing_salt", # Signing salt used for LiveDebuggerWeb.Endpoint
96-
adapter: Bandit.PhoenixAdapter, # Adapter used in LiveDebuggerWeb.Endpoint
115+
secret_key_base: "YOUR_SECRET_KEY_BASE", # Secret key used for LiveDebugger.Endpoint
116+
signing_salt: "your_signing_salt", # Signing salt used for LiveDebugger.Endpoint
117+
adapter: Bandit.PhoenixAdapter, # Adapter used in LiveDebugger.Endpoint
97118
server: true, # Forces LiveDebugger to start even if project is not started with the `mix phx.server`
98-
tracing_setup_delay: 0 # Time in ms after tracing will be initialized. Useful in case multi-nodes envs
99119
```
100120

101121
## Contributing
@@ -115,6 +135,10 @@ LiveReload is working both for `.ex` files and static files, but if some styles
115135
mix assets.build:dev
116136
```
117137

138+
## What's next
139+
140+
To learn about our upcoming plans and developments, please visit our [discussion page](https://github.com/software-mansion/live-debugger/discussions/355).
141+
118142
## Authors
119143

120144
LiveDebugger is created by Software Mansion.

config/config.exs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ if config_env() == :dev do
4949
]
5050

5151
config :live_debugger, LiveDebuggerWeb.Endpoint, debug_errors: true
52-
53-
config :live_debugger, experimental_features: :all
5452
end
5553

5654
if config_env() == :test do

docs/config.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ Some features require injecting JS into the debugged application. They are enabl
66
# config/dev.exs
77

88
# Disables all browser features and does not inject LiveDebugger JS
9-
config :live_debugger, browser_features?: false
9+
config :live_debugger, :browser_features?, false
1010

1111
# Disables only debug button
12-
config :live_debugger, debug_button?: false
12+
config :live_debugger, :debug_button?, false
13+
14+
# Disables only components highlighting
15+
config :live_debugger, :highlighting?, false
1316
```
1417

1518
### Content Security Policy
@@ -29,12 +32,18 @@ In `router.ex` of your Phoenix app, make sure your locally running Phoenix app c
2932
```elixir
3033
# config/dev.exs
3134

35+
# Allows you to disable LiveDebugger manually if needed
36+
config :live_debugger, :disabled?, true
37+
38+
# Time in ms after tracing will be initialized. Useful in case multi-nodes envs
39+
config :live_debugger, :tracing_setup_delay, 0
40+
41+
# LiveDebugger endpoint config
3242
config :live_debugger,
3343
ip: {127, 0, 0, 1}, # IP on which LiveDebugger will be hosted
3444
port: 4007, # Port on which LiveDebugger will be hosted
3545
secret_key_base: "YOUR_SECRET_KEY_BASE", # Secret key used for LiveDebugger.Endpoint
3646
signing_salt: "your_signing_salt", # Signing salt used for LiveDebugger.Endpoint
3747
adapter: Bandit.PhoenixAdapter, # Adapter used in LiveDebugger.Endpoint
3848
server: true, # Forces LiveDebugger to start even if project is not started with the `mix phx.server`
39-
tracing_setup_delay: 0 # Time in ms after tracing will be initialized. Useful in case multi-nodes envs
4049
```

docs/welcome.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Designed to enhance your development experience LiveDebugger gives you:
77
- A detailed view of your LiveComponents tree
88
- The ability to inspect assigns for LiveViews and LiveComponents
99
- Tracing of their callback executions
10+
- Components highlighting
1011

1112
## Installation
1213

@@ -23,7 +24,7 @@ Add `live_debugger` to your list of dependencies in `mix.exs`:
2324
```elixir
2425
defp deps do
2526
[
26-
{:live_debugger, "~> 0.1.7", only: :dev}
27+
{:live_debugger, "~> 0.2.0", only: :dev}
2728
]
2829
end
2930
```
@@ -50,6 +51,17 @@ mix igniter.install live_debugger
5051

5152
<!-- tabs-close -->
5253

54+
### DevTools extension
55+
56+
Since version v0.2.0 you can install official LiveDebugger DevTools extension, giving you the ability to interact with its features alongside your application's runtime.
57+
58+
- [Chrome extension](https://chromewebstore.google.com/detail/gmdfnfcigbfkmghbjeelmbkbiglbmbpe?utm_source=item-share-cb)
59+
- Firefox extension - coming soon!
60+
61+
> #### Note {: .info}
62+
>
63+
> Ensure the main LiveDebugger dependency is added to your mix project, as the browser plugin alone is not enough.
64+
5365
## Authors
5466

5567
LiveDebugger is created by Software Mansion.

lib/live_debugger/feature.ex

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,15 @@
11
defmodule LiveDebugger.Feature do
22
@moduledoc """
33
Feature flags for LiveDebugger.
4-
If you create a new feature, create a new function here with defined rules for enabling it.
4+
If you create a new feature that can be enabled or disabled, create a new function here with defined rules for enabling it.
55
"""
66

77
def enabled?(:highlighting) do
8-
experimental_feature_enabled?(:highlighting) and
9-
Application.get_env(:live_debugger, :browser_features?, true) and
8+
Application.get_env(:live_debugger, :browser_features?, true) and
109
Application.get_env(:live_debugger, :highlighting?, true)
1110
end
1211

13-
def enabled?(:dark_mode) do
14-
experimental_feature_enabled?(:dark_mode)
15-
end
16-
17-
def enabled?(:callback_filters) do
18-
experimental_feature_enabled?(:callback_filters)
19-
end
20-
2112
def enabled?(feature_name) do
2213
raise "Feature #{feature_name} is not allowed"
2314
end
24-
25-
defp experimental_feature_enabled?(feature_name) do
26-
case Application.get_env(:live_debugger, :experimental_features, false) do
27-
:all -> true
28-
features when is_list(features) -> Enum.member?(features, feature_name)
29-
_ -> false
30-
end
31-
end
3215
end

lib/live_debugger_web/components.ex

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -562,20 +562,18 @@ defmodule LiveDebuggerWeb.Components do
562562
<.icon name="icon-logo-text" class="h-6 w-32" />
563563
</div>
564564
<div class="flex items-center">
565-
<%= if LiveDebugger.Feature.enabled?(:dark_mode) do %>
566-
<.nav_icon
567-
id="light-mode-switch"
568-
class="dark:hidden"
569-
icon="icon-moon"
570-
phx-hook="ToggleTheme"
571-
/>
572-
<.nav_icon
573-
id="dark-mode-switch"
574-
class="hidden dark:block"
575-
icon="icon-sun"
576-
phx-hook="ToggleTheme"
577-
/>
578-
<% end %>
565+
<.nav_icon
566+
id="light-mode-switch"
567+
class="dark:hidden"
568+
icon="icon-moon"
569+
phx-hook="ToggleTheme"
570+
/>
571+
<.nav_icon
572+
id="dark-mode-switch"
573+
class="hidden dark:block"
574+
icon="icon-sun"
575+
phx-hook="ToggleTheme"
576+
/>
579577
<%= @inner_block && render_slot(@inner_block) %>
580578
</div>
581579
</div>

lib/live_debugger_web/layout.ex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ defmodule LiveDebuggerWeb.Layout do
4747
},
4848
});
4949
50-
// Disable theme detection till we finish darkmode
51-
<%= if LiveDebugger.Feature.enabled?(:dark_mode) do %>
52-
window.setTheme();
53-
<% end %>
54-
50+
window.setTheme();
5551
liveSocket.connect();
5652
5753
window.liveSocket = liveSocket;

lib/live_debugger_web/live/traces_live.ex

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ defmodule LiveDebuggerWeb.TracesLive do
9090
<Traces.refresh_button :if={not @tracing_helper.tracing_started?} />
9191
<Traces.clear_button :if={not @tracing_helper.tracing_started?} />
9292
<.live_component
93-
:if={
94-
not @tracing_helper.tracing_started? &&
95-
LiveDebugger.Feature.enabled?(:callback_filters)
96-
}
93+
:if={not @tracing_helper.tracing_started?}
9794
module={LiveDebuggerWeb.LiveComponents.LiveDropdown}
9895
id="filters-dropdown"
9996
>
@@ -140,10 +137,7 @@ defmodule LiveDebuggerWeb.TracesLive do
140137
<% end %>
141138
<% end %>
142139
</div>
143-
<div
144-
:if={LiveDebugger.Feature.enabled?(:callback_filters)}
145-
class="flex items-center justify-center mt-4"
146-
>
140+
<div class="flex items-center justify-center mt-4">
147141
<%= if @traces_continuation != :loading do %>
148142
<.button
149143
:if={not @tracing_helper.tracing_started? && @traces_continuation != :end_of_table}

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule LiveDebugger.MixProject do
22
use Mix.Project
33

4-
@version "0.1.7"
4+
@version "0.2.0-dev"
55

66
def project do
77
[

0 commit comments

Comments
 (0)