Skip to content

Releases: xing/hops

v11.6.1

16 Apr 14:18
c4342e3
Compare
Choose a tag to compare

11.6.1 (2019-04-16)

Bug Fixes

  • dependencies: update dependency mini-css-extract-plugin to ^0.6.0 (6be3e6c)
  • development-proxy: allow empty proxy targets in config (8660df0)
  • upgrade to latest untool release (ba7e50c)
  • redux: always add redux-thunk middlware (900edc7)

v11.6.0

09 Apr 12:54
c60145b
Compare
Choose a tag to compare

11.6.0 (2019-04-09)

Bug Fixes

  • create-hops-app: remove @next bin hack (3949fb1)
  • dependencies: update dependency react-redux to v7 (4d60114)
  • jest-preset: correctly specify peer dependencies (58212da)
  • upgrade untool to v1.5.1 (6c09463)
  • lambda: cacheDir should be serverDir (021ca5a)
  • spec: basePath and assetPath should not contain leading slash (8b2206a)

Features

  • add config schema validation (96ca9dc)
  • implement diagnose hooks for preflight validation (4e8f1f8)
  • use @untool/info for CLI output/logging (e1f3f92)

v11.5.0

03 Apr 09:39
9c85b4d
Compare
Choose a tag to compare

11.5.0 (2019-04-03)

Bug Fixes

  • dependencies: remove react-router-dom version range where not needed (809b196)
  • dependencies: update dependency pretty-ms to v4 (d2a76a0)
  • dependencies: update dependency react-router-dom to v^4.3.1 || v^5 (d5f8713)
  • dependencies: update dependency semver to v6 (ad2b26d)
  • upgrade untool to v1.5.0 (b8d5396)
  • redux: fixed location object, now including search and hash, too (4bf81d8)
  • redux: import "createLocation" from "history" (14d3d6c), closes #831

Features

  • redux: Second param "location" for action creators (f681f79)

v11.4.1

14 Mar 13:23
a370b15
Compare
Choose a tag to compare

11.4.1 (2019-03-14)

Bug Fixes

  • graphql: enable playground requests to include credentials (4e65a03)

Upgrade to webpack 4, import global CSS, choose next free port

09 Apr 09:46
Compare
Choose a tag to compare

10.3.0 (2018-04-09)

With this release we are upgrading webpack to version 4. 🎉

Some other notable changes:

  • We now support loading CSS files with a "global" mode, to allow to bypass the CSS-Modules naming mechanism, so that you can import CSS libraries and use the classnames that they export without having to worry about them being renamed. (4d9b36f)
  • Unless otherwise configured, Hops will now use the next free port, starting at 8080.
    You can override this behaviour by either specifying the PORT environment variable or by setting a port explicitly in hops-config. See (62b9b77) and (4a079b8)

Bug Fixes

  • build: raise node-mocks-http version to ensure res.locals being set (e5ae186)
  • build: do not break build on webpack warnings (0c1518f)
  • build-config: make service worker plugin async via tapAsync (f230ffc)
  • build-config: make webmanifest loader webpack 4 compatible (1c398ee)
  • build-config: use [name]-[chunkhash] as chunk names (83021d4)
  • react: do not throw error when no options are passed (e5bffdd)
  • spec: re-enable CSS build test (832cf04)

Features

  • build-config: add CSS optimizer plugin to minify assets (236e127)
  • build-config: get rid of manifest plugin, simplify config loader (70aa374)
  • build-config: introduce global css mode (4d9b36f)
  • build-config: tweak Webpack configs for v4 (b28a787)
  • build-config: update to latest alpha of extract text plugin (823b562)
  • build-config: update webpack to v4 (eafe4f2)
  • build-config: switch to mini-css-extract-plugin (37d5b8f), closes webpack-contrib/extract-text-webpack-plugin/#731
  • config: port defaults to PORT environment variable (4a079b8)
  • express: choose next free port when hops-config.port is falsy (62b9b77)
  • graphql: add "--header/-H" CLI option to introspect command (671193d)
  • graphql: Generate fragment types from schema file (5d86841)

webpack configuration and performance improvements, internal refactorings

26 Mar 13:32
Compare
Choose a tag to compare

10.2.0 (2018-03-26)

Although this is just a minor release, it contains a ton of internal
refactorings of the webpack configurations and build process and increases
overall robustness and speed.

We have replaced the webpack-dev-server with a simpler express server, using
the webpack-dev-middleware and webpack-hot-middleware instead.
This also enabled us to remove the custom webpack plugin used to generate the
manifest.json and to further simplify the config loader.

Some things that you might notice are:

  • the progress of the build is no longer printed while the build executes
  • the overall structure of the webpack configuration has changed

Semi BREAKING CHANGES

