Socket
Socket
Sign inDemoInstall

dompack

Package Overview
Dependencies
0
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dompack

Dompack - tools and components to build sites in a ES7/IE11+ world


Version published
Weekly downloads
23
decreased by-73.56%
Maintainers
4
Install size
312 kB
Created
Weekly downloads
 

Readme

Source

Dompack

Dompack is a minimal collection of APIs to fill some remaining gaps of functionality in an otherwise ES7/IE11+ world, but assumes you'll use native browser features (IE11+) where possible.

Dompack expects to be integrated into your website using WebPack & Babel. dompack-builder can do this for you but usually you'll be using dompack together with the WebHare CMS

Usage

Using dompack in WebHare

import * as dompack from 'dompack';

Using dompack outside WebHare

If you intend to ship published files, you amy only need it as a dev-dependency

npm i --save-dev dompack dompack-builder
echo '{ "build": { "entrypoint": "site.es" }}' > dompack.json
node_modules/.bin/dompack-builder -r .         # add '-w' to watch

And add something like this to your pages

<head>
  <link href="dompackbuild/ap.css" rel="stylesheet">
  <script async src="dompackbuild/ap.js"></script>
</head>

About dompack

Why not jquery/mootools/... ?

We loved mootools - but its polyfill approach collides too easily with new language/dom features (eg. Array.from) and makes it hard to load two versions of its parts (not that you'd really want too, but compatibility issues and dependencies happen)

Both frameworks also ship with their own event implementations, requiring anyone integrating with these libraries (and components built on it) to register with those event systems. Native events are easier to integrate with.

Mootools (not sure about jquery) stores its event listeners in a global storage, which makes it hard to actually get DOM nodes to be garbage collected.

Multiple instances of mootools (not sure about jquery) which may happen with iframes, can collide with each other and get confused about 'slick ids'...

jQuery builds a parallel API to the DOM, learning you things the jQuery-way that nowadays have a perfectly usable DOM-way, which gets in the way if the site you're working on doesn't include or expose a jQuery object. We liked the mootools approach of always letting you work with the native DOM objects and DOM api.

There are good reasons for these issues (and most of them point back to old browsers or the leaking DOM implementations of IE) but we needed a clean start.

Supported browsers

Our baseline is IE11+, but we're open for IE10 fixes. IE9 and below have too many issues with their event system for us to fix. The other major browsers are supported as long as their vendors support them

Features for components

  • A central debugging framework for components to plugin to.

Polyfills

We try to avoid polyfills as much as possible, as we want ES7(Babel) to fill in all the needed holes. Having said that, Babel does not ship with finally() and to make sure finally is available even after chaining, we've decided to polyfill that.

FAQs

Last updated on 01 Mar 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc