Skip to content

Commit

Permalink
Rename Cycle Web to Cycle DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Medeiros committed Jul 18, 2015
1 parent ac1f4e4 commit dd0d4e3
Show file tree
Hide file tree
Showing 29 changed files with 72 additions and 59 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
# Cycle Web
# Cycle DOM

## DEPRECATED
A collection of Cycle drivers to enable interaction with the DOM. It includes a DOM Driver, an HTML Driver, both working on top of `virtual-dom`.

This package was renamed to [Cycle DOM](https://github.com/cyclejs/cycle-dom), use it instead. *Cycle Web* v2.2 can still be downloaded, but it won't receive any newer versions.
[Read the docs](https://github.com/cyclejs/cycle-dom/blob/master/docs/api.md) and check the examples.

[![npm version](https://badge.fury.io/js/%40cycle%2Fdom.svg)](http://badge.fury.io/js/%40cycle%2Fdom)

## Resources

- [Hyperscript-helpers](https://www.npmjs.com/package/hyperscript-helpers) **`npm install hyperscript-helpers`**: create virtual DOM elements with `div({class: 'wrapper'}, [ h1('Header') ])` instead of `h('div.wrapper', [ h('h1', 'Header') ])`.

## LICENSE

[The MIT License (MIT)](https://github.com/cyclejs/cycle-web/blob/master/LICENSE)
[The MIT License (MIT)](https://github.com/cyclejs/cycle-dom/blob/master/LICENSE)

- - -

[![Build Status](https://travis-ci.org/cyclejs/cycle-dom.svg?branch=master)](https://travis-ci.org/cyclejs/cycle-dom)
[![Code Climate](https://codeclimate.com/github/cyclejs/cycle-dom/badges/gpa.svg)](https://codeclimate.com/github/cyclejs/cycle-dom)
[![Dependency Status](https://david-dm.org/cyclejs/cycle-dom.svg)](https://david-dm.org/cyclejs/cycle-dom)
[![devDependency Status](https://david-dm.org/cyclejs/cycle-dom/dev-status.svg)](https://david-dm.org/cyclejs/cycle-dom#info=devDependencies)
8 changes: 4 additions & 4 deletions dist/cycle-web.js → dist/cycle-dom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.CycleWeb = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.CycleDOM = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
var Rx = require('rx');

Expand Down Expand Up @@ -15889,7 +15889,7 @@ var _require2 = require('./render-html');

var makeHTMLDriver = _require2.makeHTMLDriver;

var CycleWeb = {
var CycleDOM = {
/**
* A factory for the DOM driver function. Takes a `container` to define the
* target on the existing DOM which this driver will operate on. All custom
Expand Down Expand Up @@ -15946,7 +15946,7 @@ var CycleWeb = {
* with Babel. Place the [Babel configuration comment](
* http://babeljs.io/docs/advanced/transformers/other/react/) `@jsx hJSX` at
* the top of the ES6 file, make sure you import `hJSX` with
* `import {hJSX} from '@cycle/web'`, and then you can use JSX to create
* `import {hJSX} from '@cycle/dom'`, and then you can use JSX to create
* VTrees.
* @name hJSX
*/
Expand All @@ -15965,7 +15965,7 @@ var CycleWeb = {
svg: svg
};

module.exports = CycleWeb;
module.exports = CycleDOM;

},{"./render-dom":115,"./render-html":116,"virtual-dom":78,"virtual-dom/virtual-hyperscript/svg":99}],115:[function(require,module,exports){
'use strict';
Expand Down
4 changes: 2 additions & 2 deletions dist/cycle-web.min.js → dist/cycle-dom.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# `CycleWeb` object API
# `CycleDOM` object API

- [`makeDOMDriver`](#makeDOMDriver)
- [`makeHTMLDriver`](#makeHTMLDriver)
Expand Down Expand Up @@ -69,7 +69,7 @@ An adapter around virtual-hyperscript `h()` to allow JSX to be used easily
with Babel. Place the [Babel configuration comment](
http://babeljs.io/docs/advanced/transformers/other/react/) `@jsx hJSX` at
the top of the ES6 file, make sure you import `hJSX` with
`import {hJSX} from '@cycle/web'`, and then you can use JSX to create
`import {hJSX} from '@cycle/dom'`, and then you can use JSX to create
VTrees.

- - -
Expand Down
4 changes: 2 additions & 2 deletions examples/hello/hello.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
var h = CycleWeb.h;
var h = CycleDOM.h;

function main(ext) {
return {
Expand All @@ -18,5 +18,5 @@ function main(ext) {
}

Cycle.run(main, {
DOM: CycleWeb.makeDOMDriver('.js-container')
DOM: CycleDOM.makeDOMDriver('.js-container')
});
2 changes: 1 addition & 1 deletion examples/hello/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<div class="js-container"></div>
<script src="../../node_modules/@cycle/core/dist/cycle.js"></script>
<script src="../../dist/cycle-web.js"></script>
<script src="../../dist/cycle-dom.js"></script>
<script src="./hello.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions examples/isomorphic/app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @jsx hJSX */
'use strict';
let Cycle = require('@cycle/core');
let CycleWeb = require('../../lib/cycle-web');
let {h, hJSX} = CycleWeb;
let CycleDOM = require('../../lib/cycle-dom');
let {h, hJSX} = CycleDOM;

function renderMenu() {
return (
Expand Down
4 changes: 2 additions & 2 deletions examples/isomorphic/client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
let Cycle = require('@cycle/core');
let CycleWeb = require('../../lib/cycle-web');
let {makeDOMDriver} = require('../../lib/cycle-dom');
let {app} = require('./app');

function clientSideApp(responses) {
Expand All @@ -10,6 +10,6 @@ function clientSideApp(responses) {
}

Cycle.run(clientSideApp, {
DOM: CycleWeb.makeDOMDriver('.app-container'),
DOM: makeDOMDriver('.app-container'),
context: () => Cycle.Rx.Observable.just(window.appContext)
});
6 changes: 3 additions & 3 deletions examples/isomorphic/server.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';
let Cycle = require('@cycle/core');
let CycleWeb = require('../../lib/cycle-web');
let CycleDOM = require('../../lib/cycle-dom');
let express = require('express');
let browserify = require('browserify');
let serialize = require('serialize-javascript');
let {Rx} = Cycle;
let {h} = CycleWeb;
let {h, makeHTMLDriver} = CycleDOM;
let {app} = require('./app');

function wrapVTreeWithHTMLBoilerplate(vtree, context, clientBundle) {
Expand Down Expand Up @@ -70,7 +70,7 @@ server.use(function (req, res) {
let context$ = Rx.Observable.just({route: req.url});
let wrappedAppFn = wrapAppResultWithBoilerplate(app, context$, clientBundle$);
let [requests, responses] = Cycle.run(wrappedAppFn, {
DOM: CycleWeb.makeHTMLDriver(),
DOM: makeHTMLDriver(),
context: () => context$
});
let html$ = responses.DOM.get(':root').map(prependHTML5Doctype);
Expand Down
2 changes: 1 addition & 1 deletion examples/many/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<a href="http://binarymuse.github.io/react-primer/build/index.html?6">Compare with React</a>
</p>
<script src="../../node_modules/@cycle/core/dist/cycle.js"></script>
<script src="../../dist/cycle-web.js"></script>
<script src="../../dist/cycle-dom.js"></script>
<script src="./many-component.js"></script>
<script src="./many-model.js"></script>
<script src="./many-view.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/many/many-component.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var h = CycleWeb.h;
var h = CycleDOM.h;

function manyComponent(ext) {
var id$ = ext.props.get('itemid').shareReplay(1);
Expand Down
2 changes: 1 addition & 1 deletion examples/many/many-view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function manyView(items$) {
var h = CycleWeb.h;
var h = CycleDOM.h;

function vrenderPerfButton() {
function run() {
Expand Down
2 changes: 1 addition & 1 deletion examples/many/many.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function main(ext) {
}

Cycle.run(main, {
DOM: CycleWeb.makeDOMDriver('.js-container', {
DOM: CycleDOM.makeDOMDriver('.js-container', {
'many-item': manyComponent
})
});
4 changes: 2 additions & 2 deletions examples/synthetic-examples/custom-element/custom-element.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var h = CycleWeb.h;
var h = CycleDOM.h;
var Rx = Cycle.Rx;

function tickerCustomElement(ext) {
Expand Down Expand Up @@ -55,7 +55,7 @@ function main(ext) {
}

Cycle.run(main, {
DOM: CycleWeb.makeDOMDriver('.js-container', {
DOM: CycleDOM.makeDOMDriver('.js-container', {
'my-ticker': tickerCustomElement
})
});
2 changes: 1 addition & 1 deletion examples/synthetic-examples/custom-element/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<div class="js-container"></div>
<script src="../../../node_modules/@cycle/core/dist/cycle.js"></script>
<script src="../../../dist/cycle-web.js"></script>
<script src="../../../dist/cycle-dom.js"></script>
<script src="custom-element.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/synthetic-examples/nested-custom/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<div class="js-container"></div>
<script src="../../../node_modules/@cycle/core/dist/cycle.js"></script>
<script src="../../../dist/cycle-web.js"></script>
<script src="../../../dist/cycle-dom.js"></script>
<script src="nested.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions examples/synthetic-examples/nested-custom/nested.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var h = CycleWeb.h;
var h = CycleDOM.h;

// This example tests 3 issues:
// - Whether custom events from a custom element are caught by the parent View/User
Expand Down Expand Up @@ -69,7 +69,7 @@ function main(ext) {
}

var interaction = Cycle.run(main, {
UI: CycleWeb.makeDOMDriver('.js-container', {'inner-elem': innerElem})
UI: CycleDOM.makeDOMDriver('.js-container', {'inner-elem': innerElem})
});
var responses = interaction[1];

Expand Down
2 changes: 1 addition & 1 deletion examples/synthetic-examples/simple/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="js-container1"></div>
<div class="js-container2"></div>
<script src="../../../node_modules/@cycle/core/dist/cycle.js"></script>
<script src="../../../dist/cycle-web.js"></script>
<script src="../../../dist/cycle-dom.js"></script>
<script src="simple.js"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions examples/synthetic-examples/simple/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function main(ext) {
.map(function () { return Math.round(Math.random() * 1000); })
.startWith(135)
.map(function (data) {
return CycleWeb.h('div.box', {
return CycleDOM.h('div.box', {
style: {
margin: '10px',
background: '#ececec',
Expand All @@ -20,8 +20,8 @@ function main(ext) {
}

Cycle.run(main, {
DOM: CycleWeb.makeDOMDriver('.js-container1')
DOM: CycleDOM.makeDOMDriver('.js-container1')
});
Cycle.run(main, {
DOM: CycleWeb.makeDOMDriver('.js-container2')
DOM: CycleDOM.makeDOMDriver('.js-container2')
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<div class="js-container"></div>
<script src="../../../node_modules/@cycle/core/dist/cycle.js"></script>
<script src="../../../dist/cycle-web.js"></script>
<script src="../../../dist/cycle-dom.js"></script>
<script src="wrapper.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions examples/synthetic-examples/wrapper-custom-element/wrapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var Rx = Cycle.Rx;
var h = CycleWeb.h;
var h = CycleDOM.h;

function wrapperElementDef(ext) {
return {
Expand All @@ -23,7 +23,7 @@ function main() {
}

Cycle.run(main, {
DOM: CycleWeb.makeDOMDriver('.js-container', {
DOM: CycleDOM.makeDOMDriver('.js-container', {
'wrapper-element': wrapperElementDef
})
});
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@cycle/web",
"name": "@cycle/dom",
"version": "2.2.2",
"author": "Andre Staltz",
"description": "The standard DOM Driver for Cycle.js, based on virtual-dom, and other helpers",
"license": "MIT",
"homepage": "https://github.com/cyclejs/cycle-web",
"bugs": "https://github.com/cyclejs/cycle-web/issues",
"homepage": "https://github.com/cyclejs/cycle-dom",
"bugs": "https://github.com/cyclejs/cycle-dom/issues",
"repository": {
"type": "git",
"url": "https://github.com/cyclejs/cycle-web"
"url": "https://github.com/cyclejs/cycle-dom"
},
"keywords": [
"reactive",
Expand All @@ -19,7 +19,7 @@
"mvi",
"virtual-dom"
],
"main": "lib/cycle-web.js",
"main": "lib/cycle-dom.js",
"dependencies": {
"es6-map": "0.1.1",
"vdom-parser": "^1.0.2",
Expand Down Expand Up @@ -54,8 +54,8 @@
"posttest-browser": "rm test/browser/page/tests-bundle.js",
"test": "npm run eslint && npm run test-node && npm run test-browser",
"travis-test": "npm run eslint && npm run test-node",
"browserify": "browserify src/cycle-web.js -t babelify --standalone CycleWeb --outfile dist/cycle-web.js",
"uglify": "uglifyjs dist/cycle-web.js -o dist/cycle-web.min.js",
"browserify": "browserify src/cycle-dom.js -t babelify --standalone CycleDOM --outfile dist/cycle-dom.js",
"uglify": "uglifyjs dist/cycle-dom.js -o dist/cycle-dom.min.js",
"dist": "npm run browserify && npm run uglify",
"docs": "node ./scripts/make-api-docs.js",
"precompile-lib": "rm -rf lib/ && mkdir -p lib",
Expand Down
2 changes: 1 addition & 1 deletion scripts/cycle-docs-template.md.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<? docfiles.forEach(function(doc) { ?>
# `CycleWeb` object API
# `CycleDOM` object API

<? doc.javadoc.forEach(function(comment) { ?>
<? if (!comment.ignore) { ?>
Expand Down
2 changes: 1 addition & 1 deletion scripts/make-api-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function generateDocs(options) {
}

generateDocs({
src: './src/cycle-web.js',
src: './src/cycle-dom.js',
output: './docs/api.md',
template: './scripts/cycle-docs-template.md.ejs'
});
6 changes: 3 additions & 3 deletions src/cycle-web.js → src/cycle-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let svg = require('virtual-dom/virtual-hyperscript/svg');
let {makeDOMDriver} = require('./render-dom');
let {makeHTMLDriver} = require('./render-html');

let CycleWeb = {
let CycleDOM = {
/**
* A factory for the DOM driver function. Takes a `container` to define the
* target on the existing DOM which this driver will operate on. All custom
Expand Down Expand Up @@ -61,7 +61,7 @@ let CycleWeb = {
* with Babel. Place the [Babel configuration comment](
* http://babeljs.io/docs/advanced/transformers/other/react/) `@jsx hJSX` at
* the top of the ES6 file, make sure you import `hJSX` with
* `import {hJSX} from '@cycle/web'`, and then you can use JSX to create
* `import {hJSX} from '@cycle/dom'`, and then you can use JSX to create
* VTrees.
* @name hJSX
*/
Expand All @@ -76,4 +76,4 @@ let CycleWeb = {
svg: svg
};

module.exports = CycleWeb;
module.exports = CycleDOM;
4 changes: 2 additions & 2 deletions test/browser/custom-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/* global describe, it, beforeEach */
let assert = require('assert');
let Cycle = require('@cycle/core');
let CycleWeb = require('../../src/cycle-web');
let CycleDOM = require('../../src/cycle-dom');
let {Rx} = Cycle;
let {h, makeDOMDriver} = CycleWeb;
let {h, makeDOMDriver} = CycleDOM;

function createRenderTarget() {
let element = document.createElement('div');
Expand Down
4 changes: 2 additions & 2 deletions test/browser/fixtures/issue-89.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';
let Cycle = require('@cycle/core');
let CycleWeb = require('../../../src/cycle-web');
let CycleDOM = require('../../../src/cycle-dom');
let {Rx} = Cycle;
let {h} = CycleWeb;
let {h} = CycleDOM;

function myElement(ext) {
return {
Expand Down
4 changes: 2 additions & 2 deletions test/browser/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* global describe, it, beforeEach */
let assert = require('assert');
let Cycle = require('@cycle/core');
let CycleWeb = require('../../src/cycle-web');
let CycleDOM = require('../../src/cycle-dom');
let Fixture89 = require('./fixtures/issue-89');
let {Rx} = Cycle;
let {h, hJSX, makeDOMDriver} = CycleWeb;
let {h, hJSX, makeDOMDriver} = CycleDOM;

function createRenderTarget() {
let element = document.createElement('div');
Expand Down
Loading

0 comments on commit dd0d4e3

Please sign in to comment.