jaguar_reflect 2.4.1

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

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.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.1

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.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
2.1.2 May 21, 2018 Go to the documentation of jaguar_reflect 2.1.2 Download jaguar_reflect 2.1.2 archive
2.1.1 May 20, 2018 Go to the documentation of jaguar_reflect 2.1.1 Download jaguar_reflect 2.1.1 archive
2.0.2 May 18, 2018 Go to the documentation of jaguar_reflect 2.0.2 Download jaguar_reflect 2.0.2 archive
2.0.1 May 18, 2018 Go to the documentation of jaguar_reflect 2.0.1 Download jaguar_reflect 2.0.1 archive

All 42 versions...

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

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: other

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

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.65 <3.0.0
jaguar ^2.4.1 2.4.5
Transitive dependencies
auth_header 2.1.2
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
http_server 0.9.8
jaguar_common 2.1.4
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 any
jaguar_resty ^2.8.0
test ^1.3.0