spring-fu

Introduction: Spring Fu is an experimental Kotlin micro-framework that makes it easy to create lightweight Spring-powered applications with functional APIs instead of annotations
More: Author   ReportBugs   
Tags:

= Spring Fu

image::https://ci.spring.io/api/v1/teams/spring-fu/pipelines/spring-fu/badge["Build Status", link="https://ci.spring.io/teams/spring-fu/pipelines/spring-fu"]

Spring Fu is an incubator for new Spring features about Kotlin and functional bean registration. Its main feature is an alternative way of configuring Spring Boot applications with Kotlin DSL and lambdas instead of annotations: http://repo.spring.io/snapshot/org/springframework/fu/spring-fu-kofu/0.0.3.BUILD-SNAPSHOT/spring-fu-kofu-0.0.3.BUILD-SNAPSHOT-javadoc.jar!/kofu/org.springframework.fu.kofu/application.html[Kofu (for Kotlin and functional) configuration]. Other features like https://github.com/spring-projects/spring-fu/tree/master/coroutines[Coroutines] or GraalVM support are also included.

A Java variant called Jafu (for Java and functional) is https://raw.githubusercontent.com/spring-projects/spring-fu/master/samples/jafu-reactive-minimal/src/main/java/com/sample/JafuApplication.java[also available] (just a POC for now).

It is not intended to be used in production, but rather to incubate and get feedback and contributions from the community in order to reach a point where its features can be integrated as part of existing Spring projects like Framework, Boot and Data. The table bellow summarize the status of current features.

== Status

|===== a|Feature |Status |Related issue

a| http://repo.spring.io/snapshot/org/springframework/fu/spring-fu-kofu/0.0.3.BUILD-SNAPSHOT/spring-fu-kofu-0.0.3.BUILD-SNAPSHOT-javadoc.jar!/kofu/org.springframework.fu.kofu/application.html[Kofu] and https://github.com/spring-projects/spring-fu/tree/master/jafu[Jafu] configuration DSL a| Incubating in Spring Fu a| Slightly related: https://github.com/spring-projects/spring-boot/issues/8115[spring-boot#8115] To be created in Spring Boot issue tracker

a| More efficient Spring Boot startup via https://github.com/spring-projects/spring-fu/tree/master/autoconfigure-adapter[functional bean registration] a| Manually created in Spring Fu

Experimented by https://github.com/dsyer[Dave Syer] in https://github.com/dsyer/spring-init-experiment[spring-init-experiment] and https://github.com/dsyer/spring-boot-micro-apps[spring-boot-micro-apps]

Could be generated during Spring Boot build in the future a| To be created in Spring Boot issue tracker

a| https://github.com/spring-projects/spring-fu/tree/master/coroutines[Coroutines support] a| Incubating in Spring Fu a| https://jira.spring.io/browse/SPR-15413[SPR-15413] https://github.com/Kotlin/kotlinx.coroutines/issues/254[kotlinx.coroutines#254] https://github.com/Kotlin/kotlinx.coroutines/issues/284[kotlinx.coroutines#284] To be created in Spring Data issue tracker for MongoDB and SQL support

a| Data classes support for configuration properties a| Expected in Spring Boot 2.2 (to be confirmed) a| https://github.com/spring-projects/spring-boot/issues/8762[spring-boot#8762]

a| https://github.com/spring-projects/spring-fu/tree/master/samples/kofu-graal[GraalVM native images support] a| Initial support done in Spring Framework 5.1

Work in progress on GraalVM side a| https://jira.spring.io/browse/SPR-16991[SPR-16991]

https://github.com/spring-projects/spring-boot/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22theme%3A+graal%22+[spring-boot graal theme]

a| Better Kotlin documentation a| Not started yet a| https://jira.spring.io/browse/SPR-17245[SPR-17245]

a| https://github.com/spring-projects/spring-fu/issues/14[Gradle Kotlin DSL] a| Pull-request to be contributed a| https://github.com/spring-io/initializr/issues/334[initializr#334]

a| https://github.com/spring-projects/spring-fu/issues/69[Lite Kotlin reflection support] a| Incubating in Spring Fu a| https://jira.spring.io/browse/SPR-17008[SPR-17008]

a| https://github.com/spring-projects/spring-fu/issues/34[Spring classpath filtering via Gradle plugin] a| Not started yet a|

a| https://github.com/spring-projects/spring-fu/issues/85[Automated (and machine readable) HTTP API documentation] a| Not started yet a| https://github.com/spring-projects/spring-restdocs/issues/213[spring-restdocs#213]

|=====

== Getting started

=== Via start.spring.io

  • Create a Spring 2.1.0.RC1 project on https://start.spring.io/[start.spring.io],
  • Add the org.springframework.fu:spring-fu-kofu:0.0.3.BUILD-SNAPSHOT dependency
  • Use Kotlin 1.3.0-rc-190 available from http://dl.bintray.com/kotlin/kotlin-eap Maven repository.
  • Modify the generated *Application.kt file as following:
package com.example

import org.springframework.fu.kofu.application

val app = application {
    // ...
}

fun main() = app.run()

=== Samples

You can also have a look to the https://github.com/spring-projects/spring-fu/tree/master/samples/[sample applications].

=== Credits

In addition to the whole Spring and Reactor teams, special credits to:

Support Me
Apps
About Me
Google+: Trinea trinea
GitHub: Trinea