→ 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