redstone 0.6.8
redstone: ^0.6.8 copied to clipboard
A metadata driven microframework for Dart
v.0.6.8 #
- Exposed endpoint mirrors to let a user create his plugin.
0.6.7 #
- Fixed issue with query parameters not being managed correctly when the type is
List. - Redirections are not considered as error anymore. When
showError: true, it won't be an error anymore. - Fixed analyzer warnings.
- Cleaned the Group Scanner.
- Refactored some tests
- Added more tests
A big thanks to @sestegra for all those very welcomed changes.
0.6.6 #
Drop package:crypto. Update other package dependencies and fix some strong-mode issues. Also fixes definitions of == and hashCode.
0.6.5 #
Bug fix: http_body_parser tries to parse body of GET Requests
0.6.4 #
- Fixed a bug with HTTPS, where one could not start the server when using HTTPS.
- Updated dependencies
0.6.3 #
- Updated dependencies in order to update plugins.
0.6.2 #
- Updated dependencies in order to update plugins.
0.6.1 #
BREAKING CHANGE #
In this version, the minimum SDK version was bumped to 1.13.0 because of the Boring SSL update.
- Updated dependencies
- Upgraded tests with SSL to the new Boring SSL stuff.
- Converted the documentation to 0.6.x
0.6.0-beta.2 #
NOTE: this is a pre-release version!
- Updated test package dependency
- Updated the https example with the new BoringSSL stuff. That means the
secureOptionsin the server.start() function takes a#contextwhich is aSecurityContext. Seeexample/https.dartfor more usage example.
0.6.0-beta.1 #
NOTE: this is a pre-release version!
- Updated to shelf 0.6
- Added the optional parameter
headerstochain.forward() - Added the
request.handlerPathproperty (see shelf.Request.handlerPath) - Bug fixes.
0.6.0-alpha.3 #
NOTE: this is a pre-release version!
- Added new constants for the commons http methods. #80
- Added the
sharedandlogSetUpoptional parameters to thestart()function
0.6.0-alpha.2 #
NOTE: this is a pre-release version!
- Renamed
request.queryParamstorequest.queryParameters - Renamed
request.pathParamstorequest.urlParameters - Fix support for websocket connections
- Fix code comments to match the new API
0.6.0-alpha.1 #
NOTE: this is a pre-release version!
-
Version highlights:
- Fully rewritten from scratch! (The code base now has a better library layout, which is easier to maintain and evolve)
- Polished API (see breaking changes)
- Added the
chain.forward()function, which allows routes, interceptors and error handlers to internally dispatch a request to another resource - Added the
chain.createResponse()function, which can be used to easily createshelf.Responseobjects - Better support for
async/await(see breaking changes)
-
BREAKING CHANGES:
- Renamed
redstone/server.darttoredstone/redstone.dart - Renamed
QueryMaptoDynamicMap - Removed
Route.matchSubPathsproperty (route_hierarchicalsupports this by default now) - Renamed
setUp()andtearDown()toredstoneSetUp()andredstoneTearDown(). This avoids conflicts with the unittest package, if redstone is imported without a lib prefix. redstoneSetUp()now returns aFuture. You need to wait for its completion before dispatching any request.- Removed
authenticateBasic()top level function - Moved
parseAuthorizationHeader()top level function to therequestobject (request.parseAuthorizationHeader()) - Removed the
chain.interrupt()function. - The
chain.next()andchain.abort()functions now return aFuture<shelf.Response>. It's necessary to wait for the completion of the returned future when calling one of these functions, although, it's now possible to use them with async/await expressions. See the example below. - The
chain.redirect()function now returns ashelf.Response - Redstone now generates an error page for every response which status code is less than 200, or greater than 299. To prevent this behavior, set
showErrorPageto false - For interceptors and error handlers, it's now necessary to annotate injectable parameters with
@Inject. Although, they now also accept the@Attrannotation, which binds a parameter with a request attribute. - Plugin API: Some methods of the
Managerobject are now getters. - Plugin API: Renamed
RouteHandlertoDynamicRoute - Plugin API: Renamed
HandlertoDynamicHandler - Plugin API:
DynamicRouteandRouteWrapperdo not receive thepathSegmentsmap anymore, although, it can be accessed through therequest.pathSegmentsproperty request.queryParamsis now aDynamicMap<String, List<String>>. Also, you can now use the@QueryParamannotation withListobjects
- Renamed
Example: CORS Interceptor
import 'package:redstone/redstone.dart';
import "package:shelf/shelf.dart" as shelf;
@Interceptor(r'/.*')
handleCORS() async {
if (request.method != "OPTIONS") {
await chain.next();
}
return response.change(headers: {"Access-Control-Allow-Origin": "*"});
}
- TODO:
- Improve unit tests
- Update plugins (redstone_mapper and redstone_web_socket aren't compatible with this version yet)
- Improve documentation and website
0.5.19 #
0.5.18 #
- Updated to Grinder v0.6.1 (see documentation)
0.5.17 #
- Updated dependencies.
- Added the
autoCompressparameter to thestart()function. - Added
Route.statusCodeandDefaultRoute.statusCodeparameters.
Note: this version requires Dart 1.7 or above
0.5.16 #
- Fix: Setting a new value in a
QueryMapwith the dot notation is not working properly.
0.5.15 #
- Fix: Correctly log an exception when no stack trace is provided
0.5.14 #
- Fix:
Manager.findMethods()should include inherited methods.
0.5.13 #
- Improved plugin API:
- Added the
Manager.getInjector()andManager.createInjector()methods, which allow plugins to retrieve objects from di modules more easily. - Added the
Manager.findFunctions(),Manager.findClasses()andManager.findMethods()methods, which allow plugins to scan imported libraries. - Added the
Manager.getShelfHandler()andManager.setShelfHandler()methods, which allow plugins to access and replace the current installed shelf handler.
- Added the
0.5.12 #
- New feature: If a route has
matchSubPaths = true, the requested subpath can be assigned to a parameter (see issue #36).
0.5.11 #
- Minor performance fix: Redstone.dart shouldn't create a new
shelf.Pipelineper request.
0.5.10 #
- Upgraded to di 2.0.1
0.5.9 #
- Fix: Redstone.dart can't be used with shelf_web_socket (issue #30).
0.5.8+1 #
- Fixed docgen issue (see dartdocs log)
0.5.8 #
- Added support for https (Thanks to vicb PR #26, see documentation)
- Code cleanup (Thanks to vicb PR #29)
- Fix: Properly handle error responses produced by a shelf handler
0.5.7+2 #
- Improved error handling. See issue #24.
0.5.7+1 #
- Fixed docgen issue (see dartdocs log)
0.5.7 #
- Improved plugin API:
- It's now possible to inspect installed routes, interceptors, error handlers and groups.
- Added the
Manager.addRouteWrapper()method, which allows plugins to modify routes that are annotated with a specific annotation.
0.5.6 #
- Fixed logging issues.
0.5.5+1 #
- Fixed issue with docgen.
0.5.5 #
- Added the
ErrorResponseclass. A route can return or throw an ErrorResponse, to respond a request with a status code different than 200.
0.5.4 #
- Fix: Response processors are not being invoked when a route returns a
Future(Plugin API). - Code cleanup (Thanks to vicb PR #20)
- Added the
QueryMapclass, a Map wrapper that allows the use of the dot notation to retreive its values (Thanks to digitalfiz issue #18)app.request.queryParams,app.request.headersandapp.request.attributesnow returns a QueryMap.- The request body can also be retrieved as a QueryMap.
- Added the
handleRequest(HttpRequest)method.
0.5.3+1 #
- Widen the version constraint for
di
0.5.3 #
- Improved integration with Shelf
shelf.Request.hijack()method is now supported (although it does not work in unit tests)- The default error handler now uses the
stack_tracepackage to print stack traces.
0.5.2 #
- Fix: Request's state is being improperly cached (see issue #16).
0.5.1 #
- Fix: Correctly handle route exceptions.
0.5.0 #
- Added support for Shelf middlewares and handlers (see documentation)
- BREAKING CHANGE: Redstone.dart will no longer serve static files directly. You can use a Shelf handler for this (see documention)
- BREAKING CHANGE: It's no longer possible to access
HttpRequestandHttpResponse. If you need to inspect or modify the response, you can use the globalresponseobject (see documentation) - It's now possible to define multiple routes to the same path (see documentation)
- Added
@DefaultRouteannotation (see documentation) - Added
serveRequests(Stream<HttpRequest> requests)method, which is an alternative to thestart()method.
0.4.0 #
- Added new annotations:
@Installand@Ignore(see documentation) - Added support for plugins (see documentation)
0.3.1 #
- Renamed project to Redstone.dart
- New and improved documentation
0.3.0 #
- Added
Route.matchSubPathsproperty (see issue #5) - Added
ErrorHandler.urlPatternproperty (check documentation for details) - Added request attributes (check documentation for details)
- Added support for dependency injection (check documentation for details)
0.2.1 #
- Added support for basic authentication (thanks Y12STUDIO for the contribution)
- Added
parseAuthorizationHeader()method. - Added
authenticateBasic()method.
- Added
0.2.0 #
- BREAKING CHANGES (check documentation for more details):
- VirtualDirectory is now configured with
jailRoot = trueandfollowLinks = false. You can change these flags throughstart()method. - For security and perfomance reasons, the parse of request body is now delayed as much as possible, so interceptors will receive
nullif they callrequest.body(although request.bodyType is still filled). If your interceptor need to inspect the request body, you can setInterceptor.parseRequestBody = true. - Multipart requests (file uploads) are now refused by default. If your method need to receive multipart requests, you can set
Route.allowMultipartRequest = true. - All arguments of
chain.interrupt()method are now optional.
- VirtualDirectory is now configured with
- Bug fixes in
abort(),redirect()andchain.interrupt()methods. (see issue #3).
0.1.2 #
- Fix: bloodless crashes on Dart 1.3.
0.1.1 #
- Fix: malformed requests can cause a crash
0.1.0 #
- Bug fixes
- BREAKING CHANGE:
chain.next()now receives a callback, instead of returning aFuture - Added new API for unit tests
- Updated documentation
0.0.4 #
- Fix:
chain.interrupt()is not closing theHttpResponsestream
0.0.3 #
- Added a grinder task to properly copy sever's files to the build folder
- Updated documentation with a better approach for building projects
0.0.2 #
- Small fix to VirtualDirectory configuration
0.0.1 #
- First release