Skip to content

v0.10.0-alpha.8

Pre-release
Pre-release
Compare
Choose a tag to compare
@thescientist13 thescientist13 released this 19 Mar 01:23
· 677 commits to master since this release

Overview

This alpha.8 release restores two critical missing pieces of functionality by adding back in (as plugins) GraphQL and Babel support. 🌟

Note: Each 0.10.0-alpha.N release will build upon itself release notes wise, with the sum all release notes being included in the final, actual 0.10.0 release. Please read here for the previous release's release notes. For more high level details about this upgrade, you can check out or Request For Contributions Google doc to learn more about our current project Roadmap and direction. (please reach out if interested in helping!)

To test this upgrade, you can run the following

# npm
$ npm install @greenwood/[email protected] --save-dev

# yarn
$ yarn add @greenwood/[email protected] --dev

You can see an example of an upgrade in our Getting Started repo.

Breaking Changes

GraphQL

You will now need to install a plugin for GraphQL support

# npm
npm -i @greenwood/plugin-graphql --save-dev

# yarn
yarn add @greenwood/plugin-graphql --dev

And then add this plugin to your greenwood.config.js.

const pluginGraphQL = require('@greenwood/plugin-graphql');

module.exports = {
  ...

  plugins: [
    ...pluginGraphQL() // notice the spread ... !
  ]
}

Additionally, there were some minor tweaks to the schema , so here is what it looks like now

graph {
  filename, // (string) file name without extension/path, so that it can be copied to scratch dir with same name
  
  id, // (string) filename without the extension

  label, // (string) best guess pretty text / display based on filename

  path, // (string) path to the file

  route,  // (string) A URL, typically derived from the filesystem path, e.g. /blog/2019/first-post/

  template, // (string) page template used for the page

  title,  // (string) Useful for a page's <title> tag or the title attribute for an <a> tag, inferred from the filesystem path, e.g. "First Post" or provided through front matter.
}

You can read more in the package's README.md and our documentation.

Babel

You will now need to install a plugin for Babel support

# npm
npm -i @greenwood/plugin-babel --save-dev

# yarn
yarn add @greenwood/plugin-babel --dev

And then add this plugin to your greenwood.config.js.

const pluginBabel = require('@greenwood/plugin-babel');

module.exports = {
  ...

  plugins: [
    ...pluginBabel() // notice the spread ... !
  ]
}

You can read more in the package's README.md


Please see the previous release notes for any previously documented breaking changes 👆

Key Changes

Changelog

  1. Restore GraphQL support
  2. Restore Babel / Browserslist support

Known Issues

A lot of features available in 0.9.0 of Greenwood are not available at this time in this release. The full list of outstanding items is here, with the main ones being captured below for quick reference:

  1. Restore optimizations and MPA support

Diff

