Skip to content

Commit

Permalink
Merge pull request #8 from KevinAst/next3
Browse files Browse the repository at this point in the history
publish: v0.1.3 Establish Polyfill Strategy
  • Loading branch information
KevinAst authored Jul 2, 2018
2 parents e085aab + 9f959a2 commit fae1047
Show file tree
Hide file tree
Showing 6 changed files with 9,335 additions and 28 deletions.
34 changes: 22 additions & 12 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
{
"presets": ["es2015", "stage-1", "react"],
"env": {
"commonjs": {
"plugins": [
["transform-es2015-modules-commonjs", { "loose": true }]
// standard presets applying various plugins
presets: [
"env", // babel-preset-env: supporting es2015, es2016, and es2017 (with configuration)
"react" // babel-preset-react: react and jsx
],

// explicit plugins NOT part of the presets (above) ... prefer this over yearly presets
plugins: [
"transform-object-rest-spread", // "object rest properties" (es2018 Stage 4)
// ... ex: myFn({p1, p2, ...restParms})
],

// additional plugins explicitly called out via the BABEL_ENV variable
// ... see: build scripts in package.json
env: {
// BABEL_ENV=commonjs ... our CommonJS distribution (promoted in lib/ directory)
commonjs: {
plugins: [
["transform-es2015-modules-commonjs", { loose: true }]
]
},
"es": {
"plugins": [
// BABEL_ENV=es ... for our ES distribution (promoted in lib/ directory)
es: {
plugins: [
]
},
"test": {
"plugins": [
["transform-es2015-modules-commonjs", { "loose": true }]
]
}
}
}
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- "6"
- "7"
- "6" # NOTE: even numbers only (odds are node development)
- "8"
- "10"
- node # current node version (may be duplicate, but that's OK)
script:
- npm run prepublish # lint, clean, build (bundles), test (bundles)
Expand Down
85 changes: 81 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,85 @@
# Change Log

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

Each release, along with migration instructions, is documented on the
[Github Releases](https://github.com/KevinAst/feature-redux-logic/releases)
page.
Each release is documented on this page *(in addition to the [Github
Release Notes](https://github.com/KevinAst/feature-redux-logic/releases))*,
and **contains migration instructions**.

## Summary:

Release | What | *When*
---------|-------------------------------------------------|------------------
[v0.1.3] | Establish Polyfill Strategy | *July 2, 2018*
[v0.1.0] | Initial Release | *March 6, 2018*


[v0.1.3]: #v013---establish-polyfill-strategy-july-2-2018
[v0.1.0]: #v010---initial-release-march-6-2018



<!-- UNRELEASED **************************************************************************
TEMPLATE:
## vn.n.n - DESC *(DATE ?, 2018)*
[GitHub Content](https://github.com/KevinAst/feature-redux-logic/tree/vn.n.n)
&bull;
[GitHub Release](https://github.com/KevinAst/feature-redux-logic/releases/tag/vn.n.n)
&bull;
[Diff](see below)
RUNNING CONTENT (pop out as needed) ...
- adorn bullets with following bolded prefix
**Added**: ... for new features
**Changed**: ... for changes in existing functionality
**Deprecated**: ... for soon-to-be removed features
**Removed**: ... for now removed features
**Fixed**: ... for any bug fixes
**Enhanced**: ... for enhancements
**Security**: ... in case of vulnerabilities
**Docs**: ... changes in documentation
**Review**: ... requires review
**Internal**: ... internal change NOT affecting user/client
UNRELEASED ******************************************************************************** -->



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

## v0.1.3 - Establish Polyfill Strategy *(July 2, 2018)*

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

**NOTE**: This release is a **non-breaking change** _(i.e. no API was affected)_.

- **Review**: A new policy is in affect where **polyfills are the
responsibility of the client app**, when the target JavaScript
engine is inadequate _(such as the IE browser)_. Please refer to
[Potential Need for
Polyfills](./README.md#potential-need-for-polyfills) for more
information.

As a result, all previous code patches related to es2015+ polyfill
issues were removed, in favor of **polyfilling at the app-level**.

- **Internal**: The most current babel version/configuration is now
used to transpile the library's es5 distribution.


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

## v0.1.0 - Initial Release *(March 6, 2018)*
[GitHub Content](https://github.com/KevinAst/feature-redux-logic/tree/v0.1.0)
&bull;
[GitHub Release](https://github.com/KevinAst/feature-redux-logic/releases/tag/v0.1.0)

**This is where it all began ...**
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Let's see how this all works together ...
- [Error Conditions](#error-conditions)
- [API](#api)
- [`logicAspect: Aspect`](#logicaspect-aspect)
- [Potential Need for Polyfills](#potential-need-for-polyfills)



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

**SideBar**: Depending on how current your target browser is
_(i.e. it's JavaScript engine)_, you may need to polyfill your app
_(please refer to [Potential Need for
Polyfills](#potential-need-for-polyfills))_.
## Usage
Expand Down Expand Up @@ -326,6 +332,44 @@ Please refer to the [Usage] section for examples of this process.
</ul>
## Potential Need for Polyfills
The implementation of this library employs modern es2015+ JavaScript
constructs. Even though the library distribution is transpiled to
[es5](https://en.wikipedia.org/wiki/ECMAScript#5th_Edition) _(the
least common denominator)_, **polyfills may be required** if you are
using an antiquated JavaScript engine _(such as the IE browser)_.
We take the approach that **polyfills are the responsibility of the
client app**. This is a legitimate approach, as specified by the [W3C
Polyfill Findings](https://www.w3.org/2001/tag/doc/polyfills/)
_(specifically [Advice for library
authors](https://www.w3.org/2001/tag/doc/polyfills/#advice-for-library-and-framework-authors))_.
- polyfills should only be introduced one time _(during code expansion
of the app)_
- a library should not pollute the global name space _(by including
polyfills at the library level)_
- a library should not needlessly increase it's bundle size _(by
including polyfills that are unneeded in a majority of target
environments)_
As it turns out, **app-level polyfills are not hard to implement**,
with the advent of third-party utilities, such as babel:
- simply import [babel-polyfill](https://babeljs.io/docs/en/babel-polyfill.html)
- or use babel's
[babel-preset-env](https://babeljs.io/docs/en/babel-preset-env.html)
in conjunction with babel 7's `"useBuiltins": "usage"` option
**If your target JavaScript engine is inadequate, it will generate
native run-time errors, and you will need to address the polyfills.**
Unfortunately, in many cases these errors can be very obscure _(even
to seasoned developers)_. The following [Babel Feature
Request](https://github.com/babel/babel/issues/8089) _(if/when
implemented)_ is intended to address this issue.
<!--- *** REFERENCE LINKS *** --->
Expand Down
Loading

0 comments on commit fae1047

Please sign in to comment.