Commit Graph

40 Commits

Author SHA1 Message Date
Sergio Benitez 9cb031a47d Modularize contrib. 2018-10-09 04:31:09 -07:00
Sergio Benitez 61f107f550 Reimplement route attribute as a proc-macro.
This commits also implement the query reform from #608. It also consists
of many, many breaking changes. Among them are:

  * Query parts in route paths use new query reform syntax.
  * Routing for queries is now lenient.
    - Default ranking has changed to reflect query reform.
  * Format routing matching has been fixed.
    - Routes with formats matching "accept" will always collide.
    - Routes with formats matching "content-type" require requests to
      have an equivalent content-type header to match.
    - Requests with imprecise content-types are treated as not having a
      content-type.
  * Generated routes and catchers respect visibility modifiers.
  * Raw getter methods from request were renamed and retooled.
    - In particular, the index parameter is based on segments in the
      route path, not dynamic parameters.
  * The method-based attributes no longer accept a keyed 'path'.
  * The 'rocket_codegen' crate is gone and will no longer be public.
  * The 'FormItems' iterator emits values of type 'FormItem'.
    - The internal form items' string can no longer be retrieved.
  * In general, routes are more strictly validated.
  * Logging from codegen now funnels through logging infrastructure.
  * Routing has been optimized by caching routing metadata.

Resolves #93.
Resolves #608.
Resolves #693.
Resolves #476.
2018-10-09 04:18:04 -07:00
jeb 30cf75335b Embed the diesel database migrations in the `todo` example.
`diesel_cli` is no longer needed for running the example or its tests.
2018-09-11 12:38:10 -07:00
Sergio Benitez cb18954ef2 Use 'StaticFiles' in todo example. 2018-08-24 14:00:36 -07:00
Sergio Benitez fe9fad339e Clean up connection pooling documentation. 2018-08-15 23:31:49 -07:00
Eric Dattore 60b9f06407 Implement connection pooling support in contrib.
Resolves #167.
2018-08-15 22:11:53 -07:00
Sergio Benitez f8c36f5c67 Update 'diesel', 'parking_lot', and 'rand' dependencies in 'todo' example. 2018-07-22 21:59:40 -07:00
Sergio Benitez f171dc9d09 Reorganize repository.
The directory structure has changed to better isolate crates serving
core and contrib. The new directory structure is:

  contrib/
    lib/ - the contrib library
  core/
    lib/ - the core Rocket library
    codegen/ - the "compile extension" codegen library
    codegen_next/ - the new proc-macro library
  examples/ - unchanged
  scripts/ - unchanged
  site/ - unchanged

This commit also removes the following files:

  appveyor.yml - AppVeyor (Rust on Windows) is far too spotty for use
  rustfmt.toml - rustfmt is, unfortunately, not mature enough for use

Finally, all example Cargo crates were marked with 'publish = false'.
2018-06-03 18:44:38 +02:00
Sergio Benitez d17b392538 Use diesel <= 1.2 while nightly issues persist. 2018-05-29 18:37:14 +02:00
Sergio Benitez 794dc66e3b Remove unnecessary 'dotenv' dependency in 'todo' example. 2018-02-25 20:20:06 -08:00
Sergio Benitez d4e590af83 Fix 'diesel' version in state guide and todo example. 2018-02-21 16:07:09 -08:00
Eric Dattore c48905f483 Use 'diesel::r2d2' in state guide and todo example.
Diesel now reexports r2d2, so rather than including that library
explicitly, let's leverage the reexport.
2018-02-21 15:53:02 -08:00
Sergio Benitez 65baa83fb4 Update dependencies.
* 'memchr' to 2.0
  * 'base64' to 0.9
  * 'smallvec' to 0.6
  * 'lazy_static' to 1.0

Update example dependencies.

  * 'rand' to 0.4
  * 'parking_lot' to 0.5
