Skip to content

Commit

Permalink
Merge pull request #9 from KevinAst/next4_fassets
Browse files Browse the repository at this point in the history
publish: v1.0.0 feature-u V1 Integration
  • Loading branch information
KevinAst authored Aug 14, 2018
2 parents fae1047 + fffc356 commit aadbdbf
Show file tree
Hide file tree
Showing 8 changed files with 541 additions and 281 deletions.
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ and **contains migration instructions**.

Release | What | *When*
---------|-------------------------------------------------|------------------
[v1.0.0] | feature-u V1 Integration | *August 14, 2018*
[v0.1.3] | Establish Polyfill Strategy | *July 2, 2018*
[v0.1.0] | Initial Release | *March 6, 2018*


[v1.0.0]: #v100---feature-u-v1-integration-august-14-2018
[v0.1.3]: #v013---establish-polyfill-strategy-july-2-2018
[v0.1.0]: #v010---initial-release-march-6-2018

Expand Down Expand Up @@ -48,6 +50,45 @@ RUNNING CONTENT (pop out as needed) ...
UNRELEASED ******************************************************************************** -->


<!-- *** RELEASE *************************************************************** -->

## v1.0.0 - feature-u V1 Integration *(August 14, 2018)*

[GitHub Content](https://github.com/KevinAst/feature-redux-logic/tree/v1.0.0)
&bull;
[GitHub Release](https://github.com/KevinAst/feature-redux-logic/releases/tag/v1.0.0)
&bull;
[Diff](https://github.com/KevinAst/feature-redux-logic/compare/v0.1.3...v1.0.0)

**NOTE**: This release contains **breaking changes** from prior
releases _(i.e. a retrofit of client code is necessary)_.

- **Added/Removed**: Eliminate singletons in favor of creators

The singleton: `logicAspect`, has been replaced with a new creator:
`createLogicAspect()`.

This is useful in both testing and server side rendering.

- **Review**: Integrate to [**feature-u V1**](https://feature-u.js.org/cur/history.html#v1_0_0)

**feature-u V1** has replaced the `app` object with a `fassets`
object.

In general, this is not a change that would normally break a plugin,
because app/fassets is a positional parameter that is merely passed
through the plugin.

However, because **feature-redux-logic** auto injects the [`Fassets
object`] as a dependency in your logic modules (promoting full
[Cross Feature Communication]), the logic modules in your
application code must reflect this change by renaming this named
parameter from `app` to `fassets`, and utilize the new fassets API
accordingly. Please refer to the [Usage] section for examples.

As a result, this plugin has now updated it's **feature-u**
peerDependency to ">=1.0.0".


<!-- *** RELEASE *************************************************************** -->

Expand Down Expand Up @@ -83,3 +124,12 @@ UNRELEASED *********************************************************************
[GitHub Release](https://github.com/KevinAst/feature-redux-logic/releases/tag/v0.1.0)

**This is where it all began ...**




<!--- *** REFERENCE LINKS *** --->

[`Fassets object`]: https://feature-u.js.org/cur/api.html#Fassets
[Cross Feature Communication]: https://feature-u.js.org/cur/crossCommunication.html
[Usage]: README.md#usage
71 changes: 52 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Let's see how this all works together ...
npm install --save redux-logic
```
<!--- WITH REVEAL of USAGE:
npm install --save feature-u # VER: >=0.1.0 USAGE: createAspect()
npm install --save feature-u # VER: >=1.0.0 USAGE: createAspect() (v1 replaces App with Fassets obj -AND- publicFace with fassets aspect)
npm install --save redux-logic # VER: >=0.7.0 USAGE: createLogicMiddleware()
--->

Expand Down Expand Up @@ -98,16 +98,16 @@ Polyfills](#potential-need-for-polyfills))_.

**src/app.js**
```js
import {launchApp} from 'feature-u';
import {reducerAspect} from 'feature-redux'; // **2**
import {logicAspect} from 'feature-redux-logic'; // **1**
import features from './feature';
import {launchApp} from 'feature-u';
import {createReducerAspect} from 'feature-redux'; // **2**
import {createLogicAspect} from 'feature-redux-logic'; // **1**
import features from './feature';
export default launchApp({
aspects: [
reducerAspect, // **2**
logicAspect, // **1**
createReducerAspect(), // **2**
createLogicAspect(), // **1**
... other Aspects here
],
Expand Down Expand Up @@ -140,6 +140,31 @@ Polyfills](#potential-need-for-polyfills))_.
});
```

3. As a convenience, **feature-redux-logic** auto injects the
**feature-u** [`Fassets object`] as a dependency in your logic
modules. This promotes full [Cross Feature Communication].

The following example, demonstrates the availability of the
`fassets` named parameter:

```js
import {createLogic} from 'redux-logic';
export const someLogic = createLogic({
... snip snip
transform({getState, action, fassets}, next, reject) {
... fassets may be used for cross-feature-communication
},
process({getState, action, fassets}, dispatch, done) {
... fassets may be used for cross-feature-communication
}
});
```


**Well that was easy!!** At this point **redux-logic** is **completely
setup for your application!**
Expand All @@ -157,9 +182,9 @@ truly opaque assets _(internal to the feature)_, they are of interest
to **feature-redux-logic** to the extent that they are needed to configure
[redux-logic].
Because logic modules may require access to **feature-u**'s [`App`]
object during code expansion, this property can also be a
**feature-u** [`managedExpansion()`] callback _(a function that
Because logic modules may require access to **feature-u**'s [`Fassets
object`] during code expansion, this property can also be a
**feature-u** [`expandWithFassets()`] callback _(a function that
returns the logic modules)_ ... please refer to **feature-u**'s
discussion of [Managed Code Expansion].
Expand Down Expand Up @@ -204,7 +229,7 @@ export const doSomething = createLogic({
... snip snip
},
process({getState, action, app}, dispatch, done) {
process({getState, action, fassets}, dispatch, done) {
... snip snip
}
Expand Down Expand Up @@ -275,6 +300,11 @@ process (_i.e. the inputs and outputs_) are documented here.
component must be consumed by yet another aspect (_such as
[feature-redux]_) that in turn manages [redux].
- As a convenience, **feature-redux-logic** auto injects the
**feature-u** [`Fassets object`] as a dependency in your logic
modules. This promotes full [Cross Feature Communication].
Please refer to the [Usage] section for examples.
### Error Conditions
Expand Down Expand Up @@ -315,6 +345,8 @@ modules were specified by your features.
<ul><!--- indentation hack for github - other attempts with style is stripped (be careful with number bullets) --->
`API: createLogicAspect([name='logic']): logicAspect`
The `logicAspect` is the [feature-u] plugin that facilitates
[redux-logic] integration to your features.
Expand Down Expand Up @@ -383,14 +415,15 @@ implemented)_ is intended to address this issue.
<!--- feature-u --->
[feature-u]: https://feature-u.js.org/
[`launchApp()`]: https://feature-u.js.org/cur/api.html#launchApp
[`createFeature()`]: https://feature-u.js.org/cur/api.html#createFeature
[`managedExpansion()`]: https://feature-u.js.org/cur/api.html#managedExpansion
[publicFace]: https://feature-u.js.org/cur/crossCommunication.html#publicface-and-the-app-object
[`Feature`]: https://feature-u.js.org/cur/api.html#Feature
[`App`]: https://feature-u.js.org/cur/api.html#App
[Managed Code Expansion]: https://feature-u.js.org/cur/crossCommunication.html#managed-code-expansion
[feature-u]: https://feature-u.js.org/
[`launchApp()`]: https://feature-u.js.org/cur/api.html#launchApp
[`createFeature()`]: https://feature-u.js.org/cur/api.html#createFeature
[`expandWithFassets()`]: https://feature-u.js.org/cur/api.html#expandWithFassets
[`Feature`]: https://feature-u.js.org/cur/api.html#Feature
[`Fassets object`]: https://feature-u.js.org/cur/api.html#Fassets
[Managed Code Expansion]: https://feature-u.js.org/cur/crossCommunication.html#managed-code-expansion
[Cross Feature Communication]: https://feature-u.js.org/cur/crossCommunication.html
<!--- react --->
[react]: https://reactjs.org/
Expand Down
Loading

0 comments on commit aadbdbf

Please sign in to comment.