Releases: MoOx/phenomic
0.12.1
- Added: setup now show examples for values to enter.
- Fixed: twitter and repo url in setup accept empty values
(#445) - Fixed: Should not show "Offline support is disabled in development mode"
when offline isn't enabled
(#448)
Boilerplate
- Updated:
stylelint
has been updated to^6.0.0
- Updated:
stylelint-config-standard
has been updated to^7.0.0
0.12.0
tl;dr;
Don't be afraid by the length of this release notes. It's for the better.
Most noticeable change occurs in the scripts
folder.
It might be a good idea is to take a look to the new folder of the default
boilerplate:
- There is now just 2 files:
phenomic.browser.js
(client runtime) and
phenomic.node.js
(for static build). - webpack configs can be moved at the root of you project and merged into a
single onewebpack.config.babel.js
. Phenomic specific configuration can be
removed (eg:entry
) and is now injected via Phenomic itself.
→ Example of update from phenomic 0.10 to 0.12
Details
- Fixed: Meta description should not contains new lines
(#414) - Removed: layouts now must be passed via props to
PageContainer
component.
This change has been introduced in0.10.0
but old way (via a
parameter in the formerscripts/build.js
andscripts/index-client.js
)
was still accepted.
If you do not have a warning in0.10.0
or newer, you won‘t be affected by
this change. - Removed: dev server does not pre-render anymore. During development, only
client side version is used. This is to avoid huge performance issue
introduced in[email protected]
. We might re-enable pre-rendering in a near
future.
See change below for more information
(#301) - Changed: dates of the front matter are now always strings,
for now,
until we serve pages as JavaScript (and not JSON).
By default the front-matter parsing method recognize dates as JavaScript dates
but when converted to JSON we end up with string.
The problem is that during the static build, we use date in memory
(real dates) and on the client, strings are used.
So, to ensure consistency, between static build and client build we are now
forcing string
(#397) - Changed: major refactoring to fix huge performance issue introduced in
[email protected]
(#301).
At the same time we introduced some internal changes, we have reduced the
required boilerplate and make some changes in order to simplify everything:- Removed:
scripts/config.js
. Configuration is now builded from a
"classic" webpack config. See change related to the webpack config below. - Removed:
scripts/webpack.config.client.js
content should be merged
with yourwebpack.config.babel.js
(please read the change below). - Changed:
scripts/webpack.config.babel.js
is now expected by default
to be found at the root of your project, like a classic webpack config.
Webpack configuration parts specific to Phenomic are now injected by
Phenomic itself.
Note that your config mustexport
amakeConfig
function.
This is required so Phenomic can easily create dynamic configurations.
This also prepare the upgrade to[email protected]
(which is in beta for a while, but starts to be
mature) that natively
allow webpack config to be exported as a function.
The path can be specified via an option (via CLI or config). - Removed:
scripts/build.js
in favor ofscripts/phenomic.node.js
.
The path can be specified via an option (via CLI or config).
Note that this file will be builded as
scripts/phenomic.node.bundle.js
for performance.
(New boilerplate (git)ignores*.bundle.js
files). - Changed:
scripts/index-client.js
is now
scripts/phenomic.browser.js
.
The path can be specified via an option (via CLI or config).
- Removed:
- Changed:
react-helmet@^3.0.0
is now required.
This brings us the ability to use all latestreact-helmet
's methods,
including:base
,link
,meta
,script
andhtmlAttributes
.
Check out react-helmet‘s documentation
for more information.
Except new features, no real breaking changes (except thatreact-helmet
don‘t includes some (may be) required polyfills by default).
You can upgrade by doing$ npm install react-helmet@^3.0.0 --save
(#348) - Changed:
PHENOMIC_PATHNAME
is nowPHENOMIC_USER_PATHNAME
.
But no need to update that in your configuration as it's injected
automatically. See changes in the boilerplate.
(#412) - Changed:
devPort
option must be a integer. - Changed:
content-loader
options that are defined in thephenomic
section of the webpack configuration should be defined under
contentLoader
, notloader
(even if this one is still supported for
now). - Changed:
content-loader
options are now taken fromquery
AND
phenomic.contentLoader
section (both are merged). - Added: unknown CLI args now throw errors
(#363) - Added: new injected constants in
process.env
:process.env.PHENOMIC_USER_URL
: your website homepage url
(package.json/homepage
field)process.env.PHENOMIC_USER_PATHNAME
: the base path of your website/appprocess.env.PHENOMIC_NAME
: Phenomic pretty nameprocess.env.PHENOMIC_VERSION
: Phenomic versionprocess.env.PHENOMIC_HOMEPAGE
: Phenomic homepage urlprocess.env.PHENOMIC_REPOSITORY
: Phenomic repository url
(#412 &
#361)
- Added: Warning for Service Worker when not using HTTPS
(#406)
Boilerplate
- Fixed: Meta og:url must be a full url
(#432 - Removed:
NODE_ENV
andPHENOMIC_PATHNAME
have been removed from the
boilerplate. These are now automatically defined.
(#412) - Changed: big changes in the
scripts
folder. Read note above. - Changed: lint command now ignore gitignored files in to be sure you don‘t
lint some builded files.
Note the--ignore-path .gitignore
part:
"lint:js": "eslint --ignore-path .gitignore --fix ."
- Changed:
content-loader
options are defined in the
phenomic.contentLoader
section of the webpack configuration so you can use
functions (eg: custom renderer). - Added: Polyfill CDN
to make sure your website work with old browsers as well.
(#348) - Added: (boilerplate) meta generator tag
(#361) - Added: Improve React's performance in production build by using
babel-preset-react-optimize
(#377) - Added: Use dynamic values for GitHub and Twitter.
(#419)
0.11.0
- Changed:
appcache
option has been deprecated and has been replaced by
theoffline
option. You should update your configuration accordingly.
Please refer https://phenomic.io/docs/advanced/offline-browsing/.
(#343) - Added: Initial support for Service Worker via
offline
option.
(#343,
#405)
Boilerplate
-
Removed: (boilerplate)
layouts/index.js
. It is not used since 0.10.0.
(#401) -
Added: Run lint process in parallel with npm-run-all
(#402) -
Added: (boilerplate) more layouts and components so new users have more
example to show list of entries:Homepage
layout that include a list of postsPost
layoutPagesList
component to easily show page previewPagePreview
to display page meta
(#71)
0.10.2
-
Fixed: replacement of some references that have been missed during the rename:
- STATINAMIC (in .js)
- statinamic (in .css).
To be sure, run the following commands.
$ npm remove --save-dev statinamic $ npm install --save-dev phenomic@^0.10.2 $ find . -type f \( -iname \*.css -o -iname \*.js -o -iname \*.json \) -not \( -path './.git/*' -o -path './node_modules/*' \) \ -exec sed -i '' 's|Statinamic|Phenomic|g' {} \; $ find . -type f \( -iname \*.css -o -iname \*.js -o -iname \*.json \) -not \( -path './.git/*' -o -path './node_modules/*' \) \ -exec sed -i '' 's|statinamic|phenomic|g' {} \; $ find . -type f \( -iname \*.css -o -iname \*.js -o -iname \*.json \) -not \( -path './.git/*' -o -path './node_modules/*' \) \ -exec sed -i '' 's|STATINAMIC|PHENOMIC|g' {} \;
-
Fixed: boilerplate now ship latest version of react-router, since
[email protected] fixes the issue that create homepage to be not rendered.
(#393)
0.10.1
- Fixed: boilerplate comes with [email protected] until
react-router#3307
is fixed
(#393) - Fixed: dev server show wrong log message about used port
Port 3000 is not available. Using port 3000 instead
.
(#392)
0.10.0
tl;dr;
- You can safely update from statinamic to phenomic without any changes in your
code except renaming the "S|statinamic" references (see instructions below). - Only one major breaking change, but previous method will probably still be
supported until 1.0 - More stuff in the default boilerplate (404, loading...)
→ Example of update from statinamic 0.9 to phenomic 0.10
Details
-
Changed: project has been renamed due to a possible confusion with a PHP CMS
called statamic.
Read more.
For an easy migration, you can simply run the following commands$ npm remove --save-dev statinamic $ npm install --save-dev phenomic $ find . -type f \( -iname \*.js -o -iname \*.json \) -not \( -path './.git/*' -o -path './node_modules/*' \) \ -exec sed -i '' 's|Statinamic|Phenomic|g' {} \; $ find . -type f \( -iname \*.js -o -iname \*.json \) -not \( -path './.git/*' -o -path './node_modules/*' \) \ -exec sed -i '' 's|statinamic|phenomic|g' {} \;
If you want to double check what files will be changed, just run
$ find . -type f \( -iname \*.js -o -iname \*.json \) -not \( -path './.git/*' -o -path './node_modules/*' \)
This will look for S|statinamic occurence and will replace it by P|phenomic in
all .js and .json files that are not in .git or in node_modules. -
Changed:
layouts
should not be defined in build and client scripts
anymore. This method will be deprecated in a future version.
Instead please directly passlayouts
in theroutes
definitions with a
HoC.
What are HoC? Higher order Component, more about this:- https://medium.com/@bloodyowl/the-provider-and-higher-order-component-patterns-with-react-d16ab2d1636
- http://jamesknelson.com/structuring-react-applications-higher-order-components/
- http://natpryce.com/articles/000814.html
Here is an example (based on the default boilerplate):
import React, { Component } from "react" import { Route } from "react-router" import LayoutContainer from "../LayoutContainer" import PhenomicPageContainer from "phenomic/lib/PageContainer" import Page from "../layouts/Page" import PageError from "../layouts/PageError" import PageLoading from "../layouts/PageLoading" import Homepage from "../layouts/Homepage" class PageContainer extends Component { render() { const { props } = this return ( <PhenomicPageContainer { ...props } layouts={ { Page, PageError, PageLoading, Homepage, } } /> ) } } export default ( <Route component={ LayoutContainer }> <Route path="*" component={ PageContainer } /> </Route> )
You should take a new look to the default boilerplate.
-
Added: Use node-portfinder to avoid error when port is used
(#320)
Boilerplate
-
Fixed:
PageError
warning about missing PropTypes
(#357). -
Changed: Bump css-loader to ^0.23.0. This may improve performance a little bit
(#374) -
Changed:
PageError
is nicer and now looks like documentation 404. -
Changed: Production build now produces short CSS classnames. You should apply this
change for a smaller HTML file.
(#385) -
Changed: upgrade of
stylelint
andstylelint-config-standard
to latest 5.x versions -
Added: a
PageLoading
component is now provided and include 2 indicators:- A topbar via
react-topbar-progress-indicator. - A simple CSS loading spinner.
(#182).
- A topbar via
-
Added: link to 404 and loading page in the footer, so new users can see and
try those easily.
0.9.3
0.9.2
0.9.1
0.9.0
→ Example of update from 0.8 to 0.9
tl;dr;
Breaking changes
md-collection-loader
has been renamed tocontent-loader
.- Default markdown parser is now remark but you can use anything you want, even
a non markdown parser (eg: latex, asciidocs...).
markdownIt
configuration is not supported any more but you can still use
the same engine, see details below. scripts/webpack.config.*.js
now needs to export function that accept
config as the first parameter.scripts/config.js
is now responsible for exporting webpack configurations.- (minor)
redux-devtools
andredux-thunk
have been removed
(redux
will become private soon anyway, or might even be dropped).
Minor changes
- Less boilerplate for commands to start/build.
Patches
- No more duplicates in collection.
- No more
main.*.css
files indist
. - Anchors in url are not being removed when clicking a link with an anchor.
- Network errors are not reported as 404 anymore, but as network errors.
Details
-
Changed: simplified boilerplate and "start" and "build" commands !
Be sure to checkout new (smaller) boilerplate.scripts/webpack.config.*.js
now needs to export function that accept
config as the first parameter.scripts/config.js
is now responsible for exporting webpack configurations.- You can replace
start
andbuild
npm scripts by
statinamic start/build
scripts/build.js
do not need to expose webpack configuration anymore
(since it's included inconfig
object).- You can now remove awkward babel env configuration from your babel
configuration. It's now handled secretly by default.
(that's whyconfig
must expose your webpack configurations) - You webpack configuration can now skip some tiny weird part specific to
statinamic.
-
Changed: Use localhost as default address to open new browser tab (for Windows
compatibility since Windows doesn't resolve 0.0.0.0 as localhost/127.0.0.1)
(#257) -
Changed:
md-collection-loader
has been renamed tocontent-loader
. -
Changed:
content-loader
now use remark
as the default markdown engine.- If you want to use the new engine, just remove your
markdownIt
section
in yourscripts/webpack.config.babel.js
configuration.
You will also probably need to update in your CSS references to
.markdownIt-Anchor
to.statinamic-HeadingAnchor
. - If you want to keep your current engine, just take the content of your
markdownIt
section, wrap it in a function and return.render()
method.-
Remove this of your
scripts/webpack.config.babel.js
// ... markdownIt: ( require("markdown-it")({ html: true, // ... }) .use(/* ... */) )
-
Add in the configuration of
content-loader
(formermd-collection-loader
)// ... { // statinamic requirement test: /\.md$/, loader: "statinamic/lib/content-loader", query: { context: path.join(config.cwd, config.source), // WRAP HERE renderer: (text) => ( require("markdown-it")({ html: true, // ... }) .use(/* ... */) .render(text) // ADD THIS ) // ... } )
-
- If you want to use the new engine, just remove your
-
Changed: Remove redux devtools and
process.env.CLIENT
environment variables.
Redux will probably become part of the private API, which will reduce
the boilerplate. In order to do that, we will gradually remove Redux from all
public interface (#40).
Here is the instruction to pull this change:-
Remove
redux-devtools
,redux-devtools-log-monitor
and
redux-devtools-dock-monitor
from your dependencies list. -
Remove these variables in webpack.config.client.js, DefinePlugin section:
process.env.REDUX_DEVTOOLS
process.env.CLIENT
: This is totally up you.
You can keep it if you use it.
We recommended you to use a more portable way to do this:
---if (process.env.CLIENT) { +++if (typeof window !== "undefined") { // client-side specific code }
See (#261) for details.
-
-
Removed: unused
redux-thunk
middleware.
(#279) -
Added:
content-loader
now accept any renderer.
You can provide your own callback to transform the text content into html
via therenderer
option.
See Configuration section of the documentation. -
Added: Support React to 15.x
-
Fixed:
statinamic/lib/enhance-collection
do not create duplicates anymore
(#200) -
Fixed: network errors will not appear as 404 error anymore
-
Fixed:
main.*.css
files are not produced anymore by the default boilerplate
(#214) -
Fixed: url with anchors are NOT being replaced with url without anchors
anymore
(#284) -
Added:
statinamic/lib/enhance-collection
will warn if filter callback
don’t return a boolean
Boilerplate (minor changes/improvements)
- Changed: Use
include
insteadexclude
to catch files to transform.
See changes inboilerplate/scripts/webpack.config.babel.js
- Changed: syntax change for css loaders section.
See changes inboilerplate/scripts/webpack.config.babel.js
- Changed:
content-loader
(formermd-collection-loader
) now
don't useJSON.stringify
anymore.
See changes inboilerplate/scripts/webpack.config.babel.js
(#209) - Changed: upgrade to eslint@2 and friends.
- Fixed: assets loader use the right context
(no big deal with default paths, but still).
See changes inboilerplate/scripts/webpack.config.babel.js