- 007e201: Upgrade Fastify to v5.
- 080f5d8: Harmonize author and keywords fields
- a97a6a0: Use Apache 2.0 license
- b26b6e9: Add support for turtle compression
- 76c0832: Add compression support for additional content-types: n-triples, n-quads, trig and JSON SPARQL results.
-
1cafa55: Support for compression by default.
This change is considered as a breaking change as the
routeHandler
now needs to return thereply
object in order to be compatible with the support for compression. This is necessary to allow the server to handle the compression of the response.Before migrating, make sure to update your custom plugins and upgrade all plugins to the latest version.
- 1cafa55: Return
reply
in therouteHandler
, in order to be compatible with the support for compression.
- 27d3bc1: Introduce a
server.logFormat
configuration option, to either output JSON or pretty-formated logs.
- b03bdb5: Fix support of root path for the static plugin.
- eff233a: Export
getListenerURL
function that can be used for any test case for example.
- 2346a1c: Bump
pino
from 8.20.0 to 9.1.0
- 009d545: Upgrade
sparql-http-client
to v3.0.0
- 46e7670: Add support for
application/sparql-query
content type
-
2a6b31f: Add a
server.options
field to configure the Fastify instance with extra fields.Here is a list of all supported options: https://fastify.dev/docs/latest/Reference/Server/#factory
-
2a6b31f: Remove old
server.express
configuration field, which was deprecated.
- 3f2271d: Allow to send custom headers to a SPARQL endpoint using the
query
function
- 6667f40: The locals plugins should use the cookies path set as
/
.
- e8faa76: The
render
function requires the request as first argument.
-
849fa3d: Health check is now exposed at
/healthz
instead of/health
-
4b515f8: Use 'plugins' instead of 'middlewares'
-
849fa3d: Trifid Plugins should return an object:
/** @type {import('trifid-core/types/index.js').TrifidPlugin} */ const factory = async (trifid) => { return { defaultConfiguration: async () => { return { methods: ["GET"], paths: ["/hello"], // ... }; }, routeHandler: async () => { /** * Route handler. * @param {import('fastify').FastifyRequest} _request Request. * @param {import('fastify').FastifyReply} reply Reply. */ const handler = async (_request, reply) => { reply.send("Hello, world!"); }; return handler; }, }; }; export default factory;
The factory should also be a promise.
Previously, the factory was a function that returned an Express middleware. Since the move to Fastify, we are now returning an object with two methods:
defaultConfiguration
androuteHandler
. TherouteHandler
method should return a route handler function. ThedefaultConfiguration
method should return the default configuration for the plugin. This allows the user to use the plugin with the default configuration or to override it. This can be useful to simplify the Trifid configuration files. -
d9963cd: Remove the
rewrite
middleware
- a454dbb: Expose a
query
function that can be used in all plugins to perform a SPARQL query - 1dd9ae7: Allow listening on a random port by using port
0
.
- 3ab5eb3: Add support for JSON-encoded and URL-encoded bodies by default
- 69d6ad0: Improve included TypeScript types.
- 371f4f8: Do not display a body in case of errors. This is not possible without breaking components that are using hijackresponse for now.
-
a94543c: Improve types in general.
trifid.start
now returns aPromise<import('http').Server>
instead ofvoid
. This allows to wait for the server to be ready before doing anything else. -
552ecf9: The errors middleware is now returning the description of the status code in the body.
- cb227a3: Use toString method to convert IRI URL into a string
- 141786b: Upgrade dependencies
- 735bf99: Import trifid-core into trifid mono-repo.
- 42a309f: Upgrade yaml to 2.2.2
- 42a309f: Upgrade some dev dependencies
- 42a309f: Upgrade pino to 8.14.1
- 42a309f: Upgrade commander to 10.0.1
- 6b895c8: Publish lock file and upgrade some dependencies
- 19979b7: Have more open CORS policy