$ git diff v0.10.0-alpha.7 v0.10.0-alpha.8 --stat
 .eslintignore                                                    |    3 +-
 .eslintrc.js                                                     |    6 -
 .mocharc.js                                                      |    3 +-
 README.md                                                        |    4 +-
 greenwood.config.js                                              |    4 +
 lerna.json                                                       |    2 +-
 packages/cli/package.json                                        |    2 +-
 packages/cli/src/commands/build.js                               |   44 +-
 packages/cli/src/commands/eject.js                               |   28 +-
 packages/cli/src/config/.browserslistrc                          |    3 -
 packages/cli/src/config/rollup.config.js                         |   17 +-
 packages/cli/src/data/common.js                                  |   46 -
 packages/cli/src/data/queries/children.gql                       |   10 -
 packages/cli/src/data/queries/graph.gql                          |   10 -
 packages/cli/src/index.js                                        |   13 +-
 packages/cli/src/lifecycles/config.js                            |    2 +-
 packages/cli/src/lifecycles/graph.js                             |   12 +-
 packages/cli/src/lifecycles/serve.js                             |    2 +-
 packages/cli/src/plugins/resource/plugin-node-modules.js         |   95 +-
 packages/cli/src/plugins/server/plugin-livereload.js             |    7 +-
 packages/cli/test/cases/build.config.babel/babel.config.js       |   20 -
 .../cli/test/cases/build.config.babel/build.config.babel.spec.js |   58 -
 packages/cli/test/cases/build.config.babel/src/pages/index.md    |    3 -
 .../build.data.graph-custom-frontmatter.spec.js                  |  145 --
 .../cases/build.data.graph-custom-frontmatter/src/pages/index.md |    7 -
 .../src/templates/blog-template.js                               |   78 -
 .../cli/test/cases/build.data.graph/build.data.graph.spec.js     |  294 ---
 packages/cli/test/cases/build.data.graph/src/pages/blog/index.md |    5 -
 packages/cli/test/cases/build.data.graph/src/pages/index.md      |    7 -
 .../test/cases/build.data.graph/src/templates/blog-template.js   |   62 -
 .../test/cases/build.data.graph/src/templates/page-template.js   |   21 -
 .../test/cases/build.data.graph/src/templates/post-template.js   |   67 -
 packages/cli/test/cases/eject.default/eject.default.spec.js      |  111 +-
 packages/cli/test/unit/data/mocks/graph.js                       |    4 -
 packages/plugin-babel/README.md                                  |   77 +
 packages/plugin-babel/package.json                               |   39 +
 packages/plugin-babel/src/.browserslistrc                        |    2 +
 packages/{cli/src/config => plugin-babel/src}/babel.config.js    |   21 +-
 packages/plugin-babel/src/index.js                               |   78 +
 packages/plugin-babel/test/cases/default/babel.config.js         |    6 +
 packages/plugin-babel/test/cases/default/default.spec.js         |   76 +
 packages/plugin-babel/test/cases/default/greenwood.config.js     |    7 +
 packages/plugin-babel/test/cases/default/src/pages/index.html    |   12 +
 packages/plugin-babel/test/cases/default/src/scripts/main.js     |   18 +
 .../test/cases/options.extend-config/babel.config.js             |    6 +
 .../test/cases/options.extend-config/greenwood.config.js         |    9 +
 .../cases/options.extend-config/options.extend-config.spec.js    |   93 +
 .../test/cases/options.extend-config/src/pages/index.html        |   12 +
 .../test/cases/options.extend-config/src/scripts/main.js         |   18 +
 packages/plugin-google-analytics/package.json                    |    4 +-
 packages/plugin-graphql/README.md                                |   84 +
 packages/plugin-graphql/package.json                             |   35 +
 packages/{cli/src/data => plugin-graphql/src/core}/cache.js      |   29 +-
 packages/{cli/src/data => plugin-graphql/src/core}/client.js     |   32 +-
 packages/plugin-graphql/src/core/common.client.js                |   23 +
 packages/plugin-graphql/src/core/common.server.js                |   23 +
 packages/{cli/src/data => plugin-graphql/src/core}/server.js     |    4 +-
 packages/plugin-graphql/src/index.js                             |  121 ++
 packages/plugin-graphql/src/queries/children.gql                 |   11 +
 packages/{cli/src/data => plugin-graphql/src}/queries/config.gql |    0
 packages/plugin-graphql/src/queries/graph.gql                    |   11 +
 packages/{cli/src/data => plugin-graphql/src}/queries/menu.gql   |    6 +-
 packages/{cli/src/data => plugin-graphql/src}/schema/config.js   |    0
 packages/{cli/src/data => plugin-graphql/src}/schema/graph.js    |   81 +-
 packages/{cli/src/data => plugin-graphql/src}/schema/schema.js   |    0
 .../plugin-graphql/test/cases/query-children/greenwood.config.js |   10 +
 packages/plugin-graphql/test/cases/query-children/package.json   |    6 +
 .../test/cases/query-children/src/components/posts-list.js       |   55 +
 .../test/cases/query-children/src/pages/blog/first-post/index.md |    8 +
 .../cases/query-children/src/pages/blog/second-post/index.md     |    8 +
 .../test/cases/query-children/src/pages/index.html               |   12 +
 .../plugin-graphql/test/cases/query-config/greenwood.config.js   |   10 +
 .../plugin-graphql/test/cases/query-config/query-config.spec.js  |  110 ++
 .../test/cases/query-config/src/components/footer.js             |   22 +
 .../plugin-graphql/test/cases/query-config/src/pages/index.html  |   12 +
 .../test/cases/query-custom-frontmatter/greenwood.config.js      |    9 +
 .../test/cases/query-custom-frontmatter/package.json             |    6 +
 .../query-custom-frontmatter/query-custom-frontmatter.spec.js    |  179 ++
 .../cases/query-custom-frontmatter/src/components/posts-list.js  |   66 +
 .../query-custom-frontmatter}/src/pages/blog/first-post/index.md |    3 +-
 .../src/pages/blog/second-post/index.md                          |    3 +-
 .../test/cases/query-custom-frontmatter/src/pages/index.html     |   12 +
 .../plugin-graphql/test/cases/query-graph/greenwood.config.js    |    9 +
 packages/plugin-graphql/test/cases/query-graph/package.json      |    6 +
 .../plugin-graphql/test/cases/query-graph/query-graph.spec.js    |  152 ++
 .../test/cases/query-graph/src/components/debug-output.js        |   48 +
 .../test/cases/query-graph}/src/pages/blog/first-post.md         |    0
 .../test/cases/query-graph}/src/pages/blog/second-post.md        |    0
 .../plugin-graphql/test/cases/query-graph/src/pages/index.html   |   13 +
 .../plugin-graphql/test/cases/query-menu/greenwood.config.js     |    9 +
 packages/plugin-graphql/test/cases/query-menu/package.json       |    6 +
 packages/plugin-graphql/test/cases/query-menu/query-menu.spec.js |  161 ++
 .../test/cases/query-menu}/src/components/header.js              |   10 +-
 packages/plugin-graphql/test/cases/query-menu/src/pages/about.md |    7 +
 .../plugin-graphql/test/cases/query-menu/src/pages/contact.md    |    7 +
 packages/plugin-graphql/test/cases/query-menu/src/pages/index.md |    3 +
 .../plugin-graphql/test/cases/query-menu/src/templates/page.html |   12 +
 .../test/unit/data => plugin-graphql/test/unit}/common.spec.js   |   29 +-
 .../test/unit/data => plugin-graphql/test/unit}/mocks/config.js  |    3 +-
 packages/plugin-graphql/test/unit/mocks/graph.js                 | 2274 ++++++++++++++++++++++++
 .../unit/data => plugin-graphql/test/unit}/schema/config.spec.js |    2 +-
 .../data => plugin-graphql/test/unit}/schema/graph.menu.spec.js  |  138 +-
 .../unit/data => plugin-graphql/test/unit}/schema/graph.spec.js  |   45 +-
 packages/plugin-import-commonjs/package.json                     |    4 +-
 packages/plugin-import-commonjs/src/index.js                     |    3 +-
 packages/plugin-import-css/package.json                          |    4 +-
 packages/plugin-polyfills/package.json                           |    4 +-
 packages/plugin-postcss/README.md                                |   28 +-
 packages/plugin-postcss/package.json                             |   10 +-
 packages/plugin-postcss/src/.browserslistrc                      |    2 +
 packages/plugin-postcss/src/index.js                             |   39 +-
 packages/plugin-postcss/src/postcss.config.js                    |    5 +
 packages/plugin-postcss/test/cases/default/default.spec.js       |    9 +-
 packages/plugin-postcss/test/cases/default/src/styles/main.css   |    7 +-
 .../test/cases/options.extend-config/greenwood.config.js         |    7 +
 .../cases/options.extend-config/options.extend-config.spec.js    |   75 +
 .../cases/{default => options.extend-config}/postcss.config.js   |    0
 .../test/cases/options.extend-config/src/pages/index.html        |   12 +
 .../test/cases/options.extend-config/src/styles/main.css         |    8 +
 www/components/header/header.js                                  |   26 +-
 www/components/shelf/shelf.js                                    |   62 +-
 www/package.json                                                 |    2 +-
 www/pages/docs/data.md                                           |  164 +-
 www/pages/docs/front-matter.md                                   |    4 +-
 www/pages/docs/index.md                                          |    2 +-
 www/pages/docs/menus.md                                          |   39 +-
 www/pages/plugins/custom-plugins.md                              |    1 +
 yarn.lock                                                        | 2647 +++++++++++++++++++++++++++-
 128 files changed, 7304 insertions(+), 1458 deletions(-)

Lighthouse

v0 10 0-alpha 8-lighthouse