Changelog History
Page 3
-
v0.3.9 Changes
April 26, 2018Core
- Core was updated for
2018-04-26
nightly. - Minimum required
rustc
is1.27.0-nightly 2018-04-26
. - Managed state retrieval cost was reduced to an unsynchronized
HashMap
lookup.
Codegen
- Codegen was updated for
2018-04-26
nightly. - Minimum required
rustc
is1.27.0-nightly 2018-04-26
.
Contrib
- A 512-byte buffer is preallocated when deserializing JSON, improving performance.
๐ Docs
- Fixed various typos in rustdocs and guide.
- Core was updated for
-
v0.3.8 Changes
April 07, 2018Codegen
- Codegen was updated for
2018-04-06
nightly. - Minimum required
rustc
is1.27.0-nightly 2018-04-06
.
- Codegen was updated for
-
v0.3.7 Changes
April 03, 2018Core
- Fixed a bug where incoming request URIs would match routes with the same path prefix and suffix and ignore the rest.
- Added known media types for WASM, WEBM, OGG, and WAV.
- Fixed fragment URI parsing.
Codegen
- Codegen was updated for
2018-04-03
nightly. - Minimum required
rustc
is1.27.0-nightly 2018-04-03
.
Contrib
- JSON data is read eagerly, improving deserialization performance.
๐ Docs
- Database example and docs were updated for Diesel 1.1.
- Removed outdated README performance section.
- Fixed various typos in rustdocs and guide.
Infrastructure
- Removed gates for stabilized features:
iterator_for_each
,i128_type
,conservative_impl_trait
,never_type
. - Travis now tests in both debug and release mode.
-
v0.3.6 Changes
January 12, 2018Core
Rocket.state()
method was added to retrieve managed state fromRocket
instances.- Nested calls to
Rocket.attach()
are now handled correctly. - JSON API (
application/vnd.api+json
) is now a known media type. - Uncached markers for
ContentType
andAccept
headers are properly preserved onRequest.clone()
. - Minimum required
rustc
is1.25.0-nightly 2018-01-12
.
Codegen
- Codegen was updated for
2017-12-22
nightly. - Minimum required
rustc
is1.24.0-nightly 2017-12-22
.
๐ Docs
- Fixed typo in state guide:
simplesimply. - Database example and docs were updated for Diesel 1.0.
Infrastructure
- Shell scripts now use
git grep
instead ofegrep
for faster searching.
-
v0.3.5 Changes
December 18, 2017Codegen
- Codegen was updated for
2017-12-17
nightly. - Minimum required
rustc
is1.24.0-nightly 2017-12-17
.
- Codegen was updated for
-
v0.3.4 Changes
December 14, 2017Core
NamedFile
'sResponder
implementation now uses a sized body when the file's length is known.#[repr(C)]
is used onstr
wrappers to guarantee correct structure layout across platforms.- A
status::BadRequest
Responder
was added.
Codegen
- Codegen was updated for
2017-12-13
nightly. - Minimum required
rustc
is1.24.0-nightly 2017-12-13
.
๐ Docs
- The rustdoc
html_root_url
now points to the correct address. - Fixed typo in fairings guide:
eventevents. - Fixed typo in
Outcome
docs:usersUsers.
-
v0.3.3 Changes
September 25, 2017Core
Config
'sDebug
implementation now respects formatting options.Cow<str>
now implementsFromParam
.Vec<u8>
now implementsResponder
.- Added a
Binary
media type forapplication/octet-stream
. - Empty fairing collections are no longer logged.
- Emojis are no longer emitted to non-terminals.
- Minimum required
rustc
is1.22.0-nightly 2017-09-13
.
Codegen
- Improved "missing argument in handler" compile-time error message.
- Codegen was updated for
2017-09-25
nightly. - Minimum required
rustc
is1.22.0-nightly 2017-09-25
.
๐ Docs
- Fixed typos in site overview:
bybe,Reponder
Responder
. - Markdown indenting was adjusted for CommonMark.
Infrastructure
- Shell scripts handle paths with spaces.
-
v0.3.2 Changes
August 15, 2017Core
- Added conversion methods from and to
Box<UncasedStr>
.
Codegen
- Lints were removed due to compiler instability. Lints will likely return as
a separate
rocket_lints
crate.
- Added conversion methods from and to
-
v0.3.1 Changes
August 11, 2017Core
- Added support for ASCII colors on modern Windows consoles.
- Form field renames can now include any valid characters, not just idents.
Codegen
- Ignored named route parameters are now allowed (
_ident
). - Fixed issue where certain paths would cause a lint
assert!
to fail (#367). - Lints were updated for
2017-08-10
nightly. - Minimum required
rustc
is1.21.0-nightly (2017-08-10)
.
Contrib
- Tera errors that were previously skipped internally are now emitted.
๐ Documentation
- Typos were fixed across the board.
-
v0.3.0 Changes
July 14, 2017๐ New Features
๐ This release includes the following new features:
- Fairings, Rocket's structure middleware, were introduced.
- [Native TLS support] was introduced.
- Private cookies were introduced.
- A
MsgPack
type has been added tocontrib
for simple consumption and returning of MessagePack data. - Launch failures (
LaunchError
) fromRocket::launch()
are now returned for inspection without panicking. - Routes without query parameters now match requests with or without query parameters.
- [Default rankings] range from -4 to -1, preferring static paths and routes with query string matches.
- A native
Accept
header structure was added. - The
Accept
request header can be retrieved viaRequest::accept()
. - Incoming form fields can be renamed via a new
#[form(field = "name")]
structure field attribute. - All active routes can be retrieved via
Rocket::routes()
. Response::body_string()
was added to retrieve the response body as aString
.Response::body_bytes()
was added to retrieve the response body as aVec<u8>
.Response::content_type()
was added to easily retrieve the Content-Type header of a response.- Size limits on incoming data are now configurable.
Request::limits()
was added to retrieve incoming data limits.- Responders may dynamically adjust their response based on the incoming request.
Request::guard()
was added for simple retrieval of request guards.Request::route()
was added to retrieve the active route, if any.&Route
is now a request guard.- The base mount path of a
Route
can be retrieved viaRoute::base
orRoute::base()
. Cookies
supports private (authenticated encryption) cookies, encryped with thesecret_key
config key.Config::{development, staging, production}
constructors were added forConfig
.Config::get_datetime()
was added to retrieve an extra as aDatetime
.- Forms can be now parsed leniently via the new
LenientForm
data guard. - The
?
operator can now be used withOutcome
. - Quoted string, array, and table based [configuration parameters] can be set via environment variables.
- Log coloring is disabled when
stdout
is not a TTY. FromForm
is implemented forOption<T: FromForm>
,Result<T: FromForm, T::Error>
.- The
NotFound
responder was added for simple 404 response construction.
๐ง [Native TLS support]: https://rocket.rs/v0.3/guide/configuration/#configuring-tls
0๏ธโฃ [Default rankings]: https://api.rocket.rs/v0.3/rocket/struct.Route.html
๐ง [configuration parameters]: https://api.rocket.rs/v0.3/rocket/config/index.html#environment-variables
๐ฅ Breaking Changes
๐ This release includes many breaking changes. These changes are listed below along with a short note about how to handle the breaking change in existing applications.
session_key
was renamed tosecret_key
, requires a 256-bit base64 keyIt's unlikely that
session_key
was previously used. If it was, renamesession_key
tosecret_key
. Generate a random 256-bit base64 key using a tool like openssl:openssl rand -base64 32
.The
&Cookies
request guard has been removed in favor ofCookies
Change
&Cookies
in a request guard position toCookies
.Rocket::launch()
now returns aLaunchError
, doesn't panic.For the old behavior, suffix a call to
.launch()
with a semicolon:.launch();
.Routes without query parameters match requests with or without query parameters.
There is no workaround, but this change may allow manual ranks from routes to be removed.
The
format
route attribute on non-payload requests matches against the Accept header.Excepting a custom request guard, there is no workaround. Previously,
format
always matched against the Content-Type header, regardless of whether the request method indicated a payload or not.A type of
&str
can no longer be used in form structures or parameters.Use the new
&RawStr
type instead.ContentType
is no longer a request guard.Use
&ContentType
instead.Request::content_type()
returns&ContentType
instead ofContentType
.Use
.clone()
on&ContentType
if a type ofContentType
is required.Response::header_values()
was removed.Response::headers()
now returns an&HeaderMap
.A call to
Response::headers()
can be replaced withResponse::headers().iter()
. A call toResponse::header_values(name)
can be replaced withResponse::headers().get(name)
.Route collisions result in a hard error and panic.
There is no workaround. Previously, route collisions were a warning.
The
IntoOutcome
trait has been expanded and made more flexible.There is no workaround.
IntoOutcome::into_outcome()
now takes aFailure
value to use.IntoOutcome::or_forward()
was added to return aForward
outcome ifself
indicates an error.The 'testing' feature was removed.
Remove
features = ["testing"]
fromCargo.toml
. Use the newlocal
module for testing.serde
was updated to 1.0.There is no workaround. Ensure all dependencies rely on
serde
1.0
.config::active()
was removed.Use
Rocket::config()
to retrieve the configuration before launch. If needed, use managed state to store config information for later use.The
Responder
trait has changed.Responder::respond(self)
was removed in favor ofResponder::respond_to(self, &Request)
. Responders may dynamically adjust their response based on the incoming request.Outcome::of(Responder)
was removed whileOutcome::from(&Request, Responder)
was added.Use
Outcome::from(..)
instead ofOutcome::of(..)
.Usage of templates requires
Template::fairing()
to be attached.Call
.attach(Template::fairing())
on the application's Rocket instance before launching.The
Display
implementation ofTemplate
was removed.Use
Template::show()
to render a template directly.Request::new()
is no longer exported.There is no workaround.
The
FromForm
trait has changed.Responder::from_form_items(&mut FormItems)
was removed in favor ofResponder::from_form(&mut FormItems, bool)
. The second parameter indicates whether parsing should be strict (iftrue
) or lenient (iffalse
).LoggingLevel
was removed as a root reexport.It can now be imported from
rocket::config::LoggingLevel
.An
Io
variant was added toConfigError
.Ensure
match
es onConfigError
include anIo
variant.ContentType::from_extension()
returns anOption<ContentType>
.For the old behvavior, use
.unwrap_or(ContentType::Any)
.The
IntoValue
config trait was removed in favor ofInto<Value>
.There is no workaround. Use
Into<Value>
as necessary.The
rocket_contrib::JSON
type has been renamed torocket_contrib::Json
.Use
Json
instead ofJSON
.All structs in the
content
module use TitleCase names.Use
Json
,Xml
,Html
, andCss
instead ofJSON
,XML
,HTML
, andCSS
, respectively.
General Improvements
In addition to new features, Rocket saw the following improvements:
- "Rocket" is now capatilized in the
Server
HTTP header. - The generic parameter of
rocket_contrib::Json
defaults tojson::Value
. - The trailing '...' in the launch message was removed.
- The launch message prints regardless of the config environment.
- For debugging,
FromData
is implemented forVec<u8>
andString
. - The port displayed on launch is the port resolved, not the one configured.
- The
uuid
dependency was updated to0.5
. - The
base64
dependency was updated to0.6
. - The
toml
dependency was updated to0.4
. - The
handlebars
dependency was updated to0.27
. - The
tera
dependency was updated to0.10
. yansi
is now used for all terminal coloring.- The
dev
rustc
release channel is supported during builds. Config
is now exported from the root.Request
implementsClone
andDebug
.- The
workers
config parameter now defaults tonum_cpus * 2
. - Console logging for table-based config values is improved.
PartialOrd
,Ord
, andHash
are now implemented forState
.- The format of a request is always logged when available.
- Route matching on
format
now functions as documented.
Infrastructure
- All examples include a test suite.
- The
master
branch now uses a-dev
version number.