Skip to content

Commit fae1047

Browse files
authored
Merge pull request #8 from KevinAst/next3
publish: v0.1.3 Establish Polyfill Strategy
2 parents e085aab + 9f959a2 commit fae1047

File tree

6 files changed

+9335
-28
lines changed

6 files changed

+9335
-28
lines changed

.babelrc

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
{
2-
"presets": ["es2015", "stage-1", "react"],
3-
"env": {
4-
"commonjs": {
5-
"plugins": [
6-
["transform-es2015-modules-commonjs", { "loose": true }]
2+
// standard presets applying various plugins
3+
presets: [
4+
"env", // babel-preset-env: supporting es2015, es2016, and es2017 (with configuration)
5+
"react" // babel-preset-react: react and jsx
6+
],
7+
8+
// explicit plugins NOT part of the presets (above) ... prefer this over yearly presets
9+
plugins: [
10+
"transform-object-rest-spread", // "object rest properties" (es2018 Stage 4)
11+
// ... ex: myFn({p1, p2, ...restParms})
12+
],
13+
14+
// additional plugins explicitly called out via the BABEL_ENV variable
15+
// ... see: build scripts in package.json
16+
env: {
17+
// BABEL_ENV=commonjs ... our CommonJS distribution (promoted in lib/ directory)
18+
commonjs: {
19+
plugins: [
20+
["transform-es2015-modules-commonjs", { loose: true }]
721
]
822
},
9-
"es": {
10-
"plugins": [
23+
// BABEL_ENV=es ... for our ES distribution (promoted in lib/ directory)
24+
es: {
25+
plugins: [
1126
]
1227
},
13-
"test": {
14-
"plugins": [
15-
["transform-es2015-modules-commonjs", { "loose": true }]
16-
]
17-
}
1828
}
1929
}

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: node_js
22
node_js:
3-
- "6"
4-
- "7"
3+
- "6" # NOTE: even numbers only (odds are node development)
54
- "8"
5+
- "10"
66
- node # current node version (may be duplicate, but that's OK)
77
script:
88
- npm run prepublish # lint, clean, build (bundles), test (bundles)

CHANGELOG.md

Lines changed: 81 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,85 @@
11
# Change Log
22

3-
The **feature-redux-logic**project adheres to [Semantic
3+
The **feature-redux-logic** project adheres to [Semantic
44
Versioning](http://semver.org/).
55

6-
Each release, along with migration instructions, is documented on the
7-
[Github Releases](https://github.com/KevinAst/feature-redux-logic/releases)
8-
page.
6+
Each release is documented on this page *(in addition to the [Github
7+
Release Notes](https://github.com/KevinAst/feature-redux-logic/releases))*,
8+
and **contains migration instructions**.
9+
10+
## Summary:
11+
12+
Release | What | *When*
13+
---------|-------------------------------------------------|------------------
14+
[v0.1.3] | Establish Polyfill Strategy | *July 2, 2018*
15+
[v0.1.0] | Initial Release | *March 6, 2018*
16+
17+
18+
[v0.1.3]: #v013---establish-polyfill-strategy-july-2-2018
19+
[v0.1.0]: #v010---initial-release-march-6-2018
20+
21+
22+
23+
<!-- UNRELEASED **************************************************************************
24+
25+
TEMPLATE:
26+
## vn.n.n - DESC *(DATE ?, 2018)*
27+
28+
[GitHub Content](https://github.com/KevinAst/feature-redux-logic/tree/vn.n.n)
29+
&bull;
30+
[GitHub Release](https://github.com/KevinAst/feature-redux-logic/releases/tag/vn.n.n)
31+
&bull;
32+
[Diff](see below)
33+
34+
RUNNING CONTENT (pop out as needed) ...
35+
36+
- adorn bullets with following bolded prefix
37+
**Added**: ... for new features
38+
**Changed**: ... for changes in existing functionality
39+
**Deprecated**: ... for soon-to-be removed features
40+
**Removed**: ... for now removed features
41+
**Fixed**: ... for any bug fixes
42+
**Enhanced**: ... for enhancements
43+
**Security**: ... in case of vulnerabilities
44+
**Docs**: ... changes in documentation
45+
**Review**: ... requires review
46+
**Internal**: ... internal change NOT affecting user/client
47+
48+
UNRELEASED ******************************************************************************** -->
49+
50+
51+
52+
<!-- *** RELEASE *************************************************************** -->
53+
54+
## v0.1.3 - Establish Polyfill Strategy *(July 2, 2018)*
55+
56+
[GitHub Content](https://github.com/KevinAst/feature-redux-logic/tree/v0.1.3)
57+
&bull;
58+
[GitHub Release](https://github.com/KevinAst/feature-redux-logic/releases/tag/v0.1.3)
59+
&bull;
60+
[Diff](https://github.com/KevinAst/feature-redux-logic/compare/v0.1.0...v0.1.3)
61+
62+
**NOTE**: This release is a **non-breaking change** _(i.e. no API was affected)_.
63+
64+
- **Review**: A new policy is in affect where **polyfills are the
65+
responsibility of the client app**, when the target JavaScript
66+
engine is inadequate _(such as the IE browser)_. Please refer to
67+
[Potential Need for
68+
Polyfills](./README.md#potential-need-for-polyfills) for more
69+
information.
70+
71+
As a result, all previous code patches related to es2015+ polyfill
72+
issues were removed, in favor of **polyfilling at the app-level**.
73+
74+
- **Internal**: The most current babel version/configuration is now
75+
used to transpile the library's es5 distribution.
76+
77+
78+
<!-- *** RELEASE *************************************************************** -->
79+
80+
## v0.1.0 - Initial Release *(March 6, 2018)*
81+
[GitHub Content](https://github.com/KevinAst/feature-redux-logic/tree/v0.1.0)
82+
&bull;
83+
[GitHub Release](https://github.com/KevinAst/feature-redux-logic/releases/tag/v0.1.0)
84+
85+
**This is where it all began ...**

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Let's see how this all works together ...
5656
- [Error Conditions](#error-conditions)
5757
- [API](#api)
5858
- [`logicAspect: Aspect`](#logicaspect-aspect)
59+
- [Potential Need for Polyfills](#potential-need-for-polyfills)
5960

6061

6162

@@ -79,6 +80,11 @@ Let's see how this all works together ...
7980
npm install --save feature-redux-logic
8081
```
8182

83+
**SideBar**: Depending on how current your target browser is
84+
_(i.e. it's JavaScript engine)_, you may need to polyfill your app
85+
_(please refer to [Potential Need for
86+
Polyfills](#potential-need-for-polyfills))_.
87+
8288

8389
## Usage
8490

@@ -326,6 +332,44 @@ Please refer to the [Usage] section for examples of this process.
326332
</ul>
327333

328334

335+
## Potential Need for Polyfills
336+
337+
The implementation of this library employs modern es2015+ JavaScript
338+
constructs. Even though the library distribution is transpiled to
339+
[es5](https://en.wikipedia.org/wiki/ECMAScript#5th_Edition) _(the
340+
least common denominator)_, **polyfills may be required** if you are
341+
using an antiquated JavaScript engine _(such as the IE browser)_.
342+
343+
We take the approach that **polyfills are the responsibility of the
344+
client app**. This is a legitimate approach, as specified by the [W3C
345+
Polyfill Findings](https://www.w3.org/2001/tag/doc/polyfills/)
346+
_(specifically [Advice for library
347+
authors](https://www.w3.org/2001/tag/doc/polyfills/#advice-for-library-and-framework-authors))_.
348+
349+
- polyfills should only be introduced one time _(during code expansion
350+
of the app)_
351+
- a library should not pollute the global name space _(by including
352+
polyfills at the library level)_
353+
- a library should not needlessly increase it's bundle size _(by
354+
including polyfills that are unneeded in a majority of target
355+
environments)_
356+
357+
As it turns out, **app-level polyfills are not hard to implement**,
358+
with the advent of third-party utilities, such as babel:
359+
360+
- simply import [babel-polyfill](https://babeljs.io/docs/en/babel-polyfill.html)
361+
- or use babel's
362+
[babel-preset-env](https://babeljs.io/docs/en/babel-preset-env.html)
363+
in conjunction with babel 7's `"useBuiltins": "usage"` option
364+
365+
**If your target JavaScript engine is inadequate, it will generate
366+
native run-time errors, and you will need to address the polyfills.**
367+
Unfortunately, in many cases these errors can be very obscure _(even
368+
to seasoned developers)_. The following [Babel Feature
369+
Request](https://github.com/babel/babel/issues/8089) _(if/when
370+
implemented)_ is intended to address this issue.
371+
372+
329373

330374

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

0 commit comments

Comments
 (0)