Skip to content

v0.25.0

Compare
Choose a tag to compare
@thescientist13 thescientist13 released this 07 Apr 01:00
· 283 commits to master since this release

Overview

This minor introduced some breaking changes around how prerender configuration is handled by default. Going forward:

  1. it will be false by default, and for the rest of this release line, the plan is to make puppeteer opt-in by default, this expecting the user to install it themselves, but Greenwood will try and auto install if it can!).
  2. Puppeteer will not be installed by default, unless needed when running greenwood build, at which point Greenwood will try and auto-detect and install it

Puppeteer was also upgrade to v13.x.

The motivation with these changes is mainly to move puppeteer out of the critical dependency chain as Greenwood introduces more rendering options, and ensures that the out of the box development experience is as balanced as possible.

If using Yarn, you can can upgrade all your @greenwood packages at once

$ yarn upgrade --scope @greenwood --latest

Changelog

https://github.com/ProjectEvergreen/greenwood/issues?q=label%3Av0.25.0

  1. make prerender config option false by default
  2. auto-detect and install puppeteer dependency for default prerendering
  3. node modules resolver should return a fallback path for package not located by require.resolve
  4. upgrade puppeteer version

Breaking Changes

Prerender (Configuration)

Going forward, if you would like to prerender your application, you will need to explicitely set it in your greenwood.config.js

export default {
  prerender: true
}

Prerender (Puppeteer)

Going forward, if you are using prerender: true as the default prerender, you will need to make sure puppeteer is installed, if Greenwood can't automatically detect and install it. This can be done bu just using npm / yarn / etc.

# npm
$ npm install puppeteer --dave-dev

# yarn
$ yarn add puppeteer --dev

Known Issues

N / A

Diff

% git diff v0.24.2 v0.25.0 --stat | grep -v "www"
 .gitignore                                         |   2 +
 README.md                                          |   4 +-
 greenwood.config.js                                |   1 +
 lerna.json                                         |   2 +-
 packages/cli/package.json                          |  12 +-
 packages/cli/src/commands/build.js                 |  79 +++----
 packages/cli/src/commands/develop.js               |   4 +-
 packages/cli/src/commands/eject.js                 |   4 +-
 packages/cli/src/commands/serve.js                 |   4 +-
 packages/cli/src/index.js                          |  69 ++++--
 packages/cli/src/lib/node-modules-utils.js         |   4 +-
 packages/cli/src/lib/walker-package-ranger.js      | 235 +++++++++++++++++++++
 packages/cli/src/lifecycles/config.js              |   2 +-
 packages/cli/src/lifecycles/prerender.js           | 149 ++++++-------
 packages/cli/src/lifecycles/serve.js               |   9 -
 .../src/plugins/resource/plugin-node-modules.js    | 221 +------------------
 .../build.config-optimization-default.spec.js      |   7 -
 .../build.config-optimization-inline.spec.js       |  16 +-
 .../build.config-optimization-none.spec.js         |   5 +-
 .../build.config-optimization-overrides.spec.js    |  17 +-
 .../build.config-optimization-static.spec.js       |  10 +-
 .../greenwood.config.js                            |   3 +-
 .../build.config.prerender.spec.js                 |  26 ++-
 .../build.config.prerender/greenwood.config.js     |   2 +-
 .../build.default.import-node-modules.spec.js      |  16 +-
 .../greenwood.config.js                            |   3 +
 .../build.default.import-node-modules/package.json |   1 +
 .../build.default.quick-start-npx.spec.js          |  14 --
 .../build.default.workspace-404-markdown.spec.js   |   5 +-
 .../build.default.workspace-404.spec.js            |   5 +-
 ...d.default.workspace-frontmatter-imports.spec.js |  10 +-
 .../greenwood.config.js                            |   3 +
 ...build.default.workspace-getting-started.spec.js |  56 ++---
 .../build.default.workspace-javascript-css.spec.js |  12 +-
 .../greenwood.config.js                            |   3 +
 ...default.workspace-template-page-and-app.spec.js |  13 +-
 .../build.default.workspace-template-page.spec.js  |   2 +-
 ...ault.workspace-templates-relative-paths.spec.js |  19 +-
 ...efault.workspace-user-directory-mapping.spec.js |  10 +-
 .../build.plugins.context.spec.js                  |   6 +-
 .../build.config.plugins-resource.spec.js          |   8 +-
 .../build.plugins.resource/greenwood.config.js     |   1 +
 .../develop.plugins.context/greenwood.config.js    |   6 +-
 .../cli/test/cases/theme-pack/greenwood.config.js  |   6 +-
 .../test/cases/theme-pack/theme-pack.build.spec.js |   6 +-
 .../cases/theme-pack/theme-pack.develop.spec.js    |   2 +-
 packages/init/package.json                         |   2 +-
 .../test/cases/init.template/init.template.spec.js |   4 -
 packages/plugin-babel/package.json                 |   4 +-
 packages/plugin-google-analytics/package.json      |   4 +-
 packages/plugin-graphql/package.json               |   4 +-
 packages/plugin-graphql/src/index.js               |  52 +++--
 .../test/cases/query-children/greenwood.config.js  |   2 +
 .../cases/query-children/query-children.spec.js    |   9 +-
 .../test/cases/query-config/greenwood.config.js    |   2 +
 .../test/cases/query-config/query-config.spec.js   |   9 +-
 .../query-custom-frontmatter/greenwood.config.js   |   1 +
 .../query-custom-frontmatter.spec.js               |   9 +-
 .../cases/query-custom-schema/greenwood.config.js  |   1 +
 .../query-custom-schema.spec.js                    |  10 +-
 .../test/cases/query-graph/greenwood.config.js     |   1 +
 .../test/cases/query-graph/query-graph.spec.js     |   9 +-
 .../test/cases/query-menu/greenwood.config.js      |   1 +
 .../test/cases/query-menu/query-menu.spec.js       |  11 +-
 packages/plugin-import-commonjs/package.json       |   4 +-
 .../test/cases/default/default.spec.js             |   8 +-
 .../test/cases/default/greenwood.config.js         |   2 +
 packages/plugin-import-css/package.json            |   4 +-
 .../test/cases/default/default.spec.js             |   8 +-
 .../test/cases/default/greenwood.config.js         |   2 +
 packages/plugin-import-json/package.json           |   4 +-
 .../test/cases/default/default.spec.js             |   8 +-
 .../test/cases/default/greenwood.config.js         |   3 +-
 packages/plugin-include-html/package.json          |   4 +-
 .../greenwood.config.js                            |   1 -
 .../build.default.link-tag.spec.js                 |   2 +-
 .../build.default-link-tag/greenwood.config.js     |   1 -
 packages/plugin-polyfills/package.json             |   4 +-
 packages/plugin-postcss/package.json               |   4 +-
 packages/plugin-renderer-lit/package.json          |   4 +-
 packages/plugin-typescript/package.json            |   4 +-
 test/utils.js                                      |  51 +++++
 .../greenwood-getting-started-repo-optimized.webp  | Bin 0 -> 36216 bytes
 yarn.lock                                          | 113 +++++-----
 89 files changed, 889 insertions(+), 668 deletions(-)