• This repository has been archived on 25/Mar/2019
  • Stars
    star
    324
  • Rank 124,973 (Top 3 %)
  • Language
    JavaScript
  • Created almost 12 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

**DEPRECATED** A collection of thin facade APIs wrapped around HTML5 JavaScript features.

h5ive

A collection of thin facade APIs wrapped around HTML5 JavaScript features. The goal is to provide a simple layer of abstraction on top of the native APIs, to insulate you the developer (and more importantly, your production code!) from potential inconsistencies, bugs, and even specification changes.

Want more information about the motivations behind this project? Nicholas Zakas wrote a fantastic article: The Problem with Native JavaScript APIs, which was my inspiration for the h5ive project. Also, check out my slide-deck for Stop Using Native HTML (video will be posted from this talk ASAP).

This is not a "HTML5 shim|v" for semantic tags. It is not a library or framework. It is not a polyfill for older browsers. It is not a replacement for Modernizr (though it will have basic feature tests for the APIs it wraps).

Some API sugar flavor will be included, but do not expect for this library to be as sugary as something like jQuery. You can wrap other abstraction layers easily on top of h5ive.

Testing

It will be an important (read: mandated) part of the culture of this project that all code which is submitted must have some reasonable tests.

First and foremost, each module starts with an example usage of the API (see "Contributions" below), so the eventual submitted code for that module must at a minimum actually "pass" the test of being able to run the example API we agree on.

Moreover, contributors should make a good effort to provide one or more integration tests (unit tests not necessarily required), which ideally will be automatable.

We have not yet, as a project, chosen a specific testing framework or approach, so these statements are not mandating how the tests are written, only that there must be a good faith effort to provide tests along with code. A first priority will be to write tests for the code which is already in this repository.

Contributions

Contributions are obviously welcomed and encouraged. But let's be a little bit intentional about how we want this to work. Here are some suggestions for how to be most friendly in terms of contributions:

  1. Pick of one the native HTML5 APIs that you have some familiarity with, perhaps from this list:

    History
    Web Workers
    Web Sockets
    Geolocation
    <audio> / <video>
    File / FileSystem
    Web DBs
    BlobBuilder
    Blob URLs
    FormData
    Device APIs
    Server-Sent Events
    appCache
    Web Intents
    registerProtocolHandler
    
  2. This project will follow "example-driven development" practices. Make an example-{WRAPPER_NAME}.js file that illustrates how you think the API facade will/should be used.

This doesn't have to show all possible variations, and it's not a "contract" etched in stone. But it should illustrate the major use-case(s).

  1. Submit a pull-request with only your example file, and explain the API facade you are proposing. We'll discuss it in that pull request.

  2. Once we feel that the API facade is in good shape, amend your pull request to include a sample implementation (named {WRAPPER_NAME}.h5ive.js, and we'll take it from there. NOTE: please also include one or more tests along with the module's implementation (see "Testing" above).

Also, PLEASE avoid these things:

  1. Reformatting this project's code style (we'll decide on a code-style later). Leave spaces, tabs, and semi-colons in existing files alone.

  2. Rewrite this project in some other language (including Coffeescript). This is a JavaScript project. We write JavaScript here. Period.

  3. Convince us that we shouldn't do this, or that some Project XYZ is already doing it better, etc. We'll take any valid, good-faith suggestions from any open-source project, but the goals of this project are unique and will not be shoe-horned into any other project's goals.

  4. Worry too much about stuff like if this will be AMD-compliant or whatever. We'll decide on all that stuff later. There will be a build-tool, and it'll have options for you to pick which flavor you prefer.

h5ive.js

This single file is what you will include in your HTML5 JavaScript projects. It will eventually be customizable with a build-tool, which will let you pick which "module format" (AMD, CommonJS, customized module, etc) you prefer, and then include only which API modules you need.

The entire API will be under the h5 namespace. For instance, XHR2 will be exposed as h5.xhr.

License

The code and all the documentation are released under the MIT license.

http://getify.mit-license.org/

More Repositories

1

You-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.
175,600
star
2

Functional-Light-JS

Pragmatic, balanced FP in JavaScript. @FLJSBook on twitter.
JavaScript
16,458
star
3

LABjs

Loading And Blocking JavaScript: On-demand parallel loader for JavaScript with execution order dependencies
HTML
2,278
star
4

asynquence

Asynchronous flow control (promises, generators, observables, CSP, etc)
JavaScript
1,739
star
5

CAF

Cancelable Async Flows (CAF)
JavaScript
1,323
star
6

monio

The most powerful IO monad implementation in JS, possibly in any language!
JavaScript
1,038
star
7

TNG-Hooks

Provides React-inspired 'hooks' like useState(..) for stand-alone functions
JavaScript
1,012
star
8

native-promise-only

A polyfill for native ES6 Promises as close as possible (no extensions) to the strict spec definitions.
JavaScript
725
star
9

A-Tale-Of-Three-Lists

Comparing various async patterns for a single demo
JavaScript
651
star
10

fasy

FP iterators that are both eager and asynchronous
JavaScript
544
star
11

FPO

FP library for JavaScript. Supports named-argument style methods.
JavaScript
449
star
12

