Contributing to node modules

Writing this down since it always takes me a while to piece together after I’ve forgotten it. Basically local development of npm modules is all npm link

  1. Clone the module somewhere locally
  2. cd into the module directory
  3. run npm link
  4. cd into some project using the module
  5. run npm link module-name

To clean this up afterwards, run npm unlink.

If you’re working on a dependency of a dependency, directly install the public version of that module before linking (I think?). Newer versions of NPM use a flat dependency graph and it should all just work. (couldn’t find a reference on this, sorry)

Microsoft on IE Document Modes

Not exciting at all, but worth noting.

Specifying legacy document modes or better, What that strange x-ua-compatible meta tag really does.

Love this:

Starting with IE11, document modes are considered deprecated and should no longer be used. Webpages that require legacy document modes to display properly should be rewritten to use features defined by modern standards.

Mixing server header and meta tag, meta tag wins:

A web server can also be configured to specify the X-UA-Compatible header. If a web server specifies the header and the header also appears within the content of a webpage, the header in the webpage takes precedence over the one specified by the server.

Meta tags override doctypes, somebody please note that we can finally drop the meta tags when IE11 or later is the dominant IE version.

If a webpage specifies a doctype directive and includes an X-UA-Compatible header, the header takes precedence over the directive.

This is great, but I’m still including both:

The <meta http-equiv="x-ua-compatible" content="IE=edge" > meta tag is functionally equivalent to using the HTML5 doctype. It places Internet Explorer into the highest supported document mode.

Lastly, it is in fact possible to determine the document mode with JavaScript using document.documentMode:

To determine the document compatibility mode of a webpage using JavaScript, use the documentMode property of the document object