Skip to content

Commit db64ba5

Browse files
authored
Merge pull request #3 from BRIXTOL/next
Next
2 parents cdd7c08 + 7ed3260 commit db64ba5

4 files changed

Lines changed: 24 additions & 17 deletions

File tree

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
#### 30/03/2021 | v0.1.2-beta.1
4+
5+
- Fix some type definitions
6+
- Update Readme to to accurate description
7+
38
#### 30/03/2021 | v0.1.1-beta.1
49

510
- Fixes Prefetch hover toggle between navigation

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@brixtol/pjax",
3-
"version": "0.1.1-beta.1",
3+
"version": "0.1.2-beta.1",
44
"private": false,
55
"description": "A modern next generation pjax solution for SSR web applications",
66
"author": "ΝΙΚΟΛΑΣ ΣΑΒΒΙΔΗΣ",

readme.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Example
8181
The first thing we want to do is make a connection with Pjax. In your JavaScript bundle, we need to initialize. Our example web application has 3 pages, the home page, about page and contact page. We are going to instruct pjax to replace the `<nav>` and `<main>` fragments on every visit and then we are going to leverage `data-pjax` attributes to replace an additional fragment when we navigate to the contact page.
8282

8383
<br>
84-
**JavaScript Bundle**
84+
<strong>JavaScript Bundle</strong>
8585
<br>
8686

8787
<!-- prettier-ignore -->
@@ -102,6 +102,7 @@ export default () => {
102102
```
103103

104104
**Home Page**
105+
105106
<br>
106107
Below we have a very basic Home Page with pjax wired up and all `<a>` elements will be intercepted and cached. SSR web application (in most cases) will only ever have a couple of fragments that change between navigation, so keeping to that logic lets begin..
107108

@@ -470,15 +471,15 @@ Example
470471

471472
<a
472473
href="*"
473-
data-pjax-replace="(['target1', 'target2'])">
474+
data-pjax-replace="(['#target1', '#target2'])">
474475
Link
475476
</a>
476477

477-
<div data-pjax-target="target1">
478+
<div id="target1">
478479
I will be replaced on next navigation
479480
</div>
480481

481-
<div data-pjax-target="target2">
482+
<div id="target2">
482483
I will be replaced on next navigation
483484
</div>
484485

@@ -505,15 +506,15 @@ Example
505506

506507
<a
507508
href="*"
508-
data-pjax-prepend="(['target-1', 'target-2'])">
509+
data-pjax-prepend="(['#target-1', '#target-2'])">
509510
Page 2
510511
</a>
511512

512-
<div data-pjax-target="target-1">
513+
<div id="target-1">
513514
I will prepend to target-2 on next navigation
514515
</div>
515516

516-
<div data-pjax-target="target-2">
517+
<div id="target-2">
517518
<p>target-1 will prepended to me on next navigation</p>
518519
</div>
519520

@@ -526,11 +527,11 @@ Example
526527

527528
<a
528529
href="*"
529-
data-pjax-prepend="(['target-1', 'target-2'])">
530+
data-pjax-prepend="(['#target-1', '#target-2'])">
530531
Page 2
531532
</a>
532533

533-
<div data-pjax-target="target-2">
534+
<div id="target-2">
534535

535536
<!-- An action reference record is applied -->
536537
<div data-pjax-action="xxxxxxx">
@@ -581,7 +582,10 @@ Example
581582
<a data-pjax-prefetch="hover" href="*"></a>
582583

583584
<!-- prefetch will begin 500ms after hover but will cancel if mouse existed before threshold -->
584-
<a data-pjax-prefetch="intersect" data-pjax-threshold="500" href="*"></a>
585+
<a data-pjax-prefetch="hover" data-pjax-threshold="500" href="*"></a>
586+
587+
<!-- Prefetch will begin once this link becomes visible in viewport -->
588+
<a data-pjax-prefetch="intersect" href="*"></a>
585589
```
586590
587591
</details>

types/index.d.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ declare module "@brixtol/pjax" {
1212
export function connect(options?: IPresets): IPage;
1313

1414
/**
15+
* **NOT YET AVAILABLE**
16+
*
1517
* Fetches state page by url. Pass `false` to clear cache
1618
*/
1719
export function cache(ref?: string | false): IPage;
@@ -23,6 +25,8 @@ declare module "@brixtol/pjax" {
2325
export function clear(url?: string): IPage;
2426

2527
/**
28+
* **NOT YET AVAILABLE**
29+
*
2630
* Reloads the current page
2731
*/
2832
export function reload(): void;
@@ -32,12 +36,6 @@ declare module "@brixtol/pjax" {
3236
*/
3337
export function uuid(size?: string): string;
3438

35-
/**
36-
* Captures current `<body>` element and upon next history visit
37-
* will use the capture as replacement.
38-
*/
39-
export function capture(url: string): string;
40-
4139
/**
4240
* Programmatic visit to location
4341
*/

0 commit comments

Comments
 (0)