Skip to content

Commit

Permalink
Grails 3.1 M1 initial docs
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Sep 10, 2015
1 parent 296418f commit 16d95b1
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 8 deletions.
2 changes: 1 addition & 1 deletion quick-publish.sh
@@ -1 +1 @@
./gradlew -Ddisable.groovydocs=true -Dgrails.home=../dev docs
./gradlew -Ddisable.groovydocs=true -Dgrails.home=../dev publishGuide
33 changes: 33 additions & 0 deletions src/en/guide/introduction/whatsNew31.gdoc
@@ -0,0 +1,33 @@
Grails 3.1 is at the milestone stage, but already includes the following new features.

h4. Spring Boot 1.3 and Spring 4.2

Grails 3.1 has been upgraded to Spring Boot 1.3 and Spring 4.2.

h4. REST Profile

A new profile is available designed for the creation of pure REST applications without a UI.

To create a REST application use the @web-api@ profile as an argument to [create-app|commandLine]:

{code}
$ grails create-app myapp --profile=web-api
{code}

Then start interactive mode to see the available commands for the profile:

{code}
$ cd myapp
$ grails
{code}

If you hit TAB you will notice code generation commands specific to the profile including:

* @create-domain-resource@ - Creates a domain class annotated with the [Resource|api:grails.rest.Resource] annotation)
* @create-restful-controller@ - Creates a controller that extends [RestfulController|api:grails.rest.RestfulController].

h4. JSON and Markup Views

The REST profile includes the ability to define [JSON and Markup views|https://github.com/grails/grails-views] and the @build.gradle@ features the ability to compile these views for production use.

The REST profile also creates [JSON views|https://github.com/grails/grails-views] to render the @index@ action and common commands such as [generate-views|commandLine] have been overridden to generate JSON views.
12 changes: 9 additions & 3 deletions src/en/guide/toc.yml
@@ -1,5 +1,7 @@
introduction:
title: Introduction
whatsNew31:
title: What's new in Grails 3.1?
whatsNew:
title: What's new in Grails 3.0?
coreFeatures: Core Features
Expand All @@ -22,9 +24,13 @@ gettingStarted:
creatingArtefacts: Creating Artefacts
generatingAnApplication: Generating an Application
upgrading:
title: Upgrading from Grails 2.x
upgradingPlugins: Upgrading Plugins
upgradingApps: Upgrading Applications
title: Upgrading from previous versions of Grails
upgrading3x:
title: Upgrading from Grails 3.0
upgrading2x:
title: Upgrading from Grails 2.x
upgradingPlugins: Upgrading Plugins
upgradingApps: Upgrading Applications
conf:
title: Configuration
config:
Expand Down
1 change: 1 addition & 0 deletions src/en/guide/upgrading/upgrading2x.gdoc
@@ -0,0 +1 @@
This guide takes you through the fundamentals of upgrading a Grails 2.x application or plugins to Grails 3.x.
File renamed without changes.
36 changes: 36 additions & 0 deletions src/en/guide/upgrading/upgrading3x.gdoc
@@ -0,0 +1,36 @@
Generally to upgrade an application from Grails 3.0 you can simply modify the version of Grails in @gradle.properties@.

There are however some differences to Grails 3.0.x that are documented below.

h4. Spring Boot 1.3 and Spring 4.2

Grails 3.1 ships with upgraded third party libraries that may require changes. See the [Spring Boot upgrade notes|https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.3-Release-Notes] for information.

h4. Resource annotation defaults to JSON instead of XML

The [Resource|api:grails.rest.Resource] annotation applied to domain classes defaults to XML in Grails 3.0.x, but in Grails 3.1.x and above it defaults to JSON.

If you use this annotation with the expecation of produces XML responses as the default you can modify the definition as follows:

{code}
import grails.rest.*

@Resource(formats=['xml', 'json'])
class MyDomainClass {}
{code}

This will restore the Grails 3.0.x behavior.

h4. Geb and HTMLUnit 2.18

If you use Geb with HTMLUnit (something that is not recommended, as a more native driver such as PhantomJS is recommended) you will need to upgrade your dependencies in @build.grade@:

{code}
testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1'
testRuntime 'net.sourceforge.htmlunit:htmlunit:2.18'
{code}

Note that there are also some changes in behavior in HTMLUnit 2.18 that may cause issues in existing tests including:

* Expressions that evaluate the title (Example @$('title')@) now return blank and should be replaced with just @title@
* If you return plain text in a response without surrounding HTML tags, these are no longer regarded as valid responses and should be wrapped in the required tags.
8 changes: 4 additions & 4 deletions travis-build.sh
Expand Up @@ -19,16 +19,16 @@ if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then

version="$TRAVIS_TAG"
version=${version:1}
zipName="grails-docs-$version"
export RELEASE_FILE="${zipName}.zip"
zipName="grails-docs-$version"
export RELEASE_FILE="${zipName}.zip"

milestone=${version:5}
# if [[ -n $milestone ]]; then
if [[ -n $milestone ]]; then
git rm -rf latest/
mkdir -p latest
cp -r ../build/docs/. ./latest/
git add latest/*
# fi
fi

majorVersion=${version:0:4}
majorVersion="${majorVersion}x"
Expand Down

0 comments on commit 16d95b1

Please sign in to comment.