bottlejs

A powerful dependency injection micro container for JavaScript applications

MIT License

Downloads
82.4K
Stars
1.3K
Committers
26

Bot releases are visible (Hide)

bottlejs - ES Module Release Latest Release

Published by young-steveo about 4 years ago

v2.0.0
This version updates several dev dependencies to resolve security vulnerabilities, (thanks @dependabot-bot !)

It also adds a new ES module build, available in the /dist directory. This is a possible breaking change for some webpack users, so the major version has been bumped to 2. Most users can migrate to bottlejs 2.0.0 without any backwards compatibility problems. Thanks, @blikblum !

bottlejs - v1.7.2 Maintenance Update

Published by young-steveo over 5 years ago

This release updates the dev dependencies to resolve security vulnerabilities in the testing pipeline. It also updates the typescript file to support limiting / type checking entry names: https://github.com/young-steveo/bottlejs/pull/115 (thanks @ethanresnick )

bottlejs - v1.7.1 Security Update

Published by young-steveo over 6 years ago

Security Patch

Bottle does not have any dependencies.

However, a security vulnerability was discovered in one of Bottle's build and testing tools. This version of BottleJS updates all of Bottle's dev tools to their latest versions and recompiles the minified source to alleviate any security concerns.

The only noticeable change is an improved file size from the minification library that BotteJS uses (the minified file is about 30 bytes smaller. 🤣)

bottlejs - v 1.7.0

Published by young-steveo over 6 years ago

New Feature

Minor improvements

  • Internal uglification optimizations. #101
  • Improved TypeScript container support #102
bottlejs - Version 1.6.3

Published by young-steveo almost 7 years ago

Fixes a bug with resetProviders when using nested containers. Nested containers will no longer break when they have multiple children.

bottlejs - Version 1.6.2

Published by young-steveo almost 7 years ago

This patch release adds better support for classes in the typescript definition file, and fixes a bug with registering new services on an already-instantiated nested container ( thanks to @aretmy and @TimWolla ).

bottlejs - Minor Bug Fix: v1.6.1

Published by young-steveo over 7 years ago

bottlejs - Version 1.6.0

Published by young-steveo over 7 years ago

What's New

  • Providers can now be reset on a bottle instance by calling bottle.resetProviders(). This is primarily useful for unit testing. @cjsaylor
  • Containers now have a $decorator function that will only add decorators to that container's services. This is useful for nested bottles. @iMoses
  • Bottle.pop and Bottle.clear have been updated to allow empty strings to name and clear a bottle. Any string value is now valid. @Coburn37

Other stuff

  • Updated jasmine to the latest version. @cjsaylor
  • Added a fix for jshint bug introduced in node 6. @cjsaylor
  • TypeScript definition file was missing a few things. It should now be fully up to date.
bottlejs - Version 1.5.0

Published by young-steveo about 8 years ago

What's New

  • Refactored internals to reduce memory footprint when many nested bottles are created by allowing for better garbage collection. This exposes a few new properties on the bottle instances. See the Readme API section for more details.
  • Added a new method to unset named bottle references Bottle.clear. - thanks, @emilong
  • Updated the documentation to better explain isolated containers when using dot notation.

Bugs Fixed

  • Deeply nested decorators and middleware were not firing.
  • TypeScript definition file was missing the container $list method definition.
bottlejs - Version 1.4.0

Published by young-steveo about 8 years ago

  • Added a new method instanceFactory - thanks @nzack
  • Fixed a bug in the TypeScript definition file - thanks @pferdone
  • Updated the TypeScript definition file with some missing methods.
bottlejs - Version 1.3.0

Published by young-steveo over 8 years ago

This version of Bottle adds a new list method that allows introspection into the registered services on a container. Check out the docs in the API section of the Readme for more information.

bottlejs - TypeScript Support

Published by young-steveo over 8 years ago

Added a TypeScript definition file, courtesy of @kenvunz

bottlejs - Strict Mode

Published by young-steveo over 8 years ago

New global setting Bottle.config.strict. When set to true, Bottle will throw an error when attempting to resolve an undefined service during automatic injection.

note: Accessing an undefined service from the container directly (e.g. bottle.container.Service) will not throw an error.

bottlejs - Bugfix: Providers no longer deleted

Published by young-steveo almost 9 years ago

If a provider throws an error, the provider is no longer removed from the container (i.e., the service is not instantiated) See #39

bottlejs - New Provider Functionality

Published by young-steveo almost 9 years ago

You can now register a provider more than once without bottle logging an error as long as the service has not been instantiated. Previous versions of bottle would always log an error if a service was registered more than once.

bottlejs -

Published by young-steveo almost 9 years ago

New functionality:

  • Bottle will now throw anything passed to a middleware next function: next(new Error('fail'))
  • register method now accepts $value property. The value of this property will be registered on the container instead of the object itself.

See the Readme for more info.

Thanks to @nswbmw for the middleware error support.