Skip to content

Commit

Permalink
update for release
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed May 25, 2019
1 parent f6e6bf3 commit 35f8dfb
Show file tree
Hide file tree
Showing 18 changed files with 3,207 additions and 819 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,21 @@
# Changelog

## 0.7.0 - 2019-05-25
v0.7.0 brings further improvements in tree shaking, Context API including Provide control flow, and suspense helpers for loading Async Components and Data.

This is a breaking change as in order to support this version, Solid has forked S.js the underlying library and now ships with it built in. This means Solid will no longer be compatible other S.js libraries. It is a turning point but enables the powerful new features.

## 0.6.0 - 2019-05-07
v0.6.0 brings a Tree Shakeable runtime. This means when Solid used with JSX the compiler can intelligently only include the code that is being used.

This is a breaking change in that:
* No longer need to import 'r' and selectWhen and selectEach directives have been moved to solid-js from solid-js/dom. You should not need to import from 'solid-js/dom' directly anymore as your compiled code will do it automatically.
* HyperScript and Lit imports have been made the default import now.. ex:
```js
import html from 'solid-js/html'
```
* Tidied up the compiled template code. This should make it much nicer to debug when not minified.

## 0.5.0 - 2019-04-14
- Add support for multiple renderers (JSX, Tagged Template Literals, HyperScript). Added direct imports or 'solid-js/dom' alternatives 'solid-js/html' and 'solid-js/h'.
- Reorganized dependencies work.
Expand Down
5 changes: 2 additions & 3 deletions README.md
Expand Up @@ -16,8 +16,7 @@ Solid is yet another declarative Javascript library for creating user interfaces
* Simple composable primitives without the hidden rules.
* Function Components with no need for lifecycle methods or specialized configuration objects.
* Less than 10% slower vs optimized painfully imperative vanilla DOM code. See Solid on [JS Framework Benchmark](https://github.com/krausest/js-framework-benchmark).
* Tiny in size, 7.07 kB minified and gzipped with all dependencies.
* Supports modern features like JSX Fragments, Portals, Suspense, and Asynchronous Rendering.
* Supports modern features like JSX Fragments, Context, Portals, Suspense, and Asynchronous Rendering.
* Webcomponent friendly
* Implicit event delegation with Shadow DOM Retargeting
* Shadow DOM Portals
Expand Down Expand Up @@ -252,7 +251,7 @@ I cover this in more detail in my Bring Your Own Framework Blog Series (links be
## Related Projects
* [Solid Element](https://github.com/ryansolid/solid-element)
Extensions to Solid.js that add a Web Component wrapper with a Context API, and Hot Module Replacement.
Extensions to Solid.js that add a Web Component wrapper and Hot Module Replacement.
* [DOM Expressions](https://github.com/ryansolid/dom-expressions)
The renderer behind Solid.js that enables lightning fast fine grained performance.
* [Babel Plugin JSX DOM Expressions](https://github.com/ryansolid/babel-plugin-jsx-dom-expressions)
Expand Down
30 changes: 27 additions & 3 deletions documentation/api.md
Expand Up @@ -8,9 +8,9 @@ Creates a new non-tracked context that doesn't auto-dispose. All Solid code shou

Creates a new State object and setState pair that can be used to maintain your componenents state.

### `createEffect(() => <code>, dependencies, defer)`
### `createEffect(prev => <code>, initialValue): void`

Creates a new effect that automatically tracks dependencies. The 2nd optional argument is an explicit array of dependencies. The 3rd optional argument is whether to defer initial execution of the effect until a value has changed (this only works with explicit dependencies).
Creates a new effect that automatically tracks dependencies. 2nd argument is the initial value.

### `createSignal(initialValue, comparatorFn): [getValueFn, setValueFn]`

Expand All @@ -20,6 +20,10 @@ Creates a new signal that can be used for reactive tracking. By default signals

Creates a readonly signal that recalculates it's value whenever the executed codes dependencies update.

### `createDependentEffect(() => <code>, dependencies, defer): void`

Creates a new effect that explicitly tracks dependencies. The 2nd optional argument is an explicit array of dependencies. The 3rd optional argument is whether to defer initial execution of the effect until a value has changed (this only works with explicit dependencies).

### `onCleanup(() => <code>)`

Registers a cleanup method that performs that executes on disposal or recalculation of the current context.
Expand All @@ -30,4 +34,24 @@ Ignores tracking any of the dependencies in the executing code block and returns

### `freeze(() => <code>): any`

Ensures that all updates within the block happen at the same time to prevent unnecessary recalculation. Solid State's setState method and computations(useEffect, useMemo) automatically wrap their code in freeze blocks.
Ensures that all updates within the block happen at the same time to prevent unnecessary recalculation. Solid State's setState method and computations(useEffect, useMemo) automatically wrap their code in freeze blocks.

### `createContext(initFn): Context`

Creates a new context object that can be used with useContext and the Provide control flow.

### `useContext(Context): any`

Hook to grab context to allow for deep passing of props with hierarchal resolution of dependencies without having to pass them through each Component function.

### `lazy(() => <Promise>): Component`

Used to lazy load components to allow for things like code splitting and Suspense.

### `loadResource(<Promise>): getValueFn`

Creates a memo that updates when promise is resolved. This plays into Suspend control flow.

### `setDefaults(props, defaultProps): void`

Sets default props for function components in case caller doesn't provide them.
2 changes: 1 addition & 1 deletion documentation/signals.md
Expand Up @@ -84,7 +84,7 @@ State and Signals combine wonderfully as wrapping a state selector in a function
const useReducer = (reducer, init) => {
const [state, setState] = createState(init),
[getAction, dispatch] = createSignal();
createEffect((prevState = init) => {
createDependentEffect((prevState = init) => {
let action, next;
if (!(action = getAction())) return prevState;
next = reducer(prevState, action);
Expand Down
11 changes: 6 additions & 5 deletions dom-expressions.config.js
Expand Up @@ -2,10 +2,11 @@ module.exports = {
output: 'src/dom/index.js',
includeTypes: true,
variables: {
imports: [ `import S from 's-js'` ],
computed: 'S',
sample: 'S.sample',
root: 'S.root',
cleanup: 'S.cleanup'
imports: [ `import {
createEffect as wrap, sample, createRoot as root,
onCleanup as cleanup, setContext, registerSuspense,
getContextOwner as currentContext
} from '../solid.js'` ],
includeContext: true
}
}

0 comments on commit 35f8dfb

Please sign in to comment.