Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

phoenix_live_view

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phoenix_live_view - npm Package Versions

1
12

0.14.0

Diff

Changelog

Source

0.14.0 (2020-07-07)

Bug fixes

  • Fix IE11 issue where document.activeElement creates a null reference
  • Fix setup and teardown of root views when explicitly calling liveSocket.disconnect() followed by liveSocket.connect()
  • Fix error_tag failing to be displayed for non-text based inputs such as selects and checkboxes as the phx-no-feedback class was always applied
  • Fix phx-error class being applied on live_redirect
  • Properly handle Elixir's special variables, such as __MODULE__
  • No longer set disconnected class during patch
  • Track flash keys to fix back-to-back flashes from being discarded
  • Properly handle empty component diffs in the client for cases where the component has already been removed on the server
  • Make sure components in nested live views do not conflict
  • Fix phx-static not being sent from the client for child views
  • Do not fail when trying to delete a view that was already deleted
  • Ensure beforeDestroy is called on hooks in children of a removed element

Enhancements

  • Allow the whole component static subtree to be shared when the component already exists on the client
  • Add telemetry events to mount, handle_params, and handle_event
  • Add push_event for pushing events and data from the server to the client
  • Add client handleEvent hook method for receiving events pushed from the server
  • Add ability to receive a reply to a pushEvent from the server via {:reply, map, socket}
  • Use event listener for popstate to avoid conflicting with user-defined popstate handlers
  • Log error on client when rendering a component with no direct DOM children
  • Make assigns.myself a struct to catch mistakes
  • Log if component doesn't exist on send_update, raise if module is unavailable
chrismccord
published 0.13.3 •

Changelog

Source

0.13.3 (2020-06-04)

Bug fixes

  • Fix duplicate debounced events from being triggered on blur with timed debounce
  • Fix client error when live_redirected route results in a redirect to a non-live route on the server
  • Fix DOM siblings being removed when a rootless component is updated
  • Fix debounced input failing to send last change when blurred via Tab, Meta, or other non-printable keys

Enhancements

  • Add dom option to LiveSocket with onBeforeElUpdated callback for external client library support of broad DOM operations
chrismccord
published 0.13.2 •

Changelog

Source

0.13.2 (2020-05-27)

Bug fixes

  • Fix a bug where swapping a root template with components would cause the LiveView to crash
chrismccord
published 0.13.1 •

Changelog

Source

0.13.1 (2020-05-26)

Bug fixes

  • Fix forced page refresh when push_redirect from a live_redirect

Enhancements

  • Optimize component diffs to avoid sending empty diffs
  • Optimize components to share static values
  • [LiveViewTest] Automatically synchronize before render events
chrismccord
published 0.12.1 •

Changelog

Source

0.12.1 (2020-04-19)

Bug fixes

  • Fix component innerHTML being discarded when a sibling DOM element appears above it, in cases where the component lacks a DOM ID
  • Fix Firefox reconnecting briefly during hard redirects
  • Fix phx-disable-with and other pending attributes failing to be restored when an empty patch is returned by server
  • Ensure LiveView module is loaded before mount to prevent first application request logging errors if the very first request is to a connected LiveView
chrismccord
published 0.12.0 •

Changelog

Source

0.12.0 (2020-04-16)

This version of LiveView comes with an overhaul of the testing module, more closely integrating your LiveView template with your LiveView events. For example, in previous versions, you could write this test:

render_click(live_view, "increment_by", %{by: 1})

However, there is no guarantee that there is any element on the page with a phx-click="increment" attribute and phx-value-by set to 1. With LiveView 0.12.0, you can now write:

live_view
|> element("#term .buttons a", "Increment")
|> render_click()

The new implementation will check there is a button at #term .buttons a, with "Increment" as text, validate that it has a phx-click attribute and automatically submit to it with all relevant phx-value entries. This brings us closer to integration/acceptance test frameworks without any of the overhead and complexities of running a headless browser.

Enhancements

  • Add assert_patch/3 and assert_patched/2 for asserting on patches
  • Add follow_redirect/3 to automatically follow redirects from render_* events
  • Add phx-trigger-action form annotation to trigger an HTTP form submit on next DOM patch

Bug fixes

  • Fix phx-target @myself targeting a sibling LiveView component with the same component ID
  • Fix phx:page-loading-stop firing before the DOM patch has been performed
  • Fix phx-update="prepend" failing to properly patch the DOM when the same ID is updated back to back
  • Fix redirects on mount failing to copy flash

