Skip to content

Commit

Permalink
0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Nov 6, 2014
1 parent 391bbfd commit 18b790e
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ pom.xml.asc
web/out
web/*.js
perf
release/datascript*.js
release/npm-*
release-js/datascript*.js
release-js/npm-*
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.5.1

- Ability to pass inputs (predicates/functions bindings) down to rules (issues #28 #29)

# 0.5.0

- Javascript version is now packaged as a proper CommonJS/RequireJS module (include via script tag still supported) (issue #39)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Projects using DataScript:
:dependencies [
[org.clojure/clojurescript "0.0-2371"]
...
[datascript "0.5.0"]
[datascript "0.5.1"]
]

;; for advanced optimizations externs are needed
Expand Down Expand Up @@ -115,12 +115,12 @@ Projects using DataScript:
DataScript can be used from any JS engine without additional dependencies:

```
<script src="datascript-0.5.0.min.js"></script>
<script src="datascript-0.5.1.min.js"></script>
```

[Download datascript-0.5.0.min.js](https://github.com/tonsky/datascript/releases/download/0.5.0/datascript-0.5.0.min.js), 46k gzipped.
[Download datascript-0.5.1.min.js](https://github.com/tonsky/datascript/releases/download/0.5.1/datascript-0.5.1.min.js), 46k gzipped.

or as a CommonJS module:
or as a CommonJS module ([npm page](https://www.npmjs.org/package/datascript)):

```
npm install datascript
Expand Down
6 changes: 3 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject datascript "0.5.0"
(defproject datascript "0.5.1"
:description "An implementation of Datomic in-memory database and Datalog query engine in ClojureScript"
:license {:name "Eclipse"
:url "http://www.eclipse.org/legal/epl-v10.html"}
Expand All @@ -15,14 +15,14 @@
:source-paths ["src"]
:assert false
:compiler {
:output-to "release/datascript.bare.js"
:output-to "release-js/datascript.bare.js"
:optimizations :advanced
:pretty-print false
:externs ["src/datascript/externs.js"]
:elide-asserts true
:output-wrapper false
}
:notify-command ["release/wrap_bare.sh"]}
:notify-command ["release-js/wrap_bare.sh"]}
]}

:profiles {
Expand Down
16 changes: 16 additions & 0 deletions release-js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# DataScript

An immutable in-memory database and Datalog query engine for JS engines.

DataScript is meant to run inside the browser. It is cheap to create, quick to query and ephemeral. You create a database on page load, put some data in it, track changes, do queries and forget about it when the user closes the page.

DataScript databases are immutable and based on persistent data structures. In fact, they’re more like data structures than databases (think Hashmap). Unlike querying a real SQL DB, when you query DataScript, it all comes down to a Hashmap lookup. Or series of lookups. Or array iteration. There’s no particular overhead to it. You put a little data in it, it’s fast. You put in a lot of data, well, at least it has indexes. That should do better than you filtering an array by hand anyway. The thing is really lightweight.

The intention with DataScript is to be a basic building block in client-side applications that needs to track a lot of state during their lifetime. There’s a lot of benefits:

- Central, uniform approach to manage all application state. Clients working with state become decoupled and independent: rendering, server sync, undo/redo do not interfere with each other.
- Immutability simplifies things even in a single-threaded browser environment. Keep track of app state evolution, rewind to any point in time, always render consistent state, sync in background without locking anybody.
- Datalog query engine to answer non-trivial questions about current app state.
- Structured format to track data coming in and out of DB. Datalog queries can be run against it too.

For more info, check out [project page](https://github.com/tonsky/datascript)
2 changes: 1 addition & 1 deletion release/package.json → release-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "datascript",
"version": "0.5.0",
"version": "0.5.1",
"description": "Immutable in-memory triplestore with Datalog queries",
"homepage": "https://github.com/tonsky/datascript",
"author": "Nikita Prokopov (https://github.com/tonsky)",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions release-js/wrap_bare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

(cat release-js/wrapper.prefix; cat release-js/datascript.bare.js; cat release-js/wrapper.suffix) > release-js/datascript.js

echo "Packed release-js/datascript.js"
2 changes: 1 addition & 1 deletion release/wrapper.prefix → release-js/wrapper.prefix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Datascript v0.5.0
* Datascript v0.5.1
*
* Copyright 2014 Nikita Prokopov
*
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions release/wrap_bare.sh

This file was deleted.

2 changes: 1 addition & 1 deletion test/js/js.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<script src="../../web/datascript.js" type="text/javascript"></script>
<script type="text/javascript">goog.require("datascript.js");</script> -->

<script src="../../release/datascript.js" type="text/javascript"></script>
<script src="../../release-js/datascript.js" type="text/javascript"></script>

<script type="text/javascript">
var d = datascript;
Expand Down
12 changes: 12 additions & 0 deletions test/test/datascript.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,18 @@
[(?pred ?e2)]]]
even?)
#{[4 6] [2 4]})))

(testing "Using built-ins inside rule"
(is (= (d/q '[:find ?x ?y
:in $ %
:where (match ?x ?y)]
db
'[[(match ?e ?e2)
[?e :follow ?e2]
[(even? ?e)]
[(even? ?e2)]]])
#{[4 6] [2 4]})))

)


Expand Down

0 comments on commit 18b790e

Please sign in to comment.