npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

knockout-esnext

v3.5.1026

Published

A modernized fork of Knockout.js intended for ES6+ browsers only

Downloads

6

Readme

Knockout-ESNext

A complete overhaul of the Knockout.js library and build process.

Making Knockout.js slicker, faster, more maintainable than ever.

Version scheme is v3.5.1xxx, where 3.5.1 is the initial Knockout version this library was forked off, and xxx the modifications since then.

Changes (in code):

  • Rewrote all library code in ES6+ supported in all modern browsers
  • Use native means for iterations, mappings etc. instead of former helper functions (like ko.utils.arrayForEach)
  • Reduced indirections by inlining function bodies via Rollup inline-macros plugin
  • Turned former source fragments into ES modules
    • Retained most of the original names & structure, so catchup & diffing with original Knockout.js remains possible
    • Easy circular-dependency detection through ESM imports/exports
    • No more worries about loading order of fragments, no more file concatenation at all
  • Internals are now self-contained & namespace-agnostic
    • no more ko.foo.bar references or assignments internally
    • ko.js being the only source of truth about what is exposed publicly (including legacy aliases)
    • override-points like ko.onError are setters in ko.js, so we gain full control over what can be overridden
  • Removed historic browser support (IE, earliest Firefox etc)
  • Removed jQuery support
  • Kept all ~1300 tests working with very few changes:
    • Added tests for type checking (ko.isObservable etc) in basicTypeCheckBehaviors.js
    • Removed IE/jQuery-related tests

Changes (in behavior)

  • When using extend({notify: 'always'}) with observables/computeds, their current default OR custom equalityComparer is now memorized and can be restored by using the extender again with anything other than 'always'. Original Knockout would only reassign its default equality comparer (valuesArePrimitiveAndEqual).

Changes (build process):

  • Removed Google Closure Compiler and all code soothing its side-effects (ko.exportSymbol)
  • Using Rollup + Terser plugin for build & minification
  • Wrote Rollup plugin rollup-plugin-inline-macros.js, allowing to "inline" frequently used helper functions & avoid function calls in hot code paths
  • Now exporting the Knockout.js library in 3 flavors:
    • Minified UMD (knockout.js)
    • Minified ES Module (knockout.esm.js)
    • Non-minified UMD debug version incl. sourcemap (knockout.debug.js & knockout.debug.js.map, not part of the knockout-esnext NPM package)
  • Removed deprecated PhantomJS
  • Removed Grunt
  • Added ESLint for code quality checks

Changes (testing/debugging)

  • After changing any source file during browser testing (spec/runner.html), you now have to run the build task before the next test-run:

    • npm run build

    This will rebuild the build/knockout.debug.js used by runner.html.

  • The debug version now has a sourcemap generated alongside it (knockout.debug.js.map), so you can attach your IDE's debugger to e.g. runner.html and add breakpoints inside the actual source files rather than the generated knockout.debug.js.


Knockout

Knockout is a JavaScript MVVM (a modern variant of MVC) library that makes it easier to create rich, desktop-like user interfaces with JavaScript and HTML. It uses observers to make your UI automatically stay in sync with an underlying data model, along with a powerful and extensible set of declarative bindings to enable productive development.

Getting started

Join the chat at https://gitter.im/knockout/knockout

Totally new to Knockout? The most fun place to start is the online interactive tutorials.

For more details, see

Downloading Knockout

You can download released versions of Knockout from the project's website.

For Node.js developers, Knockout is also available from npm - just run npm install knockout.

Building Knockout from sources

If you prefer to build the library yourself:

  1. Clone the repo from GitHub

    git clone https://github.com/knockout/knockout.git
    cd knockout
  2. Acquire build dependencies.

    Make sure you have Node.js installed on your workstation. This is only needed to build Knockout from sources. Knockout itself has no dependency on Node.js once it is built (it works with any server technology or none). Now run:

    npm install
  3. Start the build

    npm run build

    Now you'll find the built files in build/.

Running the tests

If you want to run the specs in Node.js

npm test

Or, if you want to run the specs in a browser (e.g., for debugging), simply open spec/runner.html in your browser.

License

MIT license - http://www.opensource.org/licenses/mit-license.php