Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release 0.10.0 #185

Merged
merged 24 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7001e08
build(deps-dev): bump rollup-plugin-terser from 6.1.0 to 7.0.2 (#175)
dependabot[bot] Jan 11, 2021
8e63311
build(deps-dev): bump @types/jest from 26.0.7 to 26.0.20 (#176)
dependabot[bot] Jan 11, 2021
89177a2
build(deps-dev): bump rollup from 2.23.1 to 2.36.1 (#178)
dependabot[bot] Jan 11, 2021
99d2ad3
build(deps-dev): bump lint-staged from 10.2.11 to 10.5.3 (#177)
dependabot[bot] Jan 11, 2021
a3f28d4
build(deps-dev): bump typescript from 3.9.7 to 4.1.3 (#179)
dependabot[bot] Jan 11, 2021
8287978
build(deps-dev): bump ts-node from 8.10.2 to 9.1.1 (#180)
dependabot[bot] Jan 12, 2021
6b1e31f
build(deps-dev): bump @rollup/plugin-node-resolve from 8.4.0 to 11.0.…
dependabot[bot] Jan 12, 2021
c7bf0fa
build(deps-dev): bump @typescript-eslint/parser from 3.7.1 to 3.10.1 …
dependabot[bot] Jan 12, 2021
e53a4aa
build(deps-dev): bump @rollup/plugin-commonjs from 15.1.0 to 17.0.0 (…
dependabot[bot] Jan 12, 2021
61b8c8f
build: enable inlineSources option in TS config
NoNameProvided Jan 14, 2021
a25c980
feat: add option to specify service as eager loaded
NoNameProvided Jan 14, 2021
9228bfa
refactor: remove `Service([dep], factory)` format
NoNameProvided Jan 15, 2021
e4892ce
docs: add partial changelog for next release
NoNameProvided Jan 15, 2021
565b9e9
refactor: rework internal instantiation process
NoNameProvided Jan 15, 2021
8afb78e
fix: throw CannotInstantiateValueError in the correct place
NoNameProvided Jan 15, 2021
90c4f7e
fix: export CannotInstantiateValueError correctly
NoNameProvided Jan 15, 2021
bef90db
build(deps-dev): bump @types/node from 14.14.20 to 14.14.21 (#184)
dependabot[bot] Jan 15, 2021
7568942
fix: infer types properly when empty @Inject() decorator is used
NoNameProvided Jan 15, 2021
4c6ee02
refactor: collapse function overload on Service decorator
NoNameProvided Jan 15, 2021
6be83e6
refactor: change filename of helper function to it's definition name
NoNameProvided Jan 15, 2021
b6f9188
refactor: simplyfy ContainerInstance implementation
NoNameProvided Jan 15, 2021
1938670
feat: add support for calling destroy function on services when they …
NoNameProvided Jan 15, 2021
5ba53e3
docs: add changelog for 0.10.0
NoNameProvided Jan 15, 2021
0dec04d
build: bump version to 0.10.0
NoNameProvided Jan 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# Changelog

## 0.10.0 [BREAKING] - 2021.01.15

### BREAKING CHANGES

#### Container.remove signature change

The `Container.remove` method from now accepts one ID or an array of IDs.

```ts
// Old format
Container.remove(myServiceA, myServiceB);

// New format
Container.remove([myServiceA, myServiceB]);
```

#### Removed support for calling `Service([depA, depB], factory)`

This was an undocumented way of calling the `Service` function directly instead of using it as a decorator. This option
has been removed and the official supported way of achieving the same is with `Container.set`. Example:

```ts
const myToken = new Token('myToken');

Container.set(myToken, 'test-value');

// Old format:
const oldWayService = Service([myToken], function myFactory(myToken) {
return myToken.toUpperCase();
});
const oldResult = Container.get(oldWayService);
// New format
const newWayService = Container.set({
// ID can be anything, we use string for simplicity
id: 'my-custom-service',
factory: function myFactory(container) {
return container.get(myToken).toUppserCase();
},
});
const newResult = Container.get('my-custom-service');

oldResult === newResult; // -> true, both equals to "TEST-VALUE"
```

### Added

- added `eager` option to `ServiceOptions`, when enabled the class will be instantiated as soon as it's registered in the container
- added support for destroying removed services, when a service is removed and has a callable `destroy` property it will be called by TypeDI

### Changed

- [BREAKING] removed old, undocumented way of calling `@Service` decorator directly
- [BREAKING] renamed `MissingProvidedServiceTypeError` to `CannotInstantiateValueError`
- various internal refactors
- updated various dev dependencies

### Fixed

- generated sourcemaps contains the Typescript files preventing reference errors when using TypeDI with various build tools

## 0.9.1 - 2021.01.11

### Fixed
Expand Down
Loading