Skip to content

Commit

Permalink
Update docs website, bump to 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewhiteley committed Jun 1, 2023
1 parent ec0d74e commit cde27e5
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dist/taxi.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.modern.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.modern.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.umd.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ E.on('DOMContentLoaded', window, function () {
fetch('https://api.github.com/repos/craftedbygc/taxi')
.then((response) => response.json())
.then((data) => {
starcount.innerHTML = convertStars(data.stargazers_count)
if (!data.message) {
starcount.innerHTML = convertStars(data.stargazers_count)
}
})
.catch((error) => {
console.error('Error:', error);
Expand Down
5 changes: 5 additions & 0 deletions docs/how-to-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ Default behaviour is to cache the contents of a URL after fetching it to make re
If you want default behaviour, but wish to force certain pages to always be fetched (and never loaded from cache), you can add the `data-taxi-nocache` attribute to the `data-taxi-view` element on that page.


### enablePrefetch `boolean`
Default behaviour is to preload links on your website whenever the `mouseenter` or `focus` event is triggered.

If you want to disable this or want to implement your own preloading strategy, set this to `false`.

### reloadJsFilter `bool|function(element: HTMLElement)`
Please see [Reloading JS]({{ global.url }}/reloading-js/) for more information.

Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@unseenco/taxi",
"description": "A modern page transition library which supports routing, preloading, and additional script reloading.",
"version": "1.2.2",
"version": "1.3.0",
"license": "GPL-3.0-or-later",
"source": "src/taxi.js",
"main": "src/taxi.js",
Expand All @@ -25,7 +25,7 @@
}
],
"dependencies": {
"@unseenco/e": "^2.2.1"
"@unseenco/e": "^2.3.0"
},
"devDependencies": {
"@11ty/eleventy": "^1.0.1",
Expand Down
17 changes: 15 additions & 2 deletions src/Core.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @typedef CacheEntry
* @type {object}
* @property {typeof Renderer} renderer
* @property {typeof Renderer|Renderer} renderer
* @property {Document|Node} page
* @property {array} scripts
* @property {boolean} skipCache
Expand All @@ -15,6 +15,7 @@ export default class Core {
* removeOldContent?: boolean,
* allowInterruption?: boolean,
* bypassCache?: boolean,
* enablePrefetch?: boolean,
* renderers?: Object.<string, typeof Renderer>,
* transitions?: Object.<string, typeof Transition>,
* reloadJsFilter?: boolean|function(HTMLElement): boolean
Expand All @@ -25,6 +26,7 @@ export default class Core {
removeOldContent?: boolean;
allowInterruption?: boolean;
bypassCache?: boolean;
enablePrefetch?: boolean;
renderers?: {
[x: string]: typeof Renderer;
};
Expand All @@ -42,6 +44,11 @@ export default class Core {
* @type {Map<string, CacheEntry>}
*/
cache: Map<string, CacheEntry>;
/**
* @private
* @type {Map<string, Promise>}
*/
private activePromises;
renderers: {
[x: string]: typeof Renderer;
};
Expand All @@ -55,6 +62,7 @@ export default class Core {
removeOldContent: boolean;
allowInterruption: boolean;
bypassCache: boolean;
enablePrefetch: boolean;
isPopping: boolean;
currentLocation: {
raw: string;
Expand Down Expand Up @@ -168,6 +176,11 @@ export default class Core {
* @return {void|boolean}
*/
private onPopstate;
/**
* @private
* @param {MouseEvent} e
*/
private onPrefetch;
/**
* @private
* @param {string} url
Expand All @@ -189,7 +202,7 @@ export default class Core {
private createCacheEntry;
}
export type CacheEntry = {
renderer: typeof Renderer;
renderer: typeof Renderer | Renderer;
page: Document | Node;
scripts: any[];
skipCache: boolean;
Expand Down

0 comments on commit cde27e5

Please sign in to comment.