Release Notes

0.7.4

framework

  • Fixed an issue in SessionMiddlewareBuilder where passing the app instance as part of the config was causing Redis to error

0.7.3

framework

  • Updated Router.load to passthrough all group args to the loader

assets

  • Explicitly added Cache-Control: no-cache to CompileController in debug mode

0.7.2

framework

  • Fixed bug in DatabaseStore where it wasn’t getting a valid db connection

assets

  • Added --published-base-url option to assets:publish to allow for specifying a different host to serve published assets on
  • Cache-Control/Expires are no longer set when app is in debug mode
  • Fixed a bug in CompileController that cached with expires instead of lastModifiedDate
  • Changed caching when app is in debug to use global.__grindAssetsCache which will maintain memory cache during watch reloads
  • Removed ws optional dependency

stone

  • StoneEngine and Compiler now emit events

0.7.1

framework

  • Added default value to Grind constructor

assets

  • Added CORS headers to allow all requests to assets

db

  • Fixed a bug where Postgres passwords wouldn’t be handled correctly
  • Added support for using database as the db name for Postgres

orm

  • Resolved a bug in RelationValidator where the current transaction wasn’t correctly passed through and it could cause queries to leak out of the transaction when checking of their existence.

stone

  • Pinning acorn to 5.1.0 pending ternjs/acorn#575

support

  • Added conditional check for fs.lchown as it doesn‘t exist on all platforms/versions

0.7.0

framework

  • The main Grind application class now extends EventEmitter and publishes a few events:
    • boot
    • router:boot
    • listen
    • shutdown
  • Initial support for using websockets with Grind:
    • Grind.listen will now create it‘s own Server instance and make it available to the listen event so you can use any ws framework you’d like
    • Added Router.upgrade() to make it easier to support multiple ws instances
  • Introduced a pattern for registering middleware builders
    • Grind ships with support for the following middleware (off by default in API, configured via a routing.json config file):
      • Compression
      • Cookie
      • Session + Flash
      • Method Override
    • Added RoutingProvider to hook into Router’s boot process and add custom middleware builders.
    • Any provider can add middleware builders by listening to the router:boot event.
  • Added Router.load() to load routes from a file or directory (learn more)
  • Added UrlGenerator.current()
  • Added req.flashInput(), res.flashInput(), res.flash() and res.flashError()
  • Added MissingPackageError to formalize a pattern to alert of a missing package. MissingPackageError will detect when the project is using yarn or npm and adjusts it’s recommended command accordingly
  • Custom error handlers can now send a response
  • Added Log.deprecated to formally warn of deprecations

  • ErrorHandler will now properly handle custom handlers throwing errors
  • Stripped trailing slash in resource routes from index/create
  • Updated ChalkedConsoleLogger to use a chalk instance
  • UrlGenerator bug fixes:
    • If a URL was passed in with a query string, the parameters object would be ignored
    • Passing in a hash would lead to broken URLs
    • Routes with optional params would include a trailing slash

  • ProviderCollection no longer extends Array
    • As part of this change, providers.push() has been renamed to providers.add()
  • Performance improvents throughout
  • Updated dependencies:
    • body-parser: 1.15.2 => 1.17.2
    • chalk: 1.1.3 => 2.0.1
    • chokidar: 1.6.0 => 1.7.0
    • express: 4.13.x => 4.14.1
    • find-root: 1.0.0 => 1.1.0
    • json5: 0.4.0 => 0.5.1

assets

  • 🚀 Added support for live reload to automatically update scss/css files in the browser and reload the window when js files changes (learn more).
    • This is turned off by default, but can be turned on by setting the assets.live_reload config value to true.
    • Requires the ws package
    • Do not use this in production
  • Added support for Stone
  • Removed process.exit in PublishCommand
  • Removed unnecessary config files
  • Removed dependency on grind-html
  • Switched package errors to MissingPackageError
  • Updated dependencies:
    • dateformat: 1.0.12 => 2.0.0
    • ignore: 3.1.5 => 3.3.3

cache

  • Updated ConfigBuilder to support the new global redis.json config file (learn more)
  • Added DatabaseStore that works with grind-db
  • Renamed Config to ConfigBuilder and Cache to CacheBuilder for better consistency with other providers

