gatsby

The best React-based framework with performance, scalability and security built in.

MIT License

Downloads
7.6M
Stars
55.2K
Committers
4.1K

Bot releases are visible (Hide)

gatsby - 1.0.0-alpha5

Published by KyleAMathews about 8 years ago

Added

  • hard-source-webpack-plugin
    commit
  • New replacement API to wrap root component (useful for Redux, et
    al.)
    commit
  • yarn.lock
    commit

Changed

  • Disable extracting the Webpack chunk manifest until understand why
    this breaks updates when using Service Workers
    commit
gatsby -

Published by KyleAMathews about 8 years ago

Added

  • Add more file extensions to file/url loader config. Default to url-loader unless it never makes sense to use data-uri e.g. favicons.
  • Use api-runner-browser for calling browser extension APIs/replacements. Prep for plugin system.
  • Add extension API clientEntry that let's site code and plugins to run code at the very start of client app.

Changed

  • Add config to uglify to ignore ie8.
  • Disable building AppCache until can research if useful.
  • Turn on screw_ie8 options in UglifyJS.

Fixed

  • Actually use the "sources" key from gatsby-config.js for looking for markdown files. This will be getting an overhaul soon.
  • Don't use null-loader for css during the build-js stage as this prevents offline-plugin from caching files referenced in your CSS.
  • Add missing publicPath for build-html step.
gatsby - Bug fixes, new site launches, new sponsors

Published by KyleAMathews about 8 years ago

While we're hard at work pushing on all the great new 1.0 features, 0.x is still getting a lot of fine-tuning and bug fixing.

@f0rr0 has fixed a number of bugs recently:

@kyleamathews dug into some bugs with NPM2 and fixed them in https://github.com/gatsbyjs/gatsby/pull/435 and https://github.com/gatsbyjs/gatsby/pull/436

Recent site launches

New sponsors!

We're super grateful for our sponsors who are making 1.0 possible.

gatsby - DX improvements 🎉🎉🎉

Published by KyleAMathews about 8 years ago

  • @tsunammis added support for importing files with query parameters https://github.com/gatsbyjs/gatsby/pull/398
  • @benstepp changed path creation so that starting and trailing slashes are automatically added as this is a common problem and is easy to programmatically fix instead of just telling users to fix it themselves.

Sites launched on Gatsby since the last release

gatsby - Prompt user to use new port if in requested port is in use

Published by KyleAMathews about 8 years ago

Quick release to add this very nice UX improvement contributed by @LukeSheard and borrowed from Create React App's similar feature: https://github.com/facebookincubator/create-react-app/pull/101

https://github.com/gatsbyjs/gatsby/pull/371

gatsby - Fix for NPM 2 peerDependencies + error swallowing issues

Published by KyleAMathews about 8 years ago

gatsby - Image supported added!

Published by KyleAMathews over 8 years ago

Gatsby now ships with richer support for images. Now you can "import" or "require" an image and use it within your React components and under the hood, the images will be automatically optimized.

import myImage from './my-image.jpg'

// in render function
<div>
  <h1>Hi friends!</h1>
  <img src={myImage} />
</div>

We're using the image-webpack-loader which uses the popular Imagemin project to minify your images.

There's future (responsive) image work planned! See https://github.com/gatsbyjs/gatsby/issues/285 if you want to get involved.

Upgrade

This is marked as a breaking release as it could interfere with your Webpack config if you already have added image loader support.

If you have added custom image loaders already, to upgrade, in your modifyWebpackConfig function in gatsby-node.js add this line: config.removeLoader('images')

You'll also need to add image-webpack-loader to your site:

npm install --save-dev image-webpack-loader

Enjoy!

gatsby - CSS Modules!

Published by KyleAMathews over 8 years ago

Major improvements

Minor (but awesome) improvements

Breaking changes

None!

gatsby - Don't start develop server if port in use & show friendlier error message

Published by KyleAMathews over 8 years ago

