All Projects → frehner → appHistory

frehner / appHistory

Licence: MIT license
A polyfill for the AppHistory proposal

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to appHistory

cardboard-vr-display
A JavaScript implementation of a WebVR 1.1 VRDisplay
Stars: ✭ 84 (+300%)
Mutual labels:  polyfill
polyfill-php81
This component provides functions unavailable in releases prior to PHP 8.1.
Stars: ✭ 618 (+2842.86%)
Mutual labels:  polyfill
webpack2-polyfill-plugin
Insert polyfills (such as Promise) for Webpack 2
Stars: ✭ 18 (-14.29%)
Mutual labels:  polyfill
css grid annotator
Automatically annotate CSS Grid items with row and column positions, so they are correctly positioned in IE11.
Stars: ✭ 59 (+180.95%)
Mutual labels:  polyfill
fetch
A fetch API polyfill for React Native with text streaming support.
Stars: ✭ 27 (+28.57%)
Mutual labels:  polyfill
symfony-tools
Collection of polyfill (backport) and incubator features for Symfony 3
Stars: ✭ 19 (-9.52%)
Mutual labels:  polyfill
ember-on-modifier
Implements the `{{on eventName this.someAction}}` element modifier from https://github.com/emberjs/rfcs/blob/master/text/0471-on-modifier.md
Stars: ✭ 37 (+76.19%)
Mutual labels:  polyfill
github-wc-polyfill
Ensure that all GitHub and GitLab scripts required for UXP and SeaMonkey are loaded correctly
Stars: ✭ 87 (+314.29%)
Mutual labels:  polyfill
iframe-worker
A tiny WebWorker polyfill for the file:// protocol
Stars: ✭ 23 (+9.52%)
Mutual labels:  polyfill
require-polyfill
Make `require` work in browsers, at runtime. No code bundling needed!
Stars: ✭ 37 (+76.19%)
Mutual labels:  polyfill
Object.getOwnPropertyDescriptors
Spec-compliant shim for `Object.getOwnPropertyDescriptors` that works in ES5.
Stars: ✭ 19 (-9.52%)
Mutual labels:  polyfill
parcel-plugin-goodie-bag
provides the Promise and fetch goodies needed for IE(11) support w/ parcel bundle loading
Stars: ✭ 15 (-28.57%)
Mutual labels:  polyfill
Polyfill
An artifact repository to assist writing Gradle Plugins for Android build system.
Stars: ✭ 68 (+223.81%)
Mutual labels:  polyfill
react-native-drawer-layout-polyfill
A polyfill for React Natives DrawerLayoutAndroid
Stars: ✭ 48 (+128.57%)
Mutual labels:  polyfill
react-native-wasm
A polyfill to use WebAssembly in React Native.
Stars: ✭ 39 (+85.71%)
Mutual labels:  polyfill
deno-fetch-event-adapter
Dispatches global fetch events using Deno's native http server.
Stars: ✭ 18 (-14.29%)
Mutual labels:  polyfill
weakmap-polyfill
ECMAScript6 WeakMap polyfill
Stars: ✭ 25 (+19.05%)
Mutual labels:  polyfill
NetStandardPolyfills
Type and Reflection polyfill extension methods. .NET 3.5+ and .NET Standard 1.0+.
Stars: ✭ 22 (+4.76%)
Mutual labels:  polyfill
object-keys
Object.keys shim
Stars: ✭ 41 (+95.24%)
Mutual labels:  polyfill
Javascript-Interview-Preparation
A curated collection of javascript interview questions & solutions.
Stars: ✭ 163 (+676.19%)
Mutual labels:  polyfill

appHistory polyfill

Tests

⚠️ Not for production. Use at your own risk; there will be breaking changes because the spec is not yet finalized ⚠️

A work-in-progress polyfill for the appHistory proposal.

Usage

This polyfill must run in a browser-like environment (e.g. an env that has window.location and window.history). If there's time, and demand for it, I think it would be interesting to have a discussion about how this polyfill could work in other environments.

To setup the polyfill so that it will automatically listen for anchor tag clicks, do the following:

import { useBrowerPolyfill } from "@frehner/apphistory";
userBrowserPolyfill();

// appHistory is now on the window
window.appHistory.navigate();

Alternatively, you can create your own instance of AppHistory:

import { AppHistory } from "@frehner/apphistory";
const appHistory = new AppHistory();

// use your own instance of appHistory, without any events from things like anchor tags
appHistory.navigate();

You can also get a ready-to-go ESM version from

Differences

  • The events for an AppHistoryEntry use event.detail.target instead of event.target to get access to the AppHistoryEntry that fired the event.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].