Backwards incompatible changes

  • phx-error-for has been removed in favor of phx-feedback-for. phx-feedback-for will set a phx-no-feedback class whenever feedback has to be hidden

  • Phoenix.LiveViewTest.children/1 has been renamed to Phoenix.LiveViewTest.live_children/1

  • Phoenix.LiveViewTest.find_child/2 has been renamed to Phoenix.LiveViewTest.find_live_child/2

  • Phoenix.LiveViewTest.assert_redirect/3 no longer matches on the flash, instead it returns the flash

  • Phoenix.LiveViewTest.assert_redirect/3 no longer matches on the patch redirects, use assert_patch/3 instead

  • Phoenix.LiveViewTest.assert_remove/3 has been removed. If the LiveView crashes, it will cause the test to crash too

  • Passing a path with DOM IDs to render_* test functions is deprecated. Furthermore, they now require a phx-target="<%= @id %>" on the given DOM ID:

    <div id="component-id" phx-target="component-id">
      ...
    </div>
    
    html = render_submit([view, "#component-id"], event, value)
    

    In any case, this API is deprecated and you should migrate to the new element based API.

chrismccord
published 0.11.1 •

Changelog

Source

0.11.1 (2020-04-08)

Bug fixes

  • Fix readonly states failing to be undone after an empty diff
  • Fix dynamically added child failing to be joined by the client
  • Fix teardown bug causing stale client sessions to attempt a rejoin on reconnect
  • Fix orphaned prepend/append content across joins
  • Track unless in LiveEEx engine

Backwards incompatible changes

  • render_event/render_click and friends now expect a DOM ID selector to be given when working with components. For example, instead of render_click([live, "user-13"]), you should write render_click([live, "#user-13"]), mirroring the phx-target API.
  • Accessing the socket assigns directly @socket.assigns[...] in a template will now raise the exception Phoenix.LiveView.Socket.AssignsNotInSocket. The socket assigns are available directly inside the template as LiveEEx assigns, such as @foo and @bar. Any assign access should be done using the assigns in the template where proper change tracking takes place.

Enhancements

  • Trigger debounced events immediately on input blur
  • Support defaults option on LiveSocket constructor to configure default phx-debounce and phx-throttle values, allowing <input ... phx-debounce>
  • Add detail key to click event metadata for detecting double/triple clicks
chrismccord
published 0.11.0 •

Changelog

Source

0.11.0 (2020-04-06)

Backwards incompatible changes

  • Remove socket.assigns during render to avoid change tracking bugs. If you were previously relying on passing @socket to functions then referencing socket assigns, pass the explicit assign instead to your functions from the template.

  • Removed assets/css/live_view.css. If you want to show a progress bar then in app.css, replace

    - @import "../../../../deps/phoenix_live_view/assets/css/live_view.css";
    + @import "../node_modules/nprogress/nprogress.css";
    

    and add nprogress to assets/package.json. Full details in the Progress animation guide

Bug fixes

  • Fix client issue with greater than two levels of LiveView nesting
  • Fix bug causing entire LiveView to be re-rendering with only a component changed
  • Fix issue where rejoins would not trigger phx:page-loading-stop

Enhancements

  • Support deep change tracking so @foo.bar only executes and diffs when bar changes
  • Add @myself assign, to allow components to target themselves instead of relying on a DOM ID, for example: phx-target="<%= @myself %>"
  • Optimize various client rendering scenarios for faster DOM patching of components and append/prepended content
  • Add enableProfiling() and disableProfiling() to LiveSocket for client performance profiling to aid the development process
  • Allow LiveViews to be rendered inside LiveComponents
  • Add support for clearing flash inside components
chrismccord
published 0.10.0 •

Changelog

Source

0.10.0 (2020-03-18)

Backwards incompatible changes

  • Rename socket assign @live_view_module to @live_module
  • Rename socket assign @live_view_action to @live_action
  • LiveView no longer uses the default app layout and put_live_layout is no longer supported. Instead, use put_root_layout. Note, however, that the layout given to put_root_layout must use @inner_content instead of <%= render(@view_module, @view_template, assigns) %> and that the root layout will also be used by regular views. Check the Live Layouts section of the docs.

Bug fixes

  • Fix loading states causing nested LiveViews to be removed during live navigation
  • Only trigger phx-update="ignore" hook if data attributes have changed
  • Fix LiveEEx fingerprint bug causing no diff to be sent in certain cases

Enhancements

  • Support collocated templates where an .html.leex template of the same basename of the LiveView will be automatically used for render/1
  • Add live_title_tag/2 helper for automatic prefix/suffix on @page_title updates
chrismccord
published 0.9.0 •

Changelog

Source

0.9.0 (2020-03-08)

Bug fixes

  • Do not set ignored inputs and buttons as readonly
  • Only decode paths in URIs
  • Only destroy main descendents when replacing main
  • Fix sibling component patches when siblings at same root DOM tree
  • Do not pick the layout from :use on child LiveViews
  • Respect when the layout is set to false in the router and on mount
  • Fix sibling component patch when component siblings lack a container
  • Make flash optional (i.e. LiveView will still work if you don't fetch_flash before)

Enhancements

  • Raise if :flash is given as an assign
  • Support user-defined metadata in router
  • Allow the router to be accessed as socket.router
  • Allow MFArgs as the :session option in the live router macro
  • Trigger page loading event when main LV errors
  • Automatically clear the flash on live navigation examples - only the newly assigned flash is persisted
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc