jaguar_reflect 2.4.6

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 79

jaguar_reflect #

Uses reflection instead of source generation to serve Jaguar Api classes.

Usage #

A simple usage example:

final book = new Book.make('0', 'Book1', ['Author1', 'Author2']);

@Api(path: '/api/book')
class BooksApi {
  @Get()
  Response<String> addBook(Context ctx) => Response.json(book.toMap());
}

Future<Null> main(List<String> args) async {
  final jaguar = new Jaguar(port: 8005);
  jaguar.addApi(reflect(new BooksApi()));
  await jaguar.serve();
}

Changelog #

2.4.6 #

  • Websocket support

2.4.4 #

  • Support for dontBind

2.4.2 #

  • Bindings

2.1.6 #

  • Dart 2 stable

2.1.3 #

  • Dart2 fixes

1.3.1 #

  • Faster processing of simple routes

1.2.6 #

  • Allow Symbols in Wrap and WrapOne

1.2.1 #

  • Wrap and WrapOne now take InterceptorCreator creator instead of Symbol

1.1.5 #

  • Bump to version 1.x.x

0.7.0 #

  • Jaguar 0.7.x

0.3.3 #

  • Collect inherited wrappers

0.3.2 #

  • Detect interceptor wrappers on RouteGroups and Apis

0.3.1 #

  • Fixed bug involving multiple groups

0.0.1 #

  • Initial version, created by Stagehand

example/example.dart

library jaguar.example.routes;

import 'package:jaguar/jaguar.dart';
import 'package:jaguar_reflect/jaguar_reflect.dart';

@GenController()
class ExampleController extends Controller {
  @Get()
  String get(Context ctx) => 'Get';

  @Post()
  String post(_) => 'Post';

  @Put()
  String put(_) => 'Put';

  @Delete()
  String delete(_) => 'Delete';

  @override
  void before(Context ctx) {
    print("here");
  }
}

main() async {
  Jaguar server = new Jaguar(port: 10000);
  server.add(reflect(new ExampleController()));
  await server.serve();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  jaguar_reflect: ^2.4.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:jaguar_reflect/jaguar_reflect.dart';
  
Version Uploaded Documentation Archive
2.4.6 Mar 26, 2019 Go to the documentation of jaguar_reflect 2.4.6 Download jaguar_reflect 2.4.6 archive
2.4.5 Jan 28, 2019 Go to the documentation of jaguar_reflect 2.4.5 Download jaguar_reflect 2.4.5 archive
2.4.4 Jan 28, 2019 Go to the documentation of jaguar_reflect 2.4.4 Download jaguar_reflect 2.4.4 archive
2.4.2 Jan 28, 2019 Go to the documentation of jaguar_reflect 2.4.2 Download jaguar_reflect 2.4.2 archive
2.4.1 Sep 18, 2018 Go to the documentation of jaguar_reflect 2.4.1 Download jaguar_reflect 2.4.1 archive
2.2.0 Aug 14, 2018 Go to the documentation of jaguar_reflect 2.2.0 Download jaguar_reflect 2.2.0 archive
2.1.8 Aug 14, 2018 Go to the documentation of jaguar_reflect 2.1.8 Download jaguar_reflect 2.1.8 archive
2.1.6 Aug 7, 2018 Go to the documentation of jaguar_reflect 2.1.6 Download jaguar_reflect 2.1.6 archive
2.1.4 Jul 7, 2018 Go to the documentation of jaguar_reflect 2.1.4 Download jaguar_reflect 2.1.4 archive
2.1.3 Jun 28, 2018 Go to the documentation of jaguar_reflect 2.1.3 Download jaguar_reflect 2.1.3 archive

All 46 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
60
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

We analyzed this package on Apr 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: other

Primary library: package:jaguar_reflect/jaguar_reflect.dart with components: io, mirrors.

Health suggestions

Fix lib/reflect/reflect.dart. (-1 points)

Analysis of lib/reflect/reflect.dart reported 2 hints:

line 86 col 9: Use isEmpty instead of length

line 112 col 9: Use isEmpty instead of length

Maintenance suggestions

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.65 <3.0.0
jaguar ^2.4.32 2.4.36
meta >1.1.0 <2.0.0 1.1.7
Transitive dependencies
auth_header 2.1.2
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
http_server 0.9.8+1
jaguar_common 2.1.4
jaguar_serializer 2.2.12
logging 0.11.3+2
mime 0.9.6+2
path 1.6.2
path_tree 2.2.2
stack_trace 1.9.3
typed_data 1.1.6
Dev dependencies
http ^0.12.0
jaguar_resty ^2.8.0
test ^1.3.0