# ians-fw

> ians-fw, my best attempt at creating a custom web framework

Latest version **1.4.4** (published 2019-12-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install ians-fw
pnpm add ians-fw
yarn add ians-fw
bun add ians-fw
```

Provides the command `fw-script`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.4 |
| Published | 2019-12-28 |
| First published | 2019-09-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 16 |
| Unpacked size | 107.4 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | iansenne |

## Links

- npm: https://www.npmjs.com/package/ians-fw
- npm.io page: https://npm.io/package/ians-fw

## Dependencies (16)

- [fs](https://npm.io/package/fs.md) 0.0.1-security
- [path](https://npm.io/package/path.md) ^0.12.7
- [rollup](https://npm.io/package/rollup.md) ^1.21.4
- [express](https://npm.io/package/express.md) ^4.17.1
- [resolve](https://npm.io/package/resolve.md) ^1.13.1
- [typescript](https://npm.io/package/typescript.md) ^3.6.3
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.6.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.6.0
- [rollup-plugin-babel](https://npm.io/package/rollup-plugin-babel.md) ^4.3.3
- [rollup-plugin-uglify](https://npm.io/package/rollup-plugin-uglify.md) ^6.0.3
- [rollup-plugin-commonjs](https://npm.io/package/rollup-plugin-commonjs.md) ^10.1.0
- [rollup-plugin-filesize](https://npm.io/package/rollup-plugin-filesize.md) ^6.2.0
- [rollup-plugin-progress](https://npm.io/package/rollup-plugin-progress.md) ^1.1.1
- [rollup-plugin-multi-entry](https://npm.io/package/rollup-plugin-multi-entry.md) ^2.1.0
- [rollup-plugin-babel-minify](https://npm.io/package/rollup-plugin-babel-minify.md) ^9.1.0
- [rollup-plugin-node-resolve](https://npm.io/package/rollup-plugin-node-resolve.md) ^5.2.0

## Recent versions

- 1.4.4 (latest) — 2019-12-28
- 1.4.3 — 2019-12-22
- 1.4.2 — 2019-12-22
- 1.4.1-DEV — 2019-12-11
- 1.4.0-DEV — 2019-12-11
- 1.1.8-DEV — 2019-12-11
- 1.3.0-dev-5 — 2019-11-02
- 1.3.0-dev-4 — 2019-11-02
- 1.3.0-dev-3 — 2019-11-02
- 1.3.0-dev-2 — 2019-11-02
- 1.3.0-dev-1 — 2019-11-02
- 1.2.2-dev-1 — 2019-10-17
- 1.2.2-dev-0 — 2019-10-17
- 1.2.2-dev — 2019-10-16
- 1.2.1 — 2019-10-13
- … 14 more at https://npm.io/package/ians-fw/versions

## README

# ians-fw
by: Ian Senne

## Install

`$ npm i ians-fw`

## Features

- Basic support for ie11, edge, chrome, and firefox
- Comes with a developement server, and an fw-script command

### fw-scripts
for developement, `$ fw-scripts dev` will watch for file changes in the project and rebuild build file is exposed on the development server under `/~/index.js`, there is currently no live reloading.

in progress is `$ fw-scripts build` which will when done output a file or set of files for use in production.

### framework
ians-fw export an object with the following properties, `dom`, `StatefulData`, `stateJoin`, `css`, `Component`, and `verbose`
further mentions of `fw` will assume that fw is the result of importing `ians-fw`

####dom
`fw.dom(element_name/component,props|null,...children);`
returns a `VElement` or component instance

###StatefulData
`fw.StatefulData(value);`
returns an `OStatefulData` instance
(note: this object may behave differently depending on context)
###stateJoin
`fw.stateJoin(...values);`
returns an StatefulData like object which has a getter for value that will return a string concatination of all inputs, updates relient objects when any inputs of type `OStatefulData` or resulting from `fw.stateJoin` update

###css
`fw.css(rawstring,...parts);`
appends css given by template literal call to the frameworks generated style tag.
ex. ````fw.css`.test{color:red;}` ````

###Component
`fw.Component` is a class meant to be extended to create a class based component, used much like reacts `React.Component` object
###verbose
`fw.verbose`
returns an object which has a getter and setter for enabled and 3 functions, `fw.verbose.log(...contents)` `fw.verbose.warn(...contents)` and `fw.verbose.error(...contents)`




#Stateful Data

Stateful data will behave differently if used in a functional component vs a class based component, in a functional component state is not bound to the component but any element 
```jsx
import fw from 'ians-fw';
export function ExampleComponent(props){
	const count = fw.StatefulData(0);
	setInterval(()=>{count.value++;},1000);
	return <div>{count}</div>
}
```
count updating in this case will only update the content of the div instead of causing a rerender.

within class based components it is expected that any stateful data is defined within the constructor 
```jsx
import fw from 'ians-fw';
export class ExampleComponent extends fw.Component{
  constructor(props){
  		super(props);
		this.count = fw.StatefulData(0);
		setInterval(()=>{this.count.value++},1000);
   }
   render(){
   		return <div>{this.count.value}</div>
  }
}
```

in this case the stateful data is bound to the component and will queue a rerender whenever it updates.

---
_Source: https://npm.io/package/ians-fw · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