cli

  • Added SchedulerJob.withTimeout(ms) and SchedulerJob.withoutTimeout()
  • Added Runner class that mirrors HttpServer in grind-framework
  • Added Watcher to allow commands to opt-in to watch
    • This will allow for never-ending commands to toggle on watch and allow for hot reloading of code during development
  • Fixed bug in SchedulerJob that didn’t pass expected args when creating an instance of Command
  • Renamed SchedulerJob.provider to SchedulerJob.driver to reduce confusion
  • Updated Command.spawn() to make the child process accessible

example-api

  • Updated to Grind 0.7
  • Replaced usage of the babel-node cli wrapper by integrating babel-register directly into the booters (this should speed things up slightly and remove unnecessary headaches when forking).
  • Updated Cli booter to use the new Runner class

example-web

  • Updated to Grind 0.7
  • Updated design to better reflect the official Grind site
  • Switched from Nunjucks to Stone, Grind’s new official first party templating engine
  • Replaced usage of the babel-node cli wrapper by integrating babel-register directly into the booters (this should speed things up slightly and remove unnecessary headaches when forking).
  • Fixed a bug in ErrorHandler when comparing error codes
  • Updated Cli booter to use the new Runner class

html

  • Added support for old input to FormBuilder
  • Added trailing slash to FormBuilder.input() for consistency with HtmlBuilder
  • Fixed FormBuilder._transforKey() incorrectly stripping arrays
  • Fixed FormBuilder.model conflicting between property and function
  • Fixed a bug in HtmlBuilder.entities() that wouldn‘t render numbers
  • Fixed bug in FormBuilder.textarea() that would error on null value
  • Fixed bug in HtmlBuilder._listing()
  • Fixed bug in HtmlBuilder.attributes() when passing in null
  • Fixed errors in FormBuilder._getSelectedValue() when nulls are passed in
  • Fixed incorrect enumeration in FormBuilder._optionGroup() causing an error
  • Fixed incorrect enumeration in FormBuilder.select() causing an error
  • Fixed incorrect values returned from FormBuilder.selectMonth()
  • Fixed issue in FormBuilder._getCheckboxCheckedState() where it would fail to compare values of different types (1 vs “1”)
  • Reordered logic in FormBuilder.getValueAttribute() to boost performance
  • Replaced html-entities with he
  • Updated CSRF integration with FormBuilder

orm

  • Added QueryBuilder.paginate()
  • Added QueryBuilder.orFail()
  • Added ModelNotFoundError
  • Improved date handling:
    • Added Model.useTimestamps as a way to turn off timestamps
    • Added Model.createdAt + Model.updatedAt to define timestamp column names
    • Added Model.dates, Model.asDate() and Model.asDatabaseDate() to convert DB dates to/from dates
  • Improved Model.describe()
  • Fixed a bug in QueryBuilder.eager() that was reassigning filters
  • Deprecated QueryBuilder.subset()
  • Deprecated support for Objection 0.4.x

queue

  • Added ConfigBuilder that supports the new global redis.json config file (learn more)
  • Cleaned up legacy code in commands
  • Switched to use grind-support’s inflector
  • Added implementation for Queue.destroy()
  • Fixed a bug where failed jobs called done() twice
  • Added isDelayedFor() function

Substantial changes are coming to Queue, checkout grindjs/queue#4 for more information.


stone

This is the initial release of Stone for Grind. Stone is syntactically based on Laravel’s Blade, however the internally implementation is completely independent.

Learn more about Stone.


support

  • Added Obj.filter(obj, callback(key, value)) to allow you to filter the entries in an object by keys and/or values
  • Added Obj.only(obj, keys) as a quick way to filter an object to only the passed in keys
  • Added Obj.except(obj, keys) as a quick way to filter an object to exclude the passed in keys
  • Added Str.ascii to convert or strip unicode characters to ascii
  • Added Str.slug, largely based on the slug package but avoids the slow call to unicode.org
  • Dropped dependency on fs-promise:
    • On platforms running Node 8 or later, FS takes advantage of the new promisify util
    • On older platforms, each method has been explicitly implemented with promise support
    • fs-promise is slow to load, causing grind-support to take 40ms+ to load vs 5ms without it
    • recursive-readdir and mkdirp are now required as-needed instead of upfront, as most apps won‘t use them
  • Added Watcher class to abstract logic that requires restarting a piece of code when files change

toolkit

Updated for Grind 0.7


validation

This is the initial release of Validation for Grind. Validation is powered by the popular Joi validation package.

Learn more about Validation.


view