@crucialfelix raised two issues in #334 — a) it's hard to figure out to do when Node throws up it's cryptic EADDRINUSE error and b) Gatsby doesn't die as it should when it hits that but pretends it's running.

In #335 I fixed both where gatsby develop now dies when the server can't start (for whatever reason) and when Node throws a EADDRINUSE error, we catch that, find the process that is listening on that port and show this error message:

We were unable to start Gatsby on port 8000 as there's already a process
listening on that port (PID: 43337). You can either use a different port
(e.g. gatsby develop --port 8001) or stop the process already listening
on your desired port.
gatsby - Quick bug fix release

Published by KyleAMathews over 8 years ago

It turns out we need two stage types for development as adding HMR to the development server rendering the html.js caused very obscure stack traces when there's errors in your html.js. Fixed in #305 by @benstepp.

Also @kyleamathews added another small invariant to check what a user returns when they modify the Webpack config https://github.com/gatsbyjs/gatsby/commit/58ea25468fe72a5e19a2e1aef97d183895a41b85.

gatsby - Fix module resolve config

Published by KyleAMathews over 8 years ago

Quick release to fix the module resolve config to default to loading modules from Gatsby's node_modules directory. This bug was introduced in 0.11.1 but shouldn't have affected most of you. See https://github.com/gatsbyjs/gatsby/pull/299 for the full details.

gatsby - Build performance improvements!

Published by KyleAMathews over 8 years ago

@benstepp made a number of tweaks to our default Webpack setup which dropped build times by ~30%! https://github.com/gatsbyjs/gatsby/pull/294

Bug fix

@kyleamathews fixed a bug where running gatsby --help outside of a Gatsby site would erroneously show a warning https://github.com/gatsbyjs/gatsby/commit/1fa7c4d8ef79966223320c4f981fed9c38cc85fd

gatsby - Inline CSS!

Published by KyleAMathews over 8 years ago

The headliner of this release is you can now inline CSS in the <head> of your site. This is a best practice recommended by Google's AMP project among others as you then avoid additional requests which can signifcantly slow down your site. Testing using webpagetest.org showed that moving css inline improved the Speed Index 20-50%!! In one test on a simulated 3G connection, the time to initial render went from ~1.8 seconds to ~1 second.

It's a very simple switch to make. See this commit in the default starter https://github.com/gatsbyjs/gatsby-starter-default/commit/1faecb5a7ded5585b12e8330f9aaa663f9d8b769 It's also documented at https://github.com/gatsbyjs/gatsby#inline-css

Breaking changes

  • post-build.js moved inside gatsby-node.js. If you had added a post-build.js module to your code, this function should now be exported from gatsby-node.js. A simple way to make the change is to simply require post-build.js there e.g. exports.postBuild = require('./post-build'). Thanks to @LukeSheard for this! #273
  • The "stages" were renamed. If you override Webpack configs and are switching behavior based on the stage, static is split into two stages, build-css and build-html and production is now build-javascript. We think these are much more sensible names. Thanks to @scottnonnenberg for the this! #253

Other notable non-breaking changes

@benstepp did a deep refactor of how we're loading Babel plugins. There shouldn't be any breaking changes but it fixes a number of bugs https://github.com/gatsbyjs/gatsby/pull/279

Some highlights:

  • User can override the .babelrc passed to webpack.
  • User can use whatever babel plugins they want.
  • User babel config is extended with react-hmre rather than being overwritten in develop.js.
  • Object.assign is now polyfilled by default.
  • Non breaking change as starters previously required a babelrc and gatsby will just read them as normal.
  • Fixes three issues #129, #235, #264
gatsby - React 15!

Published by KyleAMathews over 8 years ago

Thanks to the efforts of @patrykkopycinski, Gatsby now supports React 15. This should be an easy upgrade for most people as long as your current site is showing deprecation warnings in the console.log. https://github.com/gatsbyjs/gatsby/pull/252

