All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added the
default_page
function - Made
default_page
the example response inview init
- Added
.gitignore
generation toview init
- Added support for coroutines in
PyAwaitable
(vendored) - Finished websocket implementation
- Added the
custom
loader - Added support for returning
bytes
objects in the body - Added
nosanitize
andrepr
to theref
attribute of<view>
tags in view template rendering WebSocketDisconnect
is now raised instead ofWebSocketHandshakeError
in an unexpected WebSocket disconnect- Added many, many, more docstrings
- Added the
app
attribute toContext
- Switched to PyMalloc under the hood
- Deprecated the
run()
utility - Added support for asynchronous
__view_result__
functions - Removed unstable
components
functions from top-levelview
module - Added native support for
ReactPy
component routes - Added the
expect_errors
utility - Added the
HeaderDict
class - Changed the
headers
attribute onContext
to aHeaderDict
instance of adict
- Added the
call_result
utility - Added the
ctx
parameter toto_response
- Removed broken hint when forgetting to call
load()
- Added support for
isinstance
toSupportsViewResult
- Moved
to_response
to theview.utils
module - Added the
force
parameter torun
- Added the
view dev
command (live reload) - Fixed redirection and disabling of HTTP server logging
- C API is now compliant with PEP 7
- Added
-g3
and-O3
flag to the_view
extension module (debugging information and optimizations) - Removed use of Rich
escape()
in the message shown when a dependency is needed - Query string client errors are now displayed during development mode
KeyboardInterrupt
is swallowed by the server coroutine, and a log message is now issued- Typecode API now raises exceptions indicating a validation error (and now it's sent as a response with a query or body parse failure)
hatchling
andscikit-build-core
are now used for build instead ofsetuptools
- Renamed the
view-admin
command toview-py
- Breaking Change: Renamed
Error
toHTTPError
- Breaking Change:
__view_result__
is now given aContext
parameter - Breaking Change:
to_response
is now asynchronous - Breaking Change: Renamed
Response._custom
toResponse.translate_body
- Breaking Change: Removed the
hijack
configuration setting - Breaking Change: Removed the
post_init
parameter fromnew_app
, as well as renamed thestore_address
parameter tostore
- Breaking Change:
load()
now takes routes via variadic arguments, instead of a list of routes.
- Added the
view docs
command - Reworked internal logging API and changed default logger format
- Added the
websocket
andapp.websocket
router - Made hijack optional in fancy mode
- Added a startup message
- Added support for
daphne
andhypercorn
as servers - Added documentation for
view.env
and added environment variables to configuration - Removed dead file
src/view/nodes.py
andsrc/view/compiler.py
- Added
patterns
loader toview init
- Updated internal C API structure
- Added
build
to config - Added the
build_app
andbuild_steps
functions Route.__call__
is now used internally overRoute.func
- Added the
to_response
function - Improved type checking on functions decorated with a router function
- Added preset values to the
view.toml
generated byview init
- Fixed fancy logging not exiting after a
KeyboardInterrupt
- Added prettier input prompts to
view init
- Added
HTML.from_file
- Breaking Change: Middleware functions must now take
call_next
- Fixed
template
attribute with theview
template renderer - Added the
context
decorator and theContext
type - Added the
headers
parameter to functions onTestingContext
- Modified some behavior of automatic route inputs
- Fixed syntax errors in
view init
- Added
Route.middleware
- Routes with equivalent paths but different methods now return
405 Method Not Allowed
when accessed - Added
route
andApp.route
- Added docstrings to router functions
- Added the
JSON
response class - Added the
custom
body translate strategy - Made
method
a keyword-only parameter inpath
- Added the
extract_path
utility - Added the
view build
command - Added
App.template
- Route errors now display the error message when
dev
isTrue
- Changed exception rendering in route errors to use the
rich
renderer - Added
compile_type
andTCValidator
- Added
markdown
andApp.markdown
- Added the
Error
class - Added the
error_class
parameter to bothnew_app
andApp
- Added the
ERROR_CODES
constant - Completely rewrote docs
- Breaking Change: The
body
parameter inResponse
is now required
- Added optional dependencies for
databases
andtemplates
- Added environment prefixes for database configuration
- Added
templates
andTemplatesConfig
to config - Added the
templates
function - Added support for
attrs
in type validation - Added documentation for caching
- Added the
cache_rate
parameter to routers - Removed
psutil
andplotext
as a global dependency - Added
fancy
optional dependencies - Fixed route inputs with synchronous routes
- Breaking Change: Route inputs are now applied in the order of the decorator call as it appears in code
Quick Patch Release
- Remerged new
view init
command.
- Added
get_app
- Added documentation generation
- Added database support (NOT FINISHED)
- Removed
attempt_import
andMissingLibraryError
- Added support for lists in type validation
- Added support for implicit query parameters
- Renamed
debug
toenable_debug
- Added
debug
,info
,warning
,error
, andcritical
logging functions - Added
InvalidRouteError
,DuplicateRouteError
,ViewInternalError
, andConfigurationError
- Renamed
EnvironmentError
toBadEnvironmentError
- Added logging functions to
App
- Changed environment prefixes for configuration
- Rewrote documentation
- Added
patterns
loader - Added handling of relative paths in the configuration setting
loader_path
- Added exists validation to
loader_path
- Add path to
PATH
environment variable during loading - Upgraded
view init
- Added
app.query
andapp.body
- Patched warning with starting app from incorrect filename
- Updated
__all__
forrouting.py
- Added
view.Response
andview.HTML
- Fixed
__view_result__
- Added support for
__view_body__
and__view_construct__
- Added support for Pydantic,
NamedTuple
, and dataclasses for type validation - Support for direct union types (i.e.
str | int
,Union[str, int]
) on type validation - Added support for non async routes
- Added type validation (without support for
__view_body__
) - Patched query strings on app testing
- Added tests for query and body parameters
- Patched body parameters
- Documented type validation
- Patched bodies with testing
- Patched header responses
- Added tests for headers
- Updated repr for
Route
- Patched responses with three values
- Documented responses and result protocol
- Added
App.test()
- Added warning when filename does not match
app_path
- Added more tests
- Upgrade CIBW to work on 3.11
Initial.