BREAKING CHANGE: Upgraded the versions of this packages:
build: ^4.0.0
analyzer: ^8.0.0To support the latest version of build and analyzer we
switched to the new element model api.
This causes a BREAKING CHANGE since the required versions of the packages where updated to
build: ^3.0.0
analyzer: '>=7.4.0 <9.0.0'I'm proud to release v5.0.0 🎉
This release contains a lot of rework in the underlying engine.
This is a list of the largest changes between v4.3.2 and v5.0.0
- New plugin based architecture
- The
ServiceContainer(formerlyServiceProvider) is no longer generated code. Instead, I created aServiceContainerimplementation that uses Plugins which are generated. - Services from dependencies are no longer included. This improves the build speed and reliability of generated code. Services from dependencies must be deployed as plugins. This gives you more control over what is registered in your container.
- Aligned naming: In the previous versions, we mixed the terms
providerandcontainer. Starting with this version we will use onlycontainer.
For upgrade guidance check the "Upgrade from v4 to v5" Guide
- Removed the generation of the service container. Check the GenerateServiceProvider section for upgrade guidance.
- Removed export of
catalyst_builder_annotations.
We need a total makeover of the underlying architecture. Services from packages you depend on are no longer resolved automatically!
More background information is available in the Wiki
includePackageDependencieswas removed
- Updated the README and added screenshots
- Removed verbose logging
- Removed the caching system
Since the ServiceProviderBuilder does not rely on the real outputs of the previous builders but the cache files, this is a much better solution since a PostProcessBuilders does not process all .dart files.
This will fix the following error when using catalyst_builder with Flutter:
[SEVERE] catalyst_builder:preflight on package:sky_engine/html/html_dart2js.dart:
This builder requires Dart inputs without syntax errors.
...
- Fixed the dependency detection in the preflight builder.
To improve the maintainability of your projects, we decided to separate the less frequently changing parts - such as
annotations, abstractions like the base class for the ServiceProvider, and exceptions (catalyst_builder_contracts) -
from the more frequently changing parts, like the implementation of the builder itself (catalyst_builder).
This means that a breaking change in the catalyst_builder package does not force you to update projects where you only
use the annotations.
You're now able to set a custom cache location by setting catalyst_builder: { cacheDir: 'a/cache/path' } property in
the pubspec.yaml
Take a look in pubspec.yaml for an example.
- The
CacheHelperis no longer static.
This major update has breaking changes. Check the UPGRADE.md for guidance.
This release contains a new caching system for intermediates. Those are stored in a .catalyst_builder_cache directory.
Don't forget to exclude this from the VCS.
build_runner_core: Removed
Bump the minimum Dart SDK version to 3.5.0
dart_style:^2.0.1=>^3.0.1analyzer:'>=5.2.0 <7.0.0'=>'>=5.2.0 <8.0.0'
Removed the deprecated @Parameter annotation. Use @Inject instead.
Moved the providerClassName and includePackageDependencies option to the @GenerateServiceProvider annotation
In this release we hopefully fixed the old problem with outdated *.catalyst_builder.g.dart files.
The ServiceProviderBuilder did not emit an updated version since the @GenerateServiceProvider annotation
doesn't exist in the most files.
We added a new generatedProviderFile option to the preflightBuilder configuration. You need to put the relative path
to the generated provider file (*.catalyst_builder.g.dart) in this option.
The PreflightBuilder will automatically delete the file if it exists. This lead to a full regeneration of the service
provider file. 🙌
In version 5.0.0 of the analyzer Package was DartType.element removed.
It was added again in 5.2.0 so we updated the version constraint to >=5.2.0 <7.0.0 to fix that downgrade error.
Previously each ServiceProvider had a map of service instances. If a singleton was created, the provider stored the instance in the map and returned the instance the next time it is requested.
If you're working with enhanced providers (ServiceProvider.enhance), the singletons created in the EnhancedProvider
wasn't stored in the root provider which causes that a singleton will be created again if it's resolved in the root
provider.
To solve this problem, the instances of the map is now a reference to the original instances map of the parent provider.
Moved the lints to dev_dependencies and set the version constraint to any
Updated the version constraint of the analyzer package.
Features:
- Added an example for working with relative dependencies. PR#19
Changes:
- The preflight builder will no more emit empty files. This should increase the build performance. PR#18
Fixes:
- Fixed the enhance method. PR#16
Features:
- Added stricter rules to analysis_options.yaml
- Added type castings to the generated service provider.
Fixes:
- Fixed the enhance method and overtake the expose map and the known services map.
Fixes:
- Fixed the type inference when enhancing the ServiceProvider.
Fixes:
- Fixed the generation for libraries (working with
partandpart of). - Fixed the extraction of services for packages without the
GenerateServiceProviderannotation.
Features:
- Introducing the new
@Injectannotation. This annotation works like the@ParameterAnnotation but is more flexible. You can use it to inject a list of tagged services and also to inject parameters. The example code contains a example for this feature.
Deprecations:
- The
@Parameterannotation was marked as deprecated and will be removed in the next major release.
See UPGRADE.md for upgrade instructions.
Changes:
- Updated the minimum
analyzerversion to^5.0.0
Internal:
- Updated the usages of deprecated properties. Using
elementinstead ofelement2enclosingElementinstead ofenclosingElement3
- Preflight logic refactored
Maintenance Release
- Replaced a deprecated function call (assignVar)
Features:
- Added the
GenerateServiceProviderannotation
Changes:
- Updated the minimum Dart SDK version to
2.17.0
Breaking Changes:
build.yaml- Removed the option
outputNameThis change was necessary since the build_runner does not recognize changes correctly with runtime file names. - Removed the option
preflightExtension.
- Removed the option
Changes:
- Dependencies updated
analyzer:>=3.2.0 <5.0.0->>=4.3.0 <5.0.0build_runner:^2.0.4->^2.2.0
- Using
enclosingElement2instead ofenclosingElement(pub.dev score) - Added ignore rules for generated files
implementation_importsno_leading_underscores_for_library_prefixes
Features:
- Added
tagsto theServiceannotation - Added
ServiceProvider.resolveByTag(#tag)to resolve a list of services by a tag.
Take a look in the README.md for example usage.
Changes:
- Dependencies updated
- glob:
^2.0.1->^2.1.0
- glob:
- Dev Dependencies updated
- lints:
^1.0.1->^2.0.0
- lints:
Internal:
TryCatchBuilderremoved.
Changes:
- Added shields to the README.md
- Added more unit tests and increased the code coverage. PR#8
Bugfixes:
- Add the parameters of the parent service provider to the enhanced service provider. PR#7
Changes:
- README.md updated
Changes:
- Dependencies updated
analyzer:^3.2.0->>=3.2.0 <5.0.0test:^1.20.1->anysource_gen-> removed
Features
- Added the
EnhanceableProviderclass and implemented it in the generated ServiceProvider. This class allows you to create sub-providers. PR#5
Features
- Added the
ServiceRegistryclass and implemented it in the generated ServiceProvider. This class allows you to register services at runtime. PR#4
Changes:
- Optimized the code generation PR#3
Upgraded the analyzer and the test package to support Flutter 2.10.
Downgraded the analyzer package to ensure compatibility to the test package.
Fixed pub.dev score issues.
- upgraded the
analyzerpackage - removed the
pedanticdev-package - removed an unused import in the
extracted_service.dart
Project code moved to GitHub. Updated the pubspec.yaml
Features:
- Added
ServiceProvider.has<T>([Type? t])to check if a service is known.
Changes
- Updated the dependencies
- code_builder
^4.0.0->^4.1.0 - build
^2.0.1->^2.1.0 - analyzer
^1.7.1->^2.2.0 - build_runner_core
^7.0.0->^7.1.0
- code_builder
Added a @ServiceMap annotation.
Changed the preflight output extension to avoid conflicting outputs.
Added a includePackageDependencies option to the build.yaml.
Dependencies downgraded
Publisher fixed
First stable release 🎉
- Code generator organized
- Added unit and integration tests
- Formatting fixed
ServiceProvider.boot()added@Preloadannotation added
- Formatting fixed
- Packages updated to ensure null-safety
- Added better exceptions
- Added a
Parameterannotation which can be used to override the name that is used for resolving a parameter.
- Initial version.