Skip to content

Commit aadbdbf

Browse files
authored
Merge pull request #9 from KevinAst/next4_fassets
publish: v1.0.0 feature-u V1 Integration
2 parents fae1047 + fffc356 commit aadbdbf

File tree

8 files changed

+541
-281
lines changed

8 files changed

+541
-281
lines changed

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ and **contains migration instructions**.
1111

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

1718

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

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

5052

53+
<!-- *** RELEASE *************************************************************** -->
54+
55+
## v1.0.0 - feature-u V1 Integration *(August 14, 2018)*
56+
57+
[GitHub Content](https://github.com/KevinAst/feature-redux-logic/tree/v1.0.0)
58+
&bull;
59+
[GitHub Release](https://github.com/KevinAst/feature-redux-logic/releases/tag/v1.0.0)
60+
&bull;
61+
[Diff](https://github.com/KevinAst/feature-redux-logic/compare/v0.1.3...v1.0.0)
62+
63+
**NOTE**: This release contains **breaking changes** from prior
64+
releases _(i.e. a retrofit of client code is necessary)_.
65+
66+
- **Added/Removed**: Eliminate singletons in favor of creators
67+
68+
The singleton: `logicAspect`, has been replaced with a new creator:
69+
`createLogicAspect()`.
70+
71+
This is useful in both testing and server side rendering.
72+
73+
- **Review**: Integrate to [**feature-u V1**](https://feature-u.js.org/cur/history.html#v1_0_0)
74+
75+
**feature-u V1** has replaced the `app` object with a `fassets`
76+
object.
77+
78+
In general, this is not a change that would normally break a plugin,
79+
because app/fassets is a positional parameter that is merely passed
80+
through the plugin.
81+
82+
However, because **feature-redux-logic** auto injects the [`Fassets
83+
object`] as a dependency in your logic modules (promoting full
84+
[Cross Feature Communication]), the logic modules in your
85+
application code must reflect this change by renaming this named
86+
parameter from `app` to `fassets`, and utilize the new fassets API
87+
accordingly. Please refer to the [Usage] section for examples.
88+
89+
As a result, this plugin has now updated it's **feature-u**
90+
peerDependency to ">=1.0.0".
91+
5192

5293
<!-- *** RELEASE *************************************************************** -->
5394

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

85126
**This is where it all began ...**
127+
128+
129+
130+
131+
<!--- *** REFERENCE LINKS *** --->
132+
133+
[`Fassets object`]: https://feature-u.js.org/cur/api.html#Fassets
134+
[Cross Feature Communication]: https://feature-u.js.org/cur/crossCommunication.html
135+
[Usage]: README.md#usage

README.md

Lines changed: 52 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Let's see how this all works together ...
7070
npm install --save redux-logic
7171
```
7272
<!--- WITH REVEAL of USAGE:
73-
npm install --save feature-u # VER: >=0.1.0 USAGE: createAspect()
73+
npm install --save feature-u # VER: >=1.0.0 USAGE: createAspect() (v1 replaces App with Fassets obj -AND- publicFace with fassets aspect)
7474
npm install --save redux-logic # VER: >=0.7.0 USAGE: createLogicMiddleware()
7575
--->
7676

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

9999
**src/app.js**
100100
```js
101-
import {launchApp} from 'feature-u';
102-
import {reducerAspect} from 'feature-redux'; // **2**
103-
import {logicAspect} from 'feature-redux-logic'; // **1**
104-
import features from './feature';
101+
import {launchApp} from 'feature-u';
102+
import {createReducerAspect} from 'feature-redux'; // **2**
103+
import {createLogicAspect} from 'feature-redux-logic'; // **1**
104+
import features from './feature';
105105

106106
export default launchApp({
107107

108108
aspects: [
109-
reducerAspect, // **2**
110-
logicAspect, // **1**
109+
createReducerAspect(), // **2**
110+
createLogicAspect(), // **1**
111111
... other Aspects here
112112
],
113113

@@ -140,6 +140,31 @@ Polyfills](#potential-need-for-polyfills))_.
140140
});
141141
```
142142

143+
3. As a convenience, **feature-redux-logic** auto injects the
144+
**feature-u** [`Fassets object`] as a dependency in your logic
145+
modules. This promotes full [Cross Feature Communication].
146+
147+
The following example, demonstrates the availability of the
148+
`fassets` named parameter:
149+
150+
```js
151+
import {createLogic} from 'redux-logic';
152+
153+
export const someLogic = createLogic({
154+
155+
... snip snip
156+
157+
transform({getState, action, fassets}, next, reject) {
158+
... fassets may be used for cross-feature-communication
159+
},
160+
161+
process({getState, action, fassets}, dispatch, done) {
162+
... fassets may be used for cross-feature-communication
163+
}
164+
165+
});
166+
```
167+
143168

144169
**Well that was easy!!** At this point **redux-logic** is **completely
145170
setup for your application!**
@@ -157,9 +182,9 @@ truly opaque assets _(internal to the feature)_, they are of interest
157182
to **feature-redux-logic** to the extent that they are needed to configure
158183
[redux-logic].
159184

160-
Because logic modules may require access to **feature-u**'s [`App`]
161-
object during code expansion, this property can also be a
162-
**feature-u** [`managedExpansion()`] callback _(a function that
185+
Because logic modules may require access to **feature-u**'s [`Fassets
186+
object`] during code expansion, this property can also be a
187+
**feature-u** [`expandWithFassets()`] callback _(a function that
163188
returns the logic modules)_ ... please refer to **feature-u**'s
164189
discussion of [Managed Code Expansion].
165190

@@ -204,7 +229,7 @@ export const doSomething = createLogic({
204229
... snip snip
205230
},
206231

207-
process({getState, action, app}, dispatch, done) {
232+
process({getState, action, fassets}, dispatch, done) {
208233
... snip snip
209234
}
210235

@@ -275,6 +300,11 @@ process (_i.e. the inputs and outputs_) are documented here.
275300
component must be consumed by yet another aspect (_such as
276301
[feature-redux]_) that in turn manages [redux].
277302

303+
- As a convenience, **feature-redux-logic** auto injects the
304+
**feature-u** [`Fassets object`] as a dependency in your logic
305+
modules. This promotes full [Cross Feature Communication].
306+
Please refer to the [Usage] section for examples.
307+
278308

279309
### Error Conditions
280310

@@ -315,6 +345,8 @@ modules were specified by your features.
315345

316346
<ul><!--- indentation hack for github - other attempts with style is stripped (be careful with number bullets) --->
317347

348+
`API: createLogicAspect([name='logic']): logicAspect`
349+
318350
The `logicAspect` is the [feature-u] plugin that facilitates
319351
[redux-logic] integration to your features.
320352

@@ -383,14 +415,15 @@ implemented)_ is intended to address this issue.
383415

384416

385417
<!--- feature-u --->
386-
[feature-u]: https://feature-u.js.org/
387-
[`launchApp()`]: https://feature-u.js.org/cur/api.html#launchApp
388-
[`createFeature()`]: https://feature-u.js.org/cur/api.html#createFeature
389-
[`managedExpansion()`]: https://feature-u.js.org/cur/api.html#managedExpansion
390-
[publicFace]: https://feature-u.js.org/cur/crossCommunication.html#publicface-and-the-app-object
391-
[`Feature`]: https://feature-u.js.org/cur/api.html#Feature
392-
[`App`]: https://feature-u.js.org/cur/api.html#App
393-
[Managed Code Expansion]: https://feature-u.js.org/cur/crossCommunication.html#managed-code-expansion
418+
[feature-u]: https://feature-u.js.org/
419+
[`launchApp()`]: https://feature-u.js.org/cur/api.html#launchApp
420+
[`createFeature()`]: https://feature-u.js.org/cur/api.html#createFeature
421+
[`expandWithFassets()`]: https://feature-u.js.org/cur/api.html#expandWithFassets
422+
[`Feature`]: https://feature-u.js.org/cur/api.html#Feature
423+
[`Fassets object`]: https://feature-u.js.org/cur/api.html#Fassets
424+
[Managed Code Expansion]: https://feature-u.js.org/cur/crossCommunication.html#managed-code-expansion
425+
[Cross Feature Communication]: https://feature-u.js.org/cur/crossCommunication.html
426+
394427

395428
<!--- react --->
396429
[react]: https://reactjs.org/

0 commit comments

Comments
 (0)