Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .depcheckrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parsers": {
"**/*.js": ["es6"],
"**/*.cjs": ["es6"],
"**/*.mjs": ["es6"],
"**/*.coffee": ["coffeescript"],
"**/*.jsx": ["jsx"],
"**/*.json": ["json1", "json2"],
"**/*.ts": ["typescript"],
"**/*.tsx": ["typescript"]
},
"ignores": [
"@babel/core",
"@babel/preset-env",
"async",
"chai",
"gulp-wrap-amd-infer",
"gulp-zip",
"imports-loader",
"jsdom",
"karma-chai",
"karma-chrome-launcher",
"karma-cli",
"karma-coffee-preprocessor",
"karma-firefox-launcher",
"karma-mocha",
"karma-safari-launcher",
"karma-spec-reporter",
"minimatch",
"mocha",
"puppeteer",
"requirejs",
"localStorage",
"xmlhttprequest"
]
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
ignore:
- dependency-name: "coffee-loader"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI
on:
push:
branches:
- master
jobs:
test:
name: Node.js ${{ matrix.node-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["latest"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: git config --global user.name "Github Actions"
- run: git config --global user.email "actions@users.noreply.github.com"
- run: npm uninstall node-version-use -g
- run: npm install node-version-use -g
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm test
- run: npm run test:engines
4 changes: 4 additions & 0 deletions .ncurc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"upgrade": true,
"reject": ["coffee-loader"]
}
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
packages/
vendor/
test/issues/
knockback*
gulpfile.min.js
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

67 changes: 34 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Knockback.js provides Knockout.js magic for Backbone.js Models and Collections.

# Why Knockback?

* Make amazingly dynamic applications by applying a small number of simple principles
* Leverage the wonderful work from both the Backbone and Knockout communities
* Easily view and edit relationships between Models using an ORM of your choice:
* [BackboneORM](http://vidigami.github.io/backbone-orm/)
* [Backbone-Relational.js](http://backbonerelational.org/)
* Simplify program control flow by configuring your application from your HTML Views. It's like Angular.js but without memorizing all of the special purpose ng-{something} attributes. See the [Inject Tutorial](http://kmalakoff.github.com/knockback/tutorial_inject.html) for live examples!
- Make amazingly dynamic applications by applying a small number of simple principles
- Leverage the wonderful work from both the Backbone and Knockout communities
- Easily view and edit relationships between Models using an ORM of your choice:
- [BackboneORM](http://vidigami.github.io/backbone-orm/)
- [Backbone-Relational.js](http://backbonerelational.org/)
- Simplify program control flow by configuring your application from your HTML Views. It's like Angular.js but without memorizing all of the special purpose ng-{something} attributes. See the [Inject Tutorial](http://kmalakoff.github.com/knockback/tutorial_inject.html) for live examples!

# Examples

Expand All @@ -20,8 +20,10 @@ Knockback.js provides Knockout.js magic for Backbone.js Models and Collections.
###### The HTML:

```html
<label>First Name: </label><input data-bind="value: first_name, valueUpdate: 'keyup'" />
<label>Last Name: </label><input data-bind="value: last_name, valueUpdate: 'keyup'" />
<label>First Name: </label
><input data-bind="value: first_name, valueUpdate: 'keyup'" />
<label>Last Name: </label
><input data-bind="value: last_name, valueUpdate: 'keyup'" />
```

###### And...engage:
Expand All @@ -33,7 +35,6 @@ ko.applyBindings(kb.viewModel(model))

When you type in the input boxes, the values are properly transferred bi-directionally to the model and all other bound view models!


### Advanced

###### The View Model:
Expand Down Expand Up @@ -66,8 +67,10 @@ class ContactViewModel extends kb.ViewModel

```html
<h1 data-bind="text: 'Hello ' + full_name()"></h1>
<label>First Name: </label><input data-bind="value: first_name, valueUpdate: 'keyup'" />
<label>Last Name: </label><input data-bind="value: last_name, valueUpdate: 'keyup'" />
<label>First Name: </label
><input data-bind="value: first_name, valueUpdate: 'keyup'" />
<label>Last Name: </label
><input data-bind="value: last_name, valueUpdate: 'keyup'" />
```

###### And...engage:
Expand All @@ -83,23 +86,22 @@ kb.release(view_model)

Now, the greeting updates as you type!


# Getting Started

* [Website](http://kmalakoff.github.com/knockback/) - explore everything Knockback and connect to the community
* [Tutorials](http://kmalakoff.github.io/knockback/tutorials_introduction.html) - try some live examples
* [API Docs](http://kmalakoff.github.com/knockback/doc/index.html) - dig into the API
* [TodoMVC App (Live!)](http://kmalakoff.github.com/knockback-todos-app/) - compare client-side framworks
- [Website](http://kmalakoff.github.com/knockback/) - explore everything Knockback and connect to the community
- [Tutorials](http://kmalakoff.github.io/knockback/tutorials_introduction.html) - try some live examples
- [API Docs](http://kmalakoff.github.com/knockback/doc/index.html) - dig into the API
- [TodoMVC App (Live!)](http://kmalakoff.github.com/knockback-todos-app/) - compare client-side framworks

# Download Latest (1.2.3):

Please see the [release notes](https://github.com/kmalakoff/knockback/blob/master/RELEASE_NOTES.md) for upgrade pointers.

* Full Library [(dev, 64k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback.js) or [(min+gzip, 8k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback.min.js)
* Full Stack [(dev, 330k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-full-stack.js) or [(min+gzip, 32k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-full-stack.min.js)
- Full Library [(dev, 64k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback.js) or [(min+gzip, 8k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback.min.js)
- Full Stack [(dev, 330k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-full-stack.js) or [(min+gzip, 32k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-full-stack.min.js)

* Core Library [(dev, 54k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-core.js) or [(min+gzip, 7k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-core.min.js)
* Core Stack [(dev, 315k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-core-stack.js) or [(min+gzip, 31k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-core-stack.min.js)
- Core Library [(dev, 54k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-core.js) or [(min+gzip, 7k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-core.min.js)
- Core Stack [(dev, 315k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-core-stack.js) or [(min+gzip, 31k)](https://raw.github.com/kmalakoff/knockback/1.2.3/knockback-core-stack.min.js)

The **full versions** bundle advanced features.

Expand All @@ -111,25 +113,24 @@ The **stack versions** provide Underscore.js + Backbone.js + Knockout.js + Knock

You can also find Knockback on your favorite distributions:

* **npm**: npm install knockback
* **Bower**: bower install knockback
* [NuGet](http://nuget.org/packages/Knockback.js) - install right in Visual Studio
- **npm**: npm install knockback
- **Bower**: bower install knockback
- [NuGet](http://nuget.org/packages/Knockback.js) - install right in Visual Studio

###Dependencies

* [Backbone.js](http://backbonejs.org/) - provides the Model layer
* [Knockout.js](http://knockoutjs.com/) - provides the ViewModel layer foundations for Knockback
* [Underscore.js](http://underscorejs.org/) - provides an awesome JavaScript utility belt
* [LoDash](http://lodash.com/) - optionally replaces Underscore.js with a library optimized for consistent performance
* [Parse](https://www.parse.com/) - optionally replaces Backbone.js and Underscore.js
- [Backbone.js](http://backbonejs.org/) - provides the Model layer
- [Knockout.js](http://knockoutjs.com/) - provides the ViewModel layer foundations for Knockback
- [Underscore.js](http://underscorejs.org/) - provides an awesome JavaScript utility belt
- [LoDash](http://lodash.com/) - optionally replaces Underscore.js with a library optimized for consistent performance
- [Parse](https://www.parse.com/) - optionally replaces Backbone.js and Underscore.js

###Compatible Components

* [BackboneORM](http://vidigami.github.io/backbone-orm/) - A polystore ORM for Node.js and the browser
* [Backbone-Relational.js](http://backbonerelational.org/) - Get and set relations (one-to-one, one-to-many, many-to-one) for Backbone models
* [Backbone Associations](http://dhruvaray.github.io/backbone-associations/) - Create object hierarchies with Backbone models. Respond to hierarchy changes using regular Backbone events
* [BackboneModelRef.js](https://github.com/kmalakoff/backbone-modelref/) - provides a reference to a Backbone.Model that can be bound to your view before the model is loaded from the server (along with relevant load state notifications).

- [BackboneORM](http://vidigami.github.io/backbone-orm/) - A polystore ORM for Node.js and the browser
- [Backbone-Relational.js](http://backbonerelational.org/) - Get and set relations (one-to-one, one-to-many, many-to-one) for Backbone models
- [Backbone Associations](http://dhruvaray.github.io/backbone-associations/) - Create object hierarchies with Backbone models. Respond to hierarchy changes using regular Backbone events
- [BackboneModelRef.js](https://github.com/kmalakoff/backbone-modelref/) - provides a reference to a Backbone.Model that can be bound to your view before the model is loaded from the server (along with relevant load state notifications).

# Contributing

Expand Down
10 changes: 2 additions & 8 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"bower_components"
],
"homepage": "https://github.com/kmalakoff/knockback",
"authors": [
"Kevin Malakoff <kmalakoff@gmail.com>"
],
"authors": ["Kevin Malakoff <kmalakoff@gmail.com>"],
"description": "Knockback.js provides Knockout.js magic for Backbone.js Models and Collections",
"keywords": [
"knockback",
Expand All @@ -28,11 +26,7 @@
"knockout",
"knockoutjs"
],
"moduleType": [
"amd",
"globals",
"node"
],
"moduleType": ["amd", "globals", "node"],
"dependencies": {
"underscore": ">=1.1.7",
"backbone": ">=0.5.1",
Expand Down
15 changes: 10 additions & 5 deletions component.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
"author": "Kevin Malakoff (https://github.com/kmalakoff)",
"version": "1.2.3",
"description": "Knockback.js provides Knockout.js magic for Backbone.js Models and Collections",
"keywords" : ["knockback", "knockbackjs", "backbone", "backbonejs", "knockout", "knockoutjs"],
"keywords": [
"knockback",
"knockbackjs",
"backbone",
"backbonejs",
"knockout",
"knockoutjs"
],
"repo": "kmalakoff/knockback",
"dependencies": {
"jashkenas/underscore": "*",
"jashkenas/backbone": "*",
"kmalakoff/knockout": "*"
},
"main": "knockback.js",
"scripts": [
"knockback.js"
],
"scripts": ["knockback.js"],
"license": "MIT"
}
}
10 changes: 0 additions & 10 deletions config/amd/gulp-options.coffee

This file was deleted.

16 changes: 16 additions & 0 deletions config/amd/gulp-options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
karma: true,
shims: {
underscore: { exports: "_" },
backbone: { exports: "Backbone", deps: ["underscore"] },
knockback: { deps: ["backbone", "knockout"] },
"globalize.culture.en-GB": { deps: ["globalize"] },
"globalize.culture.fr-FR": { deps: ["globalize"] },
},
post_load: "this._ = this.Backbone = this.ko = this.kb = null;", // clear window references so amd version is used
aliases: {
"knockback-core": "knockback",
lodash: "underscore",
"knockout-latest.debug": "knockout",
},
};
18 changes: 0 additions & 18 deletions config/browserify/tests.coffee

This file was deleted.

36 changes: 36 additions & 0 deletions config/browserify/tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const path = require("path");

module.exports = {
full: {
output: "./_temp/browserify/knockback.tests.js",
files: [
"./test/spec/core/**/*.tests.coffee",
"./test/spec/plugins/**/*.tests.coffee",
],
options: {
// basedir: path.resolve(__dirname, '../..')
shim: {
knockback: {
path: "./knockback.js",
exports: "kb",
depends: { underscore: "_", backbone: "Backbone", knockout: "ko" },
},
},
},
},

core: {
output: "./_temp/browserify/knockback-core.tests.js",
files: ["./test/spec/core/**/*.tests.coffee"],
options: {
// basedir: path.resolve(__dirname, '../..')
shim: {
knockback: {
path: "./knockback.js",
exports: "kb",
depends: { underscore: "_", backbone: "Backbone", knockout: "ko" },
},
},
},
},
};
16 changes: 0 additions & 16 deletions config/builds/library/knockback-core-stack.webpack.config.coffee

This file was deleted.

Loading