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

Add support for list overrides #134

Merged
merged 1 commit into from Jan 9, 2024
Merged

Add support for list overrides #134

merged 1 commit into from Jan 9, 2024

Conversation

joachimvh
Copy link
Member

Closes #129

Implements what is described in #129 (comment)

Will look into documentation when this is accepted.

Some of the behaviour that happened in the canHandle of the ConfigPreprocessorOverride was moved to the transform call, but this should not have an impact.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7061626539

  • 162 of 162 (100.0%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 7050284425: 0.0%
Covered Lines: 1493
Relevant Lines: 1493

💛 - Coveralls

Copy link
Member

@rubensworks rubensworks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice PR, I like it!
Just one minor comment, everything else looks perfect IMO.

Before we merge, could you do a quick check to see if it doesn't break anything in Comunica? (I suspect it won't, since Comunica doesn't use overrides anywhere in any case)


public constructor(options: IComponentConfigPreprocessorOverrideOptions) {
this.objectLoader = options.objectLoader;
this.componentResources = options.componentResources;
this.logger = options.logger;

this.stepHandlers = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding the handlers here, could we pass them through the options from ComponentsManagerBuilder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion either way, just that this was based on how this is done in some other classes:

private readonly mappingHandlers: IConstructorArgumentsElementMappingHandler[] = [
new ConstructorArgumentsElementMappingHandlerKeyValue(),
new ConstructorArgumentsElementMappingHandlerCollectEntries(this.parameterHandler),
new ConstructorArgumentsElementMappingHandlerFields(),
new ConstructorArgumentsElementMappingHandlerElements(),
new ConstructorArgumentsElementMappingHandlerList(),
];
and
this.parameterPropertyHandlers = [
new ParameterPropertyHandlerDefaultScoped(this.objectLoader),
new ParameterPropertyHandlerDefault(this.objectLoader),
new ParameterPropertyHandlerFixed(this.objectLoader),
this.parameterPropertyHandlerRange = new ParameterPropertyHandlerRange(this.objectLoader, options.typeChecking),
new ParameterPropertyHandlerLazy(),
];

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. In that case, you can ignore my comment.

@joachimvh
Copy link
Member Author

Everything seems to work fine when testing with Comunica.

@rubensworks rubensworks merged commit 9623e44 into master Jan 9, 2024
22 checks passed
@rubensworks rubensworks deleted the feat/override-lists branch January 9, 2024 14:16
@rubensworks
Copy link
Member

Released as 5.5.0.

rubensworks pushed a commit to LinkedSoftwareDependencies/Documentation-Components.js that referenced this pull request Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow modifying arrays more specifically
3 participants