leftovers...

about grails groovy

Grails 3.3.0 リリース!!

Grails 3.3.0 がリリースされました!

アメリカのミネアポリスではGr8conf USが開催されています。

OCIオフィシャルブログでのリリース記事:
http://grailsblog.objectcomputing.com/posts/2017/07/26/grails-3.3-ga-released.html

Grails 3.3.GA更新内容:
公式ドキュメントも確認してね: 1 Introduction 3.3.8

GORM 6.1
プラグインなのでGrails 3.2.x系でも使えます。

  • マルチテナントAST変換
  • @Transactionalと@Rollbackトランスフォームの再構築
  • TenantServiceとTransactionServiceのような共通サービス
  • データサービスコンセプト - インターフェイスへの実装を自動化!
  • ビーンバリデーションAPI対応
  • JPAアノテーション対応
  • 容易なUnitテストとパッケージスキャン
  • Neo4j Bolt 1.2 ドライバー対応
  • MongoDB 3.4 ドライバー対応

詳しくはGORM6.1のドキュメントを参照!
http://gorm.grails.org/6.1.x/whatsNew/manual/index.html


イベントAPI
EventBusの抽象化などが行われています。
そして、本体からイベント関連が分離され、Grails Async Frameworkとなりました。
Events APIを使用する場合build.gradleに以下を追加

runtime "org.grails.plugins:events:3.3.0"

RxJavaをEventBusに使用する場合は、

runtime "org.grails:grails-events-rxjava:3.3.0"

詳しくはドキュメントをみてね!


新たなテストフレームワーク
Grails 3.3では、元の@TestMixinベースのフレームワークを新たなTraitベーステストフレームワークに置き換えられました。
これによりシンプルに実装できデバッグも容易になりコード補完も向上しています。

import spock.lang.Specification
import grails.testing.web.controllers.ControllerUnitTest

class HelloControllerTests extends Specification implements ControllerUnitTest<HelloController> {

    void "Test message action"() {
        when:"The message action is invoked"
        controller.message()

        then:"Hello is returned"
        response.text == 'Hello'
    }
}


JSON Views 1.2
JSON Views 1.2プラグインGrails 3.3.の"rest-api"プロファイルに含まれています。
いくつか新機能が追加されました。


各種ライブラリバージョン

  • Hibernate 5.1.5 (新規アプリ作成ではこのバージョンがデフォルトになります)
  • Spring Framework 4.3.9
  • Spring Boot 1.5.4
  • Gradle 3.5 (Grails 3.3 は Gradle 4.x系とも互換性があります。)
  • Spock 1.1


その他


Grails 3.3.0.GA公式リリースノート
https://github.com/grails/grails-core/releases/tag/v3.3.0
http://docs.grails.org/3.3.x/guide/introduction.html#whatsNew

チェンジログ https://github.com/grails/grails-core/milestone/198?closed=1
コミット https://github.com/grails/grails-core/compare/v3.3.0.M1...v3.3.0?w=1
ダウンロード https://github.com/grails/grails-core/releases/download/v3.3.0/grails-3.3.0.zip
ドキュメント http://docs.grails.org/3.3.x/