Knot.x 2.2.0
We are extremely pleased to announce that the Knot.x version 2.2.0 has been released.
New Features
Debuggable Fragments
With Knot.x, you can easily transform your business logic into a configurable graph structure.
The graph (task) defines
business operations (such as integration with an API) and decisions (if API
responds with A
then...). Task belongs to a fragment,
an abstraction that represents a client request (in some cases it can be an HTTP request, in other, a part of the page). Read more about configurable
integrations here.
From now, you can easily debug your business logic directly in your browser. See the Fragments Execution Log modules for more details.
Chrome Extension
It is an awesome tool that extends the Chrome Developer Tools, providing intuitive business logic debugging opportunities for developers, QAs and business analysts. It reads fragment(s) debug data (provided by Fragments Execution Log modules) and visualizes it.
You can read more about this new feature here or watch the live coding session.
Pebble Template Engine
Next to Handlebars, we add Pebble templates support! From now, you can use various templates within the single page. What is more, the same as Handlebars, the Pebble processing is thoroughly scalable with the Vert.x Event Bus.
<knotx:snippet data-knotx-task="payments-task">
<div>
<h2>Payment providers</h2>
<ul>
{% for this in root['fetchPayments']['_result'] %}
<li>
<p>Payment provider: {{this.name}}</p>
<p>Payment URL: {{this.paymentUrl}}</p>
</li>
{% endfor %}
</ul>
</div>
</knotx:snippet>
You can read more about this new feature here and see the example.
RestfulAPI support
API Communication logic is provided by configurable HTTP Action (note: you can easily provide your
custom implementation). HTTP Action configures endpoint details, HTTP request params and expected
response data. With Knot.x 2.2 you can fully configure your POST
/PUT
/PATCH
/DELETE
/HEAD
API
requests in the same way as you did it for GET
requests.
You can read more about this new feature here.
HOCON configs testing
HoconLoader loads the HOCON configuration files and converts them to JSON. With it, writing contract tests is even simpler.
You can read more about this new feature here.
Upgrade notes
Please note that we upgraded the Knot.x Examples to Knot.x 2.2
. See this PR
for more details.
API updates
Fragment API
Fragment API introduces the Fragment Operation and contains the FragmentResult model. This upgrade is required only if you implemented custom actions in your project.
- update package from
io.knotx.fragments.handler.api.domain.FragmentResult
toio.knotx.fragments.api.FragmentResult
Action API
Action API is extracted from Fragments Handler. This upgrade is required only if you implemented custom actions in your project.
- replace dependency:
knotx-fragments-handler-api
->knotx-fragments-action-api
- update packages:
io.knotx.fragments.handler.api.Action
->io.knotx.fragments.action.api.Action
io.knotx.fragments.handler.api.ActionFactory
->io.knotx.fragments.action.api.ActionFactory
- rename
io.knotx.fragments.handler.api.ActionFactory
file in./src/main/resources/META-INF/services
toio.knotx.fragments.action.api.ActionFactory
Starter Kit project
Upgrade Gradle
Upgrade the Gradle version defined in ./gradle/wrapper/gradle-wrapper.properties
to 6.2.1
.
Upgrade Gradle plugins
- Upgrade Docker Gradle plugin defined in
./buildSrc/build.gradle.kts
fromcom.bmuschko:gradle-docker-plugin:5.3.0
tocom.bmuschko:gradle-docker-plugin:6.4.0
. - In the new Knot.x, all Knot.x Gradle plugins are released with each new version of Knot.x. We
recommend to configure them in
./settings.gradle.kts
:
Read Knot.x version and depencendies in starter kit for more details.pluginManagement { val knotxVersion: String by settings plugins { id("io.knotx.distribution") version knotxVersion id("io.knotx.release-base") version knotxVersion } }
Rename Gradle properties
The io.knotx.distribution
plugin uses knotx.version
and knotx.conf
properties defined in
./gradle.properties
. In Knot.x 2.2 we renamed those properties:
knotx.version
->knotxVersion
knotx.conf
->knotxConf
and update all references in./build.gradle.kts
Update Docker script
Replace the ./gradle/docker.gradle.kts
with the new version.
Fix references to GitHub resources
When applying scripts from GitHub, please update references from:
apply(from = "https://raw.githubusercontent.com/Knotx/knotx-starter-kit/master/gradle/docker.gradle.kts")
apply(from = "https://raw.githubusercontent.com/Knotx/knotx-starter-kit/master/gradle/javaAndUnitTests.gradle.kts")
to tag versions:
apply(from = "https://raw.githubusercontent.com/Knotx/knotx-starter-kit/${project.property("knotxVersion")}/gradle/docker.gradle.kts")
apply(from = "https://raw.githubusercontent.com/Knotx/knotx-starter-kit/${project.property("knotxVersion")}/gradle/javaAndUnitTests.gradle.kts")
Release Notes
Knot.x Gradle Plugins
- PR-10 Knot.x release gradle plugins
Knot.x Dependencies
- PR-33 - Migrate from Maven to Gradle.
Knot.x Commons
Knot.x Launcher
No important changes in this version.
Knot.x Junit5
- PR-56 - Move
HoconLoader
from theFragments
module toJUnit5
.
Knot.x Server Http
- PR-53 - Enable resolving placeholders without encoding.
- PR-46 - KnotxServer response configuration - wildcards 41
Knot.x Repository Connector
- PR-14 - Make filtering allowed headers case-insensitive
Knot.x Fragments
- PR-154 - Cleanup Fragments modules: renamed modules (
Actions
and all Task related once) to be more self-descriptive. Remove hidden API dependencies. - PR-149 - Enable invalid fragments processing when a request param or header specified.
- PR-148 - Add Fragment JSON Execution Log Consumer supporting debug data for JSON responses.
- PR-138 - Extract Fragment Execution Log Consumer API and Fragment HTML Body Writer.
- PR-136 - Extract Actions API & Core modules.
- PR-119 - Introduce Fragment Operation to link Action and Task Action Node.
- PR-120 - HTTP methods for Http Action - support for
POST
/PUT
/PATCH
/DELETE
/HEAD
and sending body. - PR-106 - Extract Task Engine.
- PR-100 - KnotxServer response configuration - wildcards, case-insensitive filtering allowed headers
- PR-99 - Http Action instances can be reused between requests.
- PR-96 - Move Http Action from Knot.x Data Bridge to Fragments repository. Actions moved to a new module
knotx-fragments-action-library
. - PR-80 - Circuit Breaker Behaviour understands which custom transitions mean error.
- PR-84 - Add the action log support Inline Payload Action.
- PR-83 - Add the action log support to Inline Body Action.
- PR-82 - Add the action log support to In-memory Cache Behaviour.
- PR-60 - Add the action log support to Circuit Breaker Behaviour. Enforce the
fallback
on error strategy. - PR-45 - Fragment Event Consumer mechanism implementation.
Knot.x Template Engine
Knot.x Stack
- PR-110 - Knotx/knotx-fragments#154 Fragments modules refactor.
- PR-100 - Knotx/knotx-fragments#135 Extract actions Core & API.
- PR-97 - Knotx/knotx-fragments#92 Extract HTML Fragment Event Consumer.
- PR-96 - Knotx/knotx-fragements#73 Functional test for various HTTP methods.
- PR-92 - Knotx/knotx-fragments#92 Functional tests for exposing task metadata.
- PR-87 - Knotx/knotx-fragments#92 Update scenario with more validations.
- PR-86 - #85 Different TE (handlebars and pebble) in fragments integration test.
- PR-78 - Knotx/knotx-fragments#95 Move HTTP Action from Knotx/knotx-data-bridge to Knotx/knotx-fragments.
- PR-77 - Knotx/knotx-fragments#92 Demo scenario for exposing data from task.
- PR-76 - Knotx/knotx-template-engine#20 Pebble Template Engine Integration Test
- PR-74 - knotx/knotx-dependecies#28 Migrate BOM to Gradle & add BOM to Gradle composite build.
- PR-72 - knotx/knotx-fragments#79 Configuration changes & functional tests..
- PR-69 - Circuit breaker:
_fallback
transition && fallback on failure strategy
Knot.x Docker
- PR-3 - migrate build to Gradle