You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,25 @@ Here's an example that shows the debug annotations:
95
95
96
96
The comments can be disabled with `debug_heex_annotations` and the `data-phx-loc` attributes with `debug_attributes`.
97
97
98
+
## Granular configuration for test warnings
99
+
100
+
LiveView includes some built in checks that run on the DOM when testing. For example,
101
+
tests will raise an exception if a duplicate ID is detected. We added a new check for forms
102
+
with `phx-change` but missing `id` attribute, because without an `id`[form recovery](https://hexdocs.pm/phoenix_live_view/form-bindings.html#recovery-following-crashes-or-disconnects)
103
+
does not work. Since the severity of that check is different compared to a duplicate ID,
104
+
LiveView now allows you to configure what should happen for each check:
105
+
106
+
```elixir
107
+
config :phoenix_live_view, :test_warnings,
108
+
duplicate_id::warn, # one of :warn, :raise, :ignore
109
+
...
110
+
```
111
+
112
+
By default, a form without an ID will now emit a warning. You can opt out of this check per form
113
+
by setting `phx-ignore-missing-id` or disable it globally with the `:missing_form_id` warning option.
114
+
115
+
See the module documentation or `Phoenix.LiveViewTest` for more information.
116
+
98
117
## v1.2.0-rc.0 (Unreleased)
99
118
100
119
### Enhancements
@@ -108,6 +127,7 @@ The comments can be disabled with `debug_heex_annotations` and the `data-phx-loc
108
127
* HEEx: Allow to opt out of debug annotations for a module ([#4119](https://github.com/phoenixframework/phoenix_live_view/pull/4119))
109
128
* HEEx: warn when missing a space between attributes ([#3999](https://github.com/phoenixframework/phoenix_live_view/issues/3999))
110
129
* HTMLFormatter: Add `TagFormatter` behaviour for formatting `<style>` and `<script>` tags ([#4140](https://github.com/phoenixframework/phoenix_live_view/pull/4140))
130
+
* Add configuration option for `:test_warnings` and warn for forms without an ID by default ([#4128](https://github.com/phoenixframework/phoenix_live_view/pull/4128))
111
131
* Performance optimizations in diffing hot path (Thank you [@preciz](https://github.com/preciz)!)
0 commit comments