youperiod.app

YouPeriod.app -- the privacy-first period tracking app
JavaScript
439
star
13

JSON.minify

Simple minifier for JSON to remove comments and whitespace
400
star
14

TypL

The Type Linter for JS
JavaScript
368
star
15

eslint-plugin-proper-arrows

ESLint rules to ensure proper arrow function definitions
JavaScript
304
star
16

foi-lang

Foi: a different kind of functional programming language
JavaScript
301
star
17

grips

Simple-logic templates
JavaScript
286
star
18

moduloze

Convert CommonJS (CJS) modules to UMD and ESM formats
JavaScript
205
star
19

ES-Feature-Tests

Feature Tests for JavaScript
JavaScript
199
star
20

let-er

DEPRECATED: Transpile non-ES6 let-blocks into ES6 (or ES3)
JavaScript
190
star
21

Incomplete-JS

"The Incomplete Guide to JavaScript" (book). @IncompleteJS on twitter.
190
star
22

revocable-queue

Specialized async queue data structure, supports revocation of values
JavaScript
175
star
23

deePool

highly-efficient pool for JavaScript objects
JavaScript
115
star
24

concrete-syntax-tree

Defining a standard JavaScript CST (concrete syntax tree) to complement ASTs
106
star
25

getify.github.io

JavaScript
105
star
26

eslint-plugin-proper-ternary

ESLint rules to ensure proper usage of ternary/conditional expressions
JavaScript
95
star
27

cloud-sweeper

A casual game built for the web.
JavaScript
92
star
28

BikechainJS

JavaScript VM engine (powered by V8); server-side environment modules; server-side synchronous web app controllers
C++
80
star
29

wepuzzleit

Demo PoC game for various advanced HTML5 js APIs
JavaScript
78
star
30

workshop-periodic-table

60
star
31

elasi

EL/ASI: Encrypt Locally, Account Secure Interchange
JavaScript
60
star
32

remote-csp-channel

Remote bridge for CSP channels
JavaScript
55
star
33

ScanTree

Scan a JS file tree to build an ordered and grouped dependency listing
JavaScript
51
star
34

dwordly-game

A game where words dwindle down to the shortest possible
JavaScript
42
star
35

stable-timers

timers with less race conditions
JavaScript
38
star
36

emdash

Simple blogging with node/iojs + GitHub.
36
star
37

domio

DOM and Event helpers for Monio
JavaScript
30
star
38

eslint-plugin-no-optional-call

ESLint plugin to disallow the optional-call operator
JavaScript
30
star
39

eslint-plugin-arrow-require-this

DEPRECATED: ESLint rule to require arrow functions to reference the 'this' keyword
JavaScript
28
star
40

gum-try-hd

Try to enforce HD (16:9) camera aspect ratio for web-video calls
JavaScript
25
star
41

Mock-DOM-Resources

A mock of (parts of) the DOM API to simulate resource preloading and loading
JavaScript
25
star
42

import-remap

Rewrite ES module import specifiers using an import-map.
JavaScript
24
star
43

make-a-game

some project files for a tutorial on making a simple web game
JavaScript
24
star
44

mpAjax

framework plugin for handling multi-part Ajax responses
JavaScript
23
star
45

asyncGate.js

DEPRECATED. asynchronous gate for javascript
JavaScript
21
star
46

tic-tac-toe-workshop

Workshop files for building tic-tac-toe in JS and <canvas>
21
star
47

esre

esre: fully configurable JS code formatting
20
star
48

workshop-chess-diagonals

17
star
49

featuretests.io

JavaScript Feature Tests... as a service
JavaScript
16
star
50

FoilScript

FoilScript: a new dialect of JS that fixes the sucky parts but still looks and feels like JS
16
star
51

literalizer

Specialized heuristic lexer for JS to identify complex literals
JavaScript
15
star
52

normalize-selector

Normalize CSS selectors
JavaScript
14
star
53

DOMEventBridge

Bridge DOM events to a JS event hub (for pubsub)
JavaScript
14
star
54

pong-around-workshop

Workshop files for building a pong-variant game in JS and <canvas>
12
star
55

shortie.me

Proof-of-concept demo for server-side JavaScript driven "middle-end" architecture
JavaScript
11
star
56

workshop-wordy-unscrambler

10
star
57

middleend-boilerplate

Boilerplate Starting Point for Middle-end Web Architecture
JavaScript
8
star
58

workshop-knights-dialer

7
star
59

demo-app-weatheround

JavaScript
7
star
60

the-economy-of-keystrokes-slides

Slides code built for "The Economy of Keystrokes" talk
JavaScript
6
star
61

santa-connect-app

Santa Connect: keeping track of your kids' nice/naughty status
JavaScript
5
star
62

nyc-bug-demo

bug demo for NYC code coverage tool
JavaScript
4
star
63

unnamed

unnamed (for now). nothing to see here. ;-)
JavaScript
2
star
64

my-lifesheets

CSS
1
star
65

breakthewebforward.com

JavaScript
1
star
66

packages

📦 Package configurations - The #1 free and open source CDN built to make life easier for developers.
Shell
1
star