We have restructured the webpack build, develop and node configurations, which
might break your project if you have written custom configurations with extended
the built-in configs.
We have decided against making this a breaking change, because we feel that it
is internal API only.
You can check out the changes in these commits:
(93ddbbf)
(36cc2db)

In essence:

  • module.rules no longer directly contains the loaders, but instead contains a
    single object that has a oneOf list of all the loaders.
    This ensures that the first matching loader is used and also enables us to
    define the file-loader as last loader without specifying an including
    test regex, but instead specifying an exclude regex, so that all other
    files will be routed through the file-loader.
  • the loader and options keys of each loader are no longer nested inside a
    use object, but are defined on the loader object directly.

Features

  • allow to track server timings (31ee6ad)
  • build: enable SSR mode in webpack dev middleware (6be493a)
  • build-config: get rid of manifest plugin, simplify config loader (1484d10)
  • build-config: introduce build, develop, node exports (f4a6516)
  • config: add service worker configuration options (ec7f016)
  • express: enable gzip compression (38779f0)
  • express: expose stats/asset paths using express (74c8173)
  • express: implement SSL support (ec0026c)
  • pwa: initial ServiceWorker and Web App Manifest support (6fe9ddb)

Bug Fixes

  • avoid sw.js being loaded from wrong path (14ec44b)
  • check against correct protocol notion for sw registration (9f006a3)
  • build: exit with exitCode 1 when build fails (83b9bf6)
  • build-config: add plugins to package (a84e20e)
  • express: don't cache sw.js (a085bf3)
  • express: fix ssl file location references (f7a94ea)
  • lambda: warn about misconfiguration instead of exiting (4fd8f21)
  • react: always respect headers, even on a miss (0022a1c)
  • renderer: fix static build not working due to missing res.locals.timing (9bb1b35)

Performance Improvements

  • track context lifecycle hooks (a4d7dec)

New config mechanism, improved context API, perf improvements

08 Feb 12:29
8f10cc7
Compare
Choose a tag to compare

10.0.0 (2018-02-07)

With this major release we replaced the npm based config mechanism with cosmiconfig (which is what is being used by lint-staged and others).

