Releases: bensmithett/tropical
10.0.0: [BROKEN] Move to ES Modules at the project level
Changes
This version is broken, use 10.1.0 instead
We've been stuck for a while because a dependency switched to Pure ESM and Vite's --config
didn't let us make the switch #28
This version moves the whole project to ES Modules by setting "type": "module"
in package.json
.
Upgrade instructions (more info)
Merge upstream changes
First, configure this repo as a remote for your repo (you only need to do this once)
git remote add template https://github.com/bensmithett/tropical.git
Then fetch & merge the latest changes, resolving any conflicts manually:
git fetch template
git merge template/master
or...
Manually update your code
See https://github.com/bensmithett/tropical/pull/38/files, you'll need to:
- In
package.json
add"type": "module"
and remove theyarn build:server
script - Rename
.storybook/main.js
to.storybook/main.cjs
yarn outdated
and upgrade the outdated dependencies.- Copy the changes from
prerender.js
server.js
vite.config.js
- Delete
vite.config.server.js
9.2.0: MDX stories and a new dev server port
9.1.0: Minor syntax highlighting change
Changes
TropicalCodeBlock
uses thedracula
Prism theme by default- Added instructions for adding extra languages to syntax highlighting
Upgrade instructions
See the change in d32e7de
9.0.0: Bye Webpack, hi Vite!
Changes
This is a major rewrite. Sorry. But the good news is migrating the pages, components & layouts from your Tropical <8.0.1 site to 9.0.0 should be straightforward. It's just everything around your content that has changed.
(If you find this isn't true, please open an issue and I'll update the upgrade instructions as necessary.)
- Vite replaces all the stuff we were previously cobbling together with Webpack, Babel, Serve, and quite a bit of custom code. The custom code that does exist (for the dev server & prerendering) is mostly copied straight from Vite's SSR Guide.
- MDX support now comes from vite-plugin-mdx. It still supports the rehype or remark plugins we were using before.
Upgrade instructions
The easiest approach will be to start with a new Tropical 9.0.0 site, then copy across your existing pages, components, layouts and client-side JS. (Of course when this is all done, you can commit it all to your existing git repo.)
See #27 for the commit-by-commit process I took to update this repo.
Here are the main tweaks you'll need to make:
- Your content now lives in
src
rather thanapp
- Pages:
- File extensions are now either
.mdx
or.jsx
..js
won't work for files that contain JSX, and.md
won't work for MDX files. meta.collection
has been replaced with themeta.tags
array. A JSON feed/posts.json
is generated for pages containing thepost
tag.
- File extensions are now either
- Layouts:
- Now use react-head instead of react-helmet
- JSON Feed:
- The default feed has changed from
/feed.json
to/posts.json
. Renamesrc/feeds/posts.jsx
if you don't want to lost all your subscribers!
- The default feed has changed from
- Client side JS:
client.js
is nowsrc/entry-client.jsx
. You can still put whatever you want in here.- If you were using the old
hydrationHelpers
, that functionality now lives in a standalone package tropical-islands.- Instead of
asIsland
, use<Island>
. It accomplishes the same thing, but you don't need to export extra components now.
- Instead of
- Production static site build:
- The new output directory is
dist/static
- The new output directory is
8.0.1: Upgrade outdated dependencies
Changes
Upgraded outdated dependencies 77044f9 (major version bumps for concurrently
and rehype-slug
)
Upgrade instructions (more info)
Merge upstream changes
First, configure this repo as a remote for your repo (you only need to do this once)
git remote add template https://github.com/bensmithett/tropical.git
Then fetch & merge the latest changes, resolving any conflicts manually:
git fetch template
git merge template/master
or...
Manually update your code
yarn outdated
and upgrade the outdated dependencies.
8.0.0: Webpack 5 & React 17
Changes
- Update
.node-version
to latest LTS version 14.15.4 (no code changes required) - Upgrade minor and patch dependency versions with
yarn upgrade-interactive
(no code changes required) - Upgrade react and react-dom to 17.0.1 (no code changes required)
- Following Webpack's guide for migrating to v5
- Upgrade webpack-manifest-plugin to 3.0.0
- Now exports a named
WebpackManifestPlugin
instead of the default export (see bb40baf)
- Now exports a named
- Upgrade webpack to 5.21.2
- Changed the static files module rule to use Webpack's Asset Modules rather than manually using file-loader (see d129404)
- Removed file-loader
- Upgrade webpack-manifest-plugin to 3.0.0
Upgrade instructions (more info)
Merge upstream changes
First, configure this repo as a remote for your repo (you only need to do this once)
git remote add template https://github.com/bensmithett/tropical.git
Then fetch & merge the latest changes, resolving any conflicts manually:
git fetch template
git merge template/master
or...
Manually update your code
- Update
.node-version
to latest LTS version 14.15.4 (no code changes required) - Upgrade minor and patch dependency versions with
yarn upgrade-interactive
(no code changes required) - Upgrade react and react-dom to 17.0.1 with
yarn upgrade react@latest react-dom@latest
(no code changes required) - Following Webpack's guide for migrating to v5
- Upgrade webpack-manifest-plugin to 3.0.0 with
yarn upgrade webpack-manifest-plugin@latest
- Now exports a named
WebpackManifestPlugin
instead of the default export (see bb40baf)
- Now exports a named
- Upgrade webpack to 5.21.2 with
yarn upgrade webpack@latest
- Change the static files module rule to use Webpack's Asset Modules rather than manually using file-loader (see d129404)
- Remove file-loader with
yarn remove file-loader
- Upgrade webpack-manifest-plugin to 3.0.0 with
7.1.0: Storybook 6
Changes
- Performed some minor dependency upgrades: 8599fc3
- Followed the Storybook 6 migration guide: 8c55e48
Upgrade instructions (more info)
Merge upstream changes
First, configure this repo as a remote for your repo (you only need to do this once)
git remote add template https://github.com/bensmithett/tropical.git
Then fetch & merge the latest changes, resolving any conflicts manually:
git fetch template
git merge template/master
or...
Manually update your code
- Follow the Storybook 6 migration guide
- Run
yarn upgrade-interactive
to upgrade any other outdated dependencies
7.0.2: Filter feed items without dates
Changes
See #18
Filters collection items out of the JSON Feed if they don't have a valid date.
Upgrade instructions (more info)
Merge upstream changes
First, configure this repo as a remote for your repo (you only need to do this once)
git remote add template https://github.com/bensmithett/tropical.git
Then fetch & merge the latest changes, resolving any conflicts manually:
git fetch template
git merge template/master
or...
Manually update your code
See the change diff here: https://github.com/bensmithett/tropical/pull/18/files?w=1
- Add the
filter
- Replace
new Date
withdayjs
7.0.1: Handle empty feed collection
Changes
See b9ec81a
Handles empty feed collections
Upgrade instructions (more info)
Merge upstream changes
First, configure this repo as a remote for your repo (you only need to do this once)
git remote add template https://github.com/bensmithett/tropical.git
Then fetch & merge the latest changes, resolving any conflicts manually:
git fetch template
git merge template/master
or...
Manually update your code
Make the one-line change in b9ec81a
7.0.0: Configurable collections and Day.js
Changes
See #17
- The
posts
collection no longer has any special hardcoded behaviour. Instead it's just another collection.- Pages now receive a
collections
prop instead of aposts
prop - The collection used to generate the JSON feed is configured in package.json with
tropical.feedCollection
- Pages now receive a
- Collection sorting now uses Day.js under the hood. It's a dependency so it can be used for all your date and time needs.
Upgrade instructions (more info)
Merge upstream changes
First, configure this repo as a remote for your repo (you only need to do this once)
git remote add template https://github.com/bensmithett/tropical.git
Then fetch & merge the latest changes, resolving any conflicts manually:
git fetch template
git merge template/master
or...
Manually update your code
- Install Day.js:
yarn add dayjs
- Update
prerender.js
as per https://github.com/bensmithett/tropical/pull/17/files#diff-36c4430d199533126f4c93fec3350cbd- Import
dayjs
and configure with theisSameOrBefore
plugin https://github.com/bensmithett/tropical/pull/17/files#diff-36c4430d199533126f4c93fec3350cbdR20-R22 - Add the
gatherCollections
function and delete the existingcollectPosts
function - Update the
buildJSONFeed
function to use the collection defined intropical.feedCollection
rather than the hardcodedposts
collection https://github.com/bensmithett/tropical/pull/17/files#diff-36c4430d199533126f4c93fec3350cbdR154-R155
- Import
- Add
tropical.feedCollection
to your package.json https://github.com/bensmithett/tropical/pull/17/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R37 - Change this line in
build.js
to get a better stack trace when something breaks in your prerender function https://github.com/bensmithett/tropical/pull/17/files#diff-642903a5178e20be297fb90c571826a2R187