@alampros also contributed a bug fix as he noticed that when setting the host option for gatsby develop and gatsby serve-build that the short version -h overrode the default help option. He changed that to -H so there would no longer be a conflict https://github.com/gatsbyjs/gatsby/pull/247.

gatsby - New --open flag, more tests, small bug fixes

Published by KyleAMathews over 8 years ago

@alampros added a --open flag to gatsby develop and gatsby serve-build so Gatsby can now automatically open your site in your default browser. https://github.com/gatsbyjs/gatsby/commit/09ea56a01a0530c2941871358fff70a3a562cdce

@benstepp continued his testing ways and added integration tests for building pages with Markdown and HTML and added tests for the rewritePath API. Great stuff! https://github.com/gatsbyjs/gatsby/pull/240

@kyleamathews fixed a bug where running gatsby --version wasn't actually returning the version 😬 https://github.com/gatsbyjs/gatsby/pull/249

gatsby - Tests!, bug fixes, DX improvements

Published by KyleAMathews over 8 years ago

New tests!

@benstepp waded into the center of Gatsby and refactored one of the core functions AND setup a test framework AND added a number of tests. Awesome! https://github.com/gatsbyjs/gatsby/pull/232

Bug fixes

Developer Experience (DX) improvements

Thanks everyone!

gatsby - Babel 6! Require local install of Gatsby! 2500 stars!

Published by KyleAMathews over 8 years ago

Another release with two nice DX improvements.

Also we hit 2500 stars as I was writing this review 🎉

Babel 6

Gatsby started its life on Babel 5 but Babel 6 is out and stable so we'll upgrade along with the rest of the ecosystem and take advantage of its improved performance and awesome new plugin api.

Gatsby must now be installed as a dependency of the site

The global Gatsby install now defers to the local install of Gatsby (and throws if it can't find one). This means you can build a site and not worry about needing to upgrade it again as Gatsby accumulates breaking changes. This also helps ensure Gatsby works in environments where you don't want a global install e.g. build servers.

Upgrade instructions

  • Install Gatsby — npm install --save gatsby
  • Install new Babel 6 dependencies (they must be installed locally) — npm install --save babel-plugin-add-module-exports babel-preset-es2015 babel-preset-react babel-preset-stage-1 and npm install --save-dev babel-preset-react-hmre.
  • Uninstall old Babel 5 dependencies (if you added any).
  • The link function from gatsby-helpers.js was renamed to prefixLink to clarify its purpose.
  • Your .babelrc file needs to be upgraded to look like:
{
  "presets": ['react', 'es2015', 'stage-1'],
  "plugins": ['add-module-exports']
}
  • If you modified the default Webpack config in gatsby.config.js, this functionality is now moved to gatsby-node.js and instead of using module.exports, export your config modification function as modifyWebpackConfig. See the updated instructions in the README.
  • If you were differentiating between pages with content (like .md files) and pages without (like pages/profile.js) by looking for truthy page.data, you'll now need check for truthy page.data.body.
  • If your site is under version control, you might want to ignore the new auto-written module .gatsby-context.js.
  • rare if you used the rewritePath, onRouteChange hooks in your app.js — app.js is now not supported. Instead you should export rewritePath in gatsby-node.js and onRouteChange in gatsby-browser.js. The function signatures didn't change. These new files will be gaining more functionality in future releases.

That's it! See you in the issue queues :-)

  • @kyleamathews added support for creating pages from JSON/YAML/TOML files. This can be incredibly useful if you're integrating Gatsby with a 3rd-party system. Write out the data as JSON files and they'll be auto-converted into Gatsby pages. YAML & TOML are very handy for maintaining complex data for a page by hand.
  • @scottnonnenberg added an option to disable building a bundle.js for production. This is helpful to minimize the amount of data people download for your site and for very large sites (e.g. 1000+ pages), not compiling the JS can save a considerable amount of time.
gatsby - Small dev improvements

Published by KyleAMathews over 8 years ago

gatsby - Add support for a 404 page

Published by KyleAMathews over 8 years ago

@scottnonnenberg added support for 404 pages!