BREAKING CHANGES

  • config: new and improved config mechanism
    hops-config no longer supports the previous, npm based config mechanism.

    Hops now needs to be configured using a hops field in package.json instead of config.hops.

       "version": "9.8.0",
       "main": "src/app.js",
    -  "config": {
    -    "hops": {
    -      "browsers": "last 1 Chrome versions",
    -      "locations": ["/", "/counter"]
    -    }
    +  "hops": {
    +    "browsers": "last 1 Chrome versions",
    +    "locations": ["/", "/counter"]
       },

    You can also configure Hops via dedicated files .hopsrc or hops.config.js etc. Read more in the updated config readme.

    Local config overrides (using npm config set, .npmrc files or npm environment variables) are no longer supported. Instead we have adopted an environment variables based approach, similar to what Babel is doing.

       "version": "9.8.0",
       "main": "src/app.js",
       "hops": {
         "port": 8080,
    -    "locations": ["/", "/counter"]
    +    "locations": ["/", "/counter"],
    +    "env": {
    +      "my-environment": {
    +        "port": 1337
    +      }
    +    }
       },

    Then run: HOPS_ENV=my-environment yarn start to start your server on port 1337.

    Hops uses HOPS_ENV and falls back to NODE_ENV if the first one is unset.

  • config: function config values are no longer treated as getters, but returned directly

  • graphql: server side rendering (fetching) of GraphQL data is disabled in static builds
    In static mode, during server side rendering, GraphQL data is no longer being prefetched.
    That appears to be the sane default. The old behaviour can be restored by extending GraphQLContext and overriding its prefetchData method.

Features

  • build-config: hide config keys starting with _ from browsers (e087a49)
  • config: add support for config keys starting with '_' (42272e5)
  • config: add env support (404d262)
  • config: deeply merge configs (b9519cd)
  • config: improve config "inheritance" (7ba54ae)
  • config: introduce cosmiconfig (d9f8c15)
  • config: support <configkey> placeholders (f5ccc11)
  • config: use cosmiconfig for inheritance (db2d39d)
  • config: apply placeholders to plain objects, too (b84b60c)
  • config: support placeholders everywhere (d0e47a0)
  • graphql: disable data fetching in static ssr (4e5e28a), closes #324
  • react: render variant hiding contexts from users (610381d)
  • redux: making redux configration scoped (7813213)

Bug Fixes

  • config: fix extends overriding previous values instead of extending (93b8945)
  • config: deep-merge config without array concatenation (3a464e8)
  • config: fix config extension mechanism (fcc1a74)
  • redux: missing options no longer crash (6ba75a7)

Performance Improvements

  • build-config: enable caching and parallelism in uglify plugin (0530c24)

Deprecated hops-cli and hops-local-cli

08 Feb 12:38
Compare
Choose a tag to compare

9.4.0 (2018-01-08)

With this release we are deprecating hops-cli and hops-local-cli in favor of hops.

While you previously had to add hops-local-cli as a dependency to your project and install hops-cli globally, you can now use just hops.

hops must be a (dev)dependency of your project to allow you to use "hops" commands in your package.json ("start": "hops start").

Optionally you can also install hops globally to execute hops commands from your CLI ($ hops start).

hops-cli and hops-local-cli will continue to work for a while, but should be replaced with this solution.

New context mixin concept for react, redux, graphql, simplified templates

23 Nov 13:38
Compare
Choose a tag to compare

8.0.0 (2017-11-22)

This update changes the previous context implementation and fixes a couple of other issue (read more about those below).

BREAKING CHANGES

  • renderer: createRenderer signature changed to options hash instead of discrete args
    Before: The default export of hops-renderer (createRenderer) accepted two options:

    function createRenderer(webpackConfig, watchOptions) {...}

    Now it only accepts one argument, that is an options object with the following shape:

    var options = { webpackConfig, watchOptions, hopsConfig };
  • react: new context mixin mechanism using mixinable

  • redux: new context mixin mechanism using mixinable

  • graphql: new context mixin mechanism using mixinable
    Before: render from hops-react could be called with either just the App or the App and an options object:

    import { render } from 'hops-react';
    render(<App />)

    or

    import { render } from 'hops-react';
    render(<App />, { mountpoint: '#foo' })

    After: render always needs to be called with the App (and a hops context):

    import { render, createContext } from 'hops-react';
    render(<App />, createContext({ mountpoint: '#foo' }))

    the createContext method accepts an options object and can be imported as a named import from hops-react.

    import { render, createContext } from 'hops-react';

    Also: There no longer exists a class-based Context, but instead the context is composed in a
    functional manner, via createContext, contextDefinition and combineContexts (where
    createContext is just a shorthand for combineContexts(contextDefinition)).

    The context methods are now implemented in the contextDefinition.
    And multiple context definitions (for example: react, redux and graphql)
    can be combined to a context creator function (which will return a combined context, that can be used as second argument to render).

    Most packages also export a convenience createContext method, which is already a combination of the react context and their owhn context.
    For example: hpos-redux combines hops-react and hops-redux:

    import { render } from 'hops-react';
    import { createContext } from 'hops-redux';
    
    render(<App />, createContext({ reducers: {...} }));

    And hops-graphql combines hops-react and hops-graphql:

    import { render } from 'hops-react';
    import { createContext } from 'hops-graphql';
    
    render(<App />, createContext({ graphql: { cache, link } }));

    If you want to have a context that combines all three of them, you will need to create it yourself:

    import { render, combineContexts, contextDefinition as reactContext } from 'hops-react';
    import { contextDefinition as reduxContext } from 'hops-redux';
    import { contextDefinition as graphqlContext } from 'hops-graphql';
    
    import App from './app';
    
    const createContext = combineContexts(reactContext, reduxContext, graphqlContext);
    
    export default render(<App />, createContext({ mountpoint: '#foo', reducers: {...}, graphql: {...} }));

    Additional information for extending / overwriting context definitions:
    As the context implementation has changed (instead of using a class based approach
    we have switched to mixinable) which favors functional
    composition and enables us to use multiple contexts at the same time.
    The hops lifecycle definitions are as follows:
    DOM

    exports.combineContexts = mixinable({
      bootstrap: mixinable.parallel,
      enhanceElement: mixinable.pipe,
      getMountpoint: mixinable.override
    });

    Node

    exports.combineContexts = mixinable({
      bootstrap: mixinable.parallel,
      enhanceElement: mixinable.pipe,
      getTemplateData: mixinable.pipe,
      renderTemplate: mixinable.override
    });

    This allows us to implement these methods in contextDefinitions and combine multiple
    contextDefinitions via combineContexts(contextDefinition0, contextDefinition1).
    This means, that all bootstrap methods in all combined contexts will be executed in parallel
    and all enhanceElement methods will be executed one after another and their return value will be the the input argument to the next enhanceElement implementation, allowing you to compose (pipe) them.
    mixinable.override will only execute the respective method of the last implementation passed into combineContexts.

    To get a better understanding of how the context composition works, we suggest, that you take a look at the following files:

  • build-config: remove support for turning flow types to prop types
    Hops now no longer has built-in support for converting flow type
    annotations into react prop-type definitions.
    It still supports flow out of the box, via the babel-react preset,
    but now it only removes flow type annotations from the build instead
    of converting them to prop-types.

  • template-react: The template hops-template-react now no longer contains flow type annotations.

  • template-react: remove graphql example code
    hops-template-react (default template) now no longer supports graphql
    out of the box. You can add the support yourself again or use a
    different template (we will provide a new hops-template-graphql shortly).

  • plugin: Constructor signature changed to options hash instead of discrete args.
    Before: The webpack plugin hops-plugin used to be instantiated with three discrete arguments:

    new HopsPlugin(locations, webpackConfig, watchOptions);

    Now it accepts only a single options object:

    var options = { locations, webpackConfig, watchOptions, hopsConfig };
    new HopsPlugin(options);

Bug Fixes

  • build-config: exclude absolute paths from bundled config (4ecc41f)
  • build-config: inline core-js polyfills in bundled Node.js code (37e0feb)
  • build-config: replace babel-minify with uglify-es (f1be32c)
  • local-cli: if _gitignore exists, rename it to .gitignore (520a6da)
  • react: make sure to only hydrate on first pass (561cb89)
  • template-minimal: keep gitignore after publish by renaming it (d9e7e2d)
  • template-react: add missing prop-types dependency (5fb80f2)
  • template-react: keep gitignore after publish by renaming it (afb28ae)

Code Refactoring

  • build-config: remove propTypes in production builds (50c9d6c)
  • graphql: make main export a context mixin (d097d2d)
  • graphql: rename mixin definition export (dfd1d4b)
  • plugin: switch to options hash (64e0f24)
  • redux: make main export a context mixin (f5edae6)
  • redux: rename mixin definition export (321e733)
  • template-react: remove flow type annotations (4f7bba9)
  • template-react: remove graphql from default template (4533445)

Features

  • config: allow targeting specific Node version in babel preset (4437c6b)
  • graphql: implement simplified mixin support (509c1b5)
  • graphql: introduce mixin support (813196f)
  • hops-build-config: add source maps to production build output (9cfde51)
  • hops-build-config: add webpack-stats-plugin to build (a752635)
  • react: add combineContexts, refactor exports (8bd2955)
  • react: implement simplified mixin support (6f8bf5c)
  • react: introduce mixin support (3a575b1)
  • redux: implement simplified mixin support (dfed624)
  • redux: introduce mixin support (c0da538)
  • renderer: add support for an options hash (8206ad1)
  • renderer: make renderer use bootstrapServer config (ce2298d)

Performance Improvements

  • graphql: remove fs.existsSync() check from context ([1441d20](1441d2...
Read more

v7.0.0

23 Oct 14:51
1533890
Compare
Choose a tag to compare

7.0.0 (2017-10-13)

This major update is mostly an internal reorganization of the package structure to enable new features in the future.
Therefore the upgrade from hops@6 to hops@7 is quite simple, even though it is a breaking change (because of this commit).

Hops now has a global CLI, that can be installed via npm (npm i -g hops-cli) or yarn (yarn global add hops-cli) which makes it simpler to initialize new projects using $ hops init my-new-project.
Read more about it in the main readme or the hops-local-cli readme.

BREAKING CHANGE:

The webpack, babel, postcss configurations have moved from hops-config to hops-build-config.

buildConfig, developConfig and nodeConfig have been removed from hops-config.
They are now accessible on the hops-build-config export.

Also: All deep-requires into hops-config/{configs,lib/check-esnext,loaders,plugins,sections,shims,ssl} must now use hops-build-config.

Example:
var webpackConfig = require('hops-config/configs/build');
now needs to become:
var webpackConfig = require('hops-build-config/configs/build');

Also: All projects using hops now need different hops dependencies.
The required set of dependencies for any react-hops project is:

  • hops-build (devDependency)
  • hops-local-cli (devDependency)
  • jest-preset-hops (devDependency)
  • hops-express
  • hops-react
  • hops-redux

And if you are affected by the breaking change described above, you also need to add hops-build-config to your project's dependencies.

Bug Fixes

  • config: find node_modules directory by resolving hops-config (a0aa9ae)
  • config: race-condition: create cache dir just before usage (baa5bd7)
  • jest-preset: use package-relative paths in preset configuration (4844575)
  • build-config: resolve symlinked module directories (85cb18d)

Features

  • local-cli: add --production/-p flag to build, serve and start (559ec99)
  • local-cli: implement "hops start" command (e5d9906)
  • local-cli: implement build, develop and serve commands (6378026)
  • global-cli: initial draft of global cli module (f7a245f)
  • express: print error and exit if no prebuilt server was found (d1f059e)
  • template-minimal: add a minimal example template without react (db529d0)
  • config: read hops user config from package.json if not in env (0d3fdb9)