phoenixframework / phoenix_live_view

Rich, real-time user experiences with server-rendered HTML
https://hex.pm/packages/phoenix_live_view
MIT License
6.12k stars 917 forks source link

Deprecation warnings in Floki 0.24.0 cause warnings in phoenix_live_view/test #558

Closed sparta-developers closed 4 years ago

sparta-developers commented 4 years ago

Floki just released a new version, which deprecates Floki.parse in favor of parse_document and parse_fragment, and deprecates the use of Floki.find on un-parsed binaries.

This has the effect of flooding our console with deprecation warnings from inside of our live view tests.

warning: deprecation: parse the HTML with parse_document or parse_fragment before using find/2
  (floki) lib/floki.ex:170: Floki.find/2
  (phoenix_live_view) lib/phoenix_live_view/test/dom.ex:162: Phoenix.LiveViewTest.DOM.patch_id/3
  (phoenix_live_view) lib/phoenix_live_view/test/client_proxy.ex:353: Phoenix.LiveViewTest.ClientProxy.patch_view/3
  (phoenix_live_view) lib/phoenix_live_view/test/client_proxy.ex:433: Phoenix.LiveViewTest.ClientProxy.merge_rendered/3
  (phoenix_live_view) lib/phoenix_live_view/test/client_proxy.ex:412: Phoenix.LiveViewTest.ClientProxy.render_reply/3
  (phoenix_live_view) lib/phoenix_live_view/test/client_proxy.ex:219: Phoenix.LiveViewTest.ClientProxy.handle_info/2
  (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
  (stdlib) gen_server.erl:711: :gen_server.handle_msg/6
  (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
josevalim commented 4 years ago

Hi @sparta-developers! Can you please send a PR that bumps the minimum floki requirement and fixes the warnings? Thank you!

josevalim commented 4 years ago

I am on this.

josevalim commented 4 years ago

Fixed in master!

sparta-developers commented 4 years ago

Thanks! Just saw your message from yesterday.

The committed changes look a lot more elegant than what we were going to do, so I'm happy that you got to it before we did :smile:.