Releases: danfuzz/lactoserv
v0.7.2
This release contains most (if not all) of the breaking changes when using the
system as a framework (i.e., building an app and not just running a static web
server) that are currently anticipated for the v0.7.* release series. The hope
is that v0.7.* will reach stability relatively soon.
Breaking changes:
- configuration /
webapp-builtins
:- Changed
MemoryMonitor
to useByteCount
s for the limit configuration. - Changed the file rotation / preservation configurations that had been plain
numbers to instead beByteCount
s.
- Changed
compy
:- Reworked how component classes define their configuration properties, to
be way more ergonomic, avoiding a lot of formerly-required boilerplate and
adding a modicum of error checking that all components get "for free."
Note: While this is a breaking change for how components are built, it
doesn't affect how components are instantiated. For example, this doesn't
make you change your standalone config files. - Similarly, reworked the component lifecycle methods to all be "must call
super
" instead of the former "must not callsuper
" style. The latter
stopped making sense with the introduction of the template mixin classes. - New base class
BaseRootComponent
to be the superclass for root components. - Switched a few classes from base classes to template classes:
BaseThreadComponent
->TemplThreadComponent
.BaseAggregateComponent
->TemplAggregateComponent
.BaseWrappedHierarchy
->TemplWrappedHierarchy
.
- New exported classes to help with testing:
MockComponent
and
MockRootComponent
.
- Reworked how component classes define their configuration properties, to
data-values
:- Renamed
Struct
->Sexp
, because it's really this project's version of
the "sexp" concept. And for similar reasons, renamed thetype
field of it
tofunctor
. This rename also makes room for the newStruct
-y thing. - Moved
BaseConfig
here fromcompy
. - New class
BaseStruct
, extracted fromBaseConfig
, because most of what
BaseConfig
did was not particularly specific to configuration, per se.
- Renamed
Other notable changes:
- configuration:
- New top-level (
WebappRoot
) configurationlogging
, to do fine-grained
control over which components produce system logs. - New per-application and per-service configuration
dispatchLogging
to
specifically enable/disable dispatch-related logging. These logs can be
very chatty, and only rarely useful (though not totally useless).
- New top-level (
compy
:- Fixed bug in
BaseComponent.CONFIG_CLASS
which caused it to sometimes
call base classes'_impl_configClass()
multiple times (which isn't
supposed to happen, ever).
- Fixed bug in
webapp-builtins
:- Took advantage of
TemplThreadComponent
in a few classes that could use it,
now that it's a template (and not a direct subclass ofBaseComponent
).
- Took advantage of
v0.7.1
This release contains most (if not all) of the breaking changes to standalone
configuration that are currently anticipated for the v0.7.* release series.
Note: v0.7.0 wasn't announced widely, because it was mostly just a clone
of v0.6.16.
Breaking changes:
- configuration /
webapp-builtins
:- Totally reworked rate limiting. There is now a separate class per thing that
can be rate-limited --ConnectionRateLimiter
,DataRateLimiter
, and
RequestRateLimiter
-- and configuration uses unit quantity classes for all
the token bucket stuff.
- Totally reworked rate limiting. There is now a separate class per thing that
async
/webapp-util
:- Moved
TokenBucket
fromasync
towebapp-util
. It was the only
not-particularly-simple class inasync
, and its placement in that module
had become the source of a module dependency cycle. - Renamed
IntfThreadlike
toIntfThread
. - Made
EventSink
implementIntfThread
.
- Moved
clocky
/clocks
:- Renamed module to
clocky
, to harmonize with the other*y
modules.
- Renamed module to
collections
:- Renamed classes to be more sensible:
TreePathMap
->TreeMap
, and
TreePathKey
->PathKey
.
- Renamed classes to be more sensible:
data-values
:- Filled out the comparison methods in
Moment
, and made them match the ones
added toUnitQuantity
(see below). - Reworked
UnitQuantity.parse()
, with much more straightforward
functionality, including the addition of optional unit conversions.
- Filled out the comparison methods in
loggy-intf
:- Removed
FormatUtils.byteStringFrom()
in favor of
ByteCount.stringFromByteCount()
(see below).
- Removed
Other notable changes:
clocky
:- Added
waitFor()
to the interfaceIntfTimeSource
. - Extracted
MockTimeSource
fromTokenBucket.test.js
, for use throughout
the system.
- Added
compy
:- New classes
BaseWrappedHierarchy
andBaseThreadComponent
.
- New classes
data-values
:- Added comparison methods to
UnitQuantity
. - New classes
ByteCount
andByteRate
, both unit quantities.
- Added comparison methods to
webapp-builtins
:- New applications
RequestDelay
andSuffixRouter
.
- New applications
v0.7.0
v0.6.16
v0.6.15
Are we there yet?: This release will probably be declared stable, unless
something surprising (and unfortunate) happens within a couple days of its
release.
Breaking changes:
compy
/compote
:- Renamed module
compote
tocompy
, to harmonize withloggy
andtypey
. - Combined all the config base classes into the base-base class
BaseConfig
.
The other classes weren't really serving much of a purpose, and to the
extent that they were, it didn't help that they were separate from the main
base class. - The component hierarchy is now tracked as a unified
TreePathMap
, and
getComponent()
now takes absolute paths instead of simple names. - Got rid of the
isReload
argument to all theinit()
andstart()
(and
related) methods. - Got rid of
IntfComponent
(merged its docs back intoBaseComponent
), as
it only ever existed to break a circular dependency, but that was better
achieved by using a forward-declaration@typedef
.
- Renamed module
host
/webapp-util
:- Moved
BaseSystem
fromwebapp-util
tohost
. - Reworked the
BaseSystem
subclass-implementation API to be a lot simpler.
This was made possible by the recent work on thecompy
module. - Reworked
BaseSystem
to be a root component (not just some-random-object).
- Moved
Other notable changes:
compy
:- New method
BaseComponent._prot_addChild()
, to simplify adding children. - New method
BaseComponent.whenStopped()
. - New abstract class
BaseAggregateComponent
, for components that publicly
allow children to be added.
- New method
webapp-core
:- Used
BaseAggregateComponent
to simplify the classes that are in fact
aggregate components.
- Used
v0.6.14
Nearing stability: This might (but will not necessarily) be the last unstable
release in the v0.6 series, before declaring v0.6 stable.
Breaking changes:
async
:- Reworked the
Threadlet
class to not expose its innards quite so much. As
a result, the argument it passes to the thread "start" and "main" functions
is now an object which has a handful of "just for the runners" methods, with
said methods removed from the public API ofThreadlet
itself.
- Reworked the
net-util
:- Renamed
OutgoingResponse
toFullResponse
, to allow "semantic space" for
StatusResponse
.
- Renamed
webapp-*
:- Renamed the modules specifically concerned with webapp (web application)
implementation to have the prefixwebapp-
:built-ins
->webapp-builtins
sys-framework
->webapp-core
sys-util
->webapp-util
- Renamed class
Warehouse
-- a name that @danfuzz never really liked -- to
now beWebappRoot
, which reflects both its high level role and the fact
that it is the root component in its component hierarchy. - Removed the "filtering for free" behavior on
BaseApplication
. (See below.)
- Renamed the modules specifically concerned with webapp (web application)
Other notable changes:
fs-util
:- New class
FileAppender
, which does a modicum of buffering. This is used to
moderate filesystem calls when logging.
- New class
net-util
:- New class
StatusResponse
, to allow applications to indicate a response of
just a status code, letting the main protocol implementation fill it out
as necessary. - New typedef
TypeOutgoingResponse
, which covers all valid response types.
- New class
webapp-builtins
:- Loosened restrictions on path component syntax in
PathRouter
. - Added
bufferPeriod
configuration option toAccessLogToFile
and
SyslogToFile
. - New class
RequestFilter
to take over the duties of the former "filtering
for free" behavior ofBaseApplication
.
- Loosened restrictions on path component syntax in
v0.6.13
Nearing stability: Though probably not the last unstable release in the v0.6
series, this is probably one of the last before declaring v0.6 stable.
Breaking changes:
compote
/sys-config
/sys-framework
:- Extracted the lower layer of classes from
sys-config
andsys-framework
into new modulecompote
. Renamed the classes for better harmony, extracted
a new interfaceIntfComponent
, and generally improved the ergonomics of
the exported API. - Moved the higher layer of classes from
sys-config
to be inner classes of
the things-they-are-configuring. - (Per the previous two items) Removed the now-empty module
sys-config
. - Added
_impl_implementedInterfaces()
as an overridable instance method on
BaseComponent
, to allow for runtime declaration and validation of
component interfaces. - Reworked
static
propertyCONFIG_CLASS
to be_impl_configClass()
, to
match how the project usually does overridable members.
- Extracted the lower layer of classes from
net-util
:- Made
getLogInfo()
an instance (notstatic
) method, and fixed its
reporting ofcontentLength
.
- Made
built-ins
:- Renamed network access log services to use the class name
AccessLogTo*
,
instead ofRequestLogger
(or similar). This is to avoid confusion with the
objects used to emit system logging messages, which more or less have a lock
on the term name*loggger
in this project. - Renamed
SystemLogger
toSyslogToFile
, to match the analogous access log
class name.
- Renamed network access log services to use the class name
- Configuration:
- As with
built-ins
, renamed the service role name for access logging from
requestLogger
toaccessLog
.
- As with
Other notable changes:
sys-framework
:- Made it possible to pass application and service instances into the
Warehouse
constructor, instead of having to pass plain objects in. This
makes for much nicer ergonomics when using the system as a framework. - Did a major rework of how hosts and endpoints are managed, simplifying the
code a lot in the process. - Added general event-reporting and service-calling methods to
BaseService
,
as a way to eventually enable metaprogramming with services.
- Made it possible to pass application and service instances into the
built-ins
:- New service
EventFan
, to do parallel fan-out of events. Notably, this is
useful for sending network request logs to multiple loggers.
- New service
v0.6.12
Breaking changes:
collections
:- Removed net-related
TreePathKey
methods (rendering as URI paths and
hostname strings). - Made
TreePathKey.toString()
less "net-centric" by default. - Added new method
TreePathMap.findWithFallback()
to replacefind()
with
wantNextChain == true
. Removed the second argument fromfind()
.
- Removed net-related
net-util
:- Major rework of
IncomingRequest
, so it no longer has to be constructed
from a low-level Node request object. - Split
Uris
into two classes,UriUtil
andHostUtil
. - Pulled
uriPathStringFrom()
fromTreePathKey
intoUriUtil
, renaming it
topathStringFrom()
and tweaking its contract. - Pulled
hostnameStringFrom()
fromTreePathKey
intoHostUtil
. - Replaced
DispatchInfo.{base,extra}String
properties with a single combined
propertyinfoForLog
, which avoids an "attractive nuisance" with the old
scheme (which in fact caused a bug). - In harmony, renamed method
IncomingRequest.getLoggableRequestInfo()
to
propertyinfoForLog
. - Likewise, renamed
OutgoingResponse.getLoggableResponseInfo()
to
getInfoForLog()
(still a method because it needs arguments).
- Major rework of
sys-framework
:- Renamed filter config
maxPathLength
tomaxPathDepth
, and made a new
maxPathLength
which filters based on the octet count of a path.
- Renamed filter config
Other notable changes:
- Documentation comments:
- Cleaned up a bunch of JSDoc syntax problems. Notably, the type definitions
of non-method class properties was very wrong. - Did a comment reflow pass over all the code, using a newly-written utility.
Tidy code is happy code!
- Cleaned up a bunch of JSDoc syntax problems. Notably, the type definitions
v0.6.11
Breaking changes:
built-ins
:- Merged all the built-in applications and services into a unified module
calledbuilt-ins
. - Changed default
acceptMethods
inRedirector
to be more sensible.
- Merged all the built-in applications and services into a unified module
- Configuration:
- Stopped using a component registry to find applications and services.
Instead, just let the (Node / JavaScript) module system be that. Simplifies
a lot of stuff! (Doing this had become possible once the configuration file
loader was expanded to allow access to framework classes.) - Dropped application mounting / routing setup from the endpoint
configuration. Instead ofmounts
, the endpoint configuration just takes a
single application name, for the application which is to handle all
requests. If routing is needed, routing applications are now available; but
if not, there's no longer a performance penalty to do what amount to no-op
lookups.
- Stopped using a component registry to find applications and services.
sys-framework
:- Reworked
BaseApplication
configurationacceptQueries
to instead be
maxQueryLength
(and all that the name change implies). - Added new class
ControlContext
, which gets associated with each concrete
instance ofBaseControllable
(the superclass of all app and service
classes, among other things). This is now where an instance'slogger
is
found, and it also keeps track of the parent/child relationships between
instances. This will eventually be the key mechanism for treating a set of
components holistically in a reasonably general way. (Right now there's a
lot of ad-hoc arrangement.) - Added related new class
RootControlContext
, a subclass ofControlContext
which specifically represents the root of a hierarchy. - Added new lifecycle method
init()
(and abstract implementation method
_impl_init()
) toBaseControllable
, which is where the above contexts get
hooked up.
- Reworked
Other notable changes:
- Got rid of
lodash
as a dependency. - Logging:
- Dropped
framework
as the top-level logging tag from "cohorts" of items,
such as "applications" and "services." - Added ANSI coloring / styling to the "human" (non-JSON) logs that go to
stdout
, when it's a TTY. - Fixed request logging so that it gets a more accurate (earlier) start time
for requests.
- Dropped
built-ins
:- New class
SerialRouter
, which does "classic" linear-order routing to
a list of applications. - New class
HostRouter
which does what you probably expect from the name. - Likewise, new class
PathRouter
. This and its buddies are the replacements
for the routing implementation that used to be baked intoEndpointManager
. - Added
statusCode
configuration toSimpleResponse
. Notably, it can now be
used to define simple404
responses.
- New class
v0.6.10
It's Fast(ish) Follow Friday!
Breaking changes:
- Request logging: Stopped quoting URLs, as there was no need. (They won't have
spaces or non-ASCII in them, as they are logged in url-encoded form.)
Other notable changes:
- Development:
build
script renamed todev
, and mergedrun
into it.- Testing:
- Simplified how the unit tests get set up and run.
- Got coverage reporting to work.
- Linting:
- Added
lint
target todev
(see above), and removed the separatelint
script. - Switched to the modern ESLint "flat" configuration format. (It was a pain
in the butt.) - Enabled some rules that weren't on before, and tweaked a couple others.
Fixed a couple dozen or so errors that got reported as a result.
- Added
- Squelched some of the less interesting error spew (e.g., don't bother printing
stack traces when the HTTP parser encounters invalid network input).