Replies: 2 comments 1 reply
-
More details: currently only 10 projects out of more the 24k are using fixed plugins version |
Beta Was this translation helpful? Give feedback.
-
I suggest handle this issue in a different way. By concept, plugins should be decoupled from DSG engine. it means that plugin can change/add files/text to final generated code even if the end results is not a valid/working results. If we agree about that, it will allow us to ignore the progress of the engine vs the changes in plugins. The user will be responsible for his final results and make sure it works. we should maintain the isolation between the engine and the plugins. we can help the user to avoid code issue by notification mechanism and not managing the rules. I suggest to handle it in two ways:
|
Beta Was this translation helpful? Give feedback.
-
The Problem: Plugins
With the new
data-service-generator
versioning, amplication would be able to support older version of the generator with newer version of the platform.This will mean that plugins might run against different versions of the
data-service-generator
and not against the most recent code.TL;DR
This problem is similar to the npm plugins dependencies problem (https://nodejs.org/en/blog/npm/peer-dependencies) and the solution I'm proposing is following the same pattern: peerDependencies!
The Solution:
In order to maintain both great and clear user experience for the final user and facilitate plugin development, the solution will span on two main changes:
peerDependency
object. Similarly to the package.json peerDependencies, this object will list pairs of"dependency-name" : "version"
whereversion
can be in format of specific version or using^
operator to define the support to any minor version. The list ofpeerDependencies
will include any peer plugin as well ascode-generator
dependency representing thecodeGeneratorVersion
(generic name fordata-service-generator
)codeGeneratorVersion
that will allow plugins to support different versions ofdata-service-generator
in the same version. Plugins will not be forced to support old versionsAdditional changes:
peerDependencies
are not respected (wrong versions or missing dependency)peerDependencies
are not respected (wrong versions or missing dependency)i.e.
plugin-spaghetti is developed to be able to support (work with) version v2.0.0+ of the
data-service-generator
and it will need another plugin@amplication/plugin-auth-core
to be installed in the service to properly work.Apart from the code changes that might leverage the
codeGeneratorVersion
value in theDsgContext
, the plugin will be bundled and published with the following settings:Observation: the additional benefit of this approach is that it will allow us to support/solve dependencies between plugins (not currently supported)
Beta Was this translation helpful? Give feedback.
All reactions