2018-01-05 02:00:26 -08:00
Sergio Benitez 24b2818f8c Update diesel to 1.0. 2018-01-03 01:38:11 -08:00
calhilcaw 401bedebb2 Update docs and examples for diesel 1.0.0-rc1. 2018-01-03 01:38:05 -08:00
Sergio Benitez 07d4d23cc8 Update dependencies. 2017-10-09 20:15:18 -07:00
Sergio Benitez 05944c01af Update diesel example dependency to 0.14. 2017-07-06 02:04:00 -07:00
Sergio Benitez ea485e52e8 Update diesel and rusqlite example dependencies. 2017-06-11 02:57:41 -07:00
Sergio Benitez 614ec1359e Add tests for 'todo' example. 2017-05-26 16:52:17 -07:00
Sergio Benitez 30fac32978 Upgrade dependencies to Serde 1.0.
Closes #272.
Resolves #273.
2017-04-24 17:37:18 -07:00
Sergio Benitez 301257623c Update diesel and rusqlite example dependencies. 2017-03-30 02:02:09 -07:00
Sergio Benitez a4f532da09 Set examplem versions to 0.0.0. 2017-03-08 14:29:24 -08:00
Sergio Benitez a15002877d Use connection pool in todo example. 2017-02-02 18:01:00 -08:00
Sergio Benitez 1a18c73970 Update to todo example to diesel 0.10. 2017-02-02 14:47:53 -08:00
Sergio Benitez 5fabb43a1b Update to serde 0.9, handlebars 0.25. Move from `map!` to `json!` macro.
Resolves #154.
2017-01-31 17:15:42 -08:00
Sergio Benitez c1697509ba Improve lints: gather info on per-instance basis. 2017-01-31 02:01:30 -08:00
Sergio Benitez 44e367c64c Remove authorship from all examples. 2017-01-19 17:14:01 -08:00
Sergio Benitez 3d0f7f2f80 Clarify todo example requirements. 2016-12-27 02:38:21 -06:00
Sergio Benitez 0be423a35e Updated dependency versions. 2016-12-09 20:14:49 -08:00
Sergio Benitez a9b12568d9 Update to upstream diesel. 2016-10-12 00:38:30 -07:00
Sergio Benitez 6275e576b5 Updates for latest nightly. Use Tera from main branch. 2016-10-08 19:27:33 -07:00
Sergio Benitez 920bd35d46 Update serde in examples. 2016-10-03 17:56:43 -07:00
Sergio Benitez f74e286e31 Add templating support in contrib crate.
The contrib crate now contains support for both Handlebars and Tera. No
documentation yet.

resolves #5
2016-09-22 04:12:07 -07:00
Sergio Benitez 46f73ed57c Renamed macros to codegen. 2016-09-08 20:38:58 -07:00
Sergio Benitez 1f19b88803 Use forked diesel to compile on latest nightly. 2016-09-04 14:24:48 -07:00
Sergio Benitez 025c9243c0 Now using a Cargo workspace for (much!) faster builds. Added a temporary query
params example.
2016-08-10 17:50:08 -07:00
Sergio Benitez d16d9bd0d7 Fixed todo example. Testing script now bootstraps when needed. 2016-08-06 19:57:44 -07:00
Sergio Benitez b767c1bdec Fixed Cargo.toml in todo for new diesel. Serde is still broken. 2016-08-05 21:57:55 -07:00
Sergio Benitez 578b50b1f9 Fully working todo example. Apparently didn't commit in a while. Need to be better at that. 2016-08-01 19:07:36 -07:00
Sergio Benitez 26b7b814f4 Progress on errors. Started Todo example.
The error function now takes in a "RoutingError" structure. The idea is that the
structure includes all of the information necessary for a user to processor the
error as they wish. This interface is very incomplete and may change. At a
minimum, the error structure should include:

  1) The request that failed.
  2) Why the request failed.
  3) The chain of attempted route matches, if any.
  4) Something else?
2016-07-15 21:09:08 -07:00