Skip to content

Commit 7d5578f

Browse files
Update docs to remove mentions of phx-page-loading (#3740)
* update bindings guide * update syncing-changes guide * update view test * Update bindings.md Co-authored-by: Steffen Deusch <[email protected]> --------- Co-authored-by: Steffen Deusch <[email protected]>
1 parent 8a9c797 commit 7d5578f

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

assets/test/view_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ describe("View + Component", function(){
13311331
test("restores phx specific attributes awaiting a ref", () => {
13321332
let content = `
13331333
<span data-phx-ref-loading="1" data-phx-ref-src="root"></span>
1334-
<form phx-change="suggest" phx-submit="search" phx-page-loading="" class="phx-submit-loading" data-phx-ref-loading="38" data-phx-ref-src="root">
1334+
<form phx-change="suggest" phx-submit="search" class="phx-submit-loading" data-phx-ref-loading="38" data-phx-ref-src="root">
13351335
<input type="text" name="q" value="ddsdsd" placeholder="Live dependency search" list="results" autocomplete="off" data-phx-readonly="false" readonly="" class="phx-submit-loading" data-phx-ref-loading="38" data-phx-ref-src="root">
13361336
<datalist id="results">
13371337
</datalist>
@@ -1345,7 +1345,7 @@ describe("View + Component", function(){
13451345
view.undoRefs(1)
13461346
expect(el.innerHTML).toBe(`
13471347
<span></span>
1348-
<form phx-change="suggest" phx-submit="search" phx-page-loading="" class="phx-submit-loading" data-phx-ref-src="root" data-phx-ref-loading="38">
1348+
<form phx-change="suggest" phx-submit="search" class="phx-submit-loading" data-phx-ref-src="root" data-phx-ref-loading="38">
13491349
<input type="text" name="q" value="ddsdsd" placeholder="Live dependency search" list="results" autocomplete="off" data-phx-readonly="false" readonly="" class="phx-submit-loading" data-phx-ref-src="root" data-phx-ref-loading="38">
13501350
<datalist id="results">
13511351
</datalist>
@@ -1356,7 +1356,7 @@ describe("View + Component", function(){
13561356
view.undoRefs(38)
13571357
expect(el.innerHTML).toBe(`
13581358
<span></span>
1359-
<form phx-change="suggest" phx-submit="search" phx-page-loading="">
1359+
<form phx-change="suggest" phx-submit="search">
13601360
<input type="text" name="q" value="ddsdsd" placeholder="Live dependency search" list="results" autocomplete="off">
13611361
<datalist id="results">
13621362
</datalist>

guides/client/bindings.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,8 @@ Our `paginate_posts` function fetches a page of posts, and determines if the use
434434
<ul
435435
id="posts"
436436
phx-update="stream"
437-
phx-viewport-top={@page > 1 && "prev-page"}
438-
phx-viewport-bottom={!@end_of_timeline? && "next-page"}
439-
phx-page-loading
437+
phx-viewport-top={@page > 1 && JS.push("prev-page", page_loading: true)}
438+
phx-viewport-bottom={!@end_of_timeline? && JS.push("next-page", page_loading: true)}
440439
class={[
441440
if(@end_of_timeline?, do: "pb-10", else: "pb-[calc(200vh)]"),
442441
if(@page == 1, do: "pt-10", else: "pt-[calc(200vh)]")

guides/client/syncing-changes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ key, with a value that depends on the triggering event:
211211
- `"element"` - the event was triggered by a `phx-` bound element, such as `phx-click`
212212
- `"error"` - the event was triggered by an error, such as a view crash or socket disconnection
213213

214-
Additionally, any `phx-` event may dispatch page loading events by annotating the DOM element with the `phx-page-loading` attribute.
214+
Additionally, `Phoenix.LiveView.JS.push/3` may dispatch page loading events by passing `page_loading: true` option.
215215

216216
For all kinds of page loading events, all but `"element"` will receive an additional `to` key in the info metadata pointing to the href associated with the page load. In the case of an `"element"` page loading event, the info will contain a `"target"` key containing the DOM element which triggered the page loading state.
217217

0 commit comments

Comments
 (0)