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

perf: improve preprocess action perf by capturing context instead of partially resolving template strings #6745

Draft
wants to merge 122 commits into
base: main
Choose a base branch
from

Conversation

stefreak
Copy link
Member

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

...config,
...resolvedBuiltin,
spec,
}
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: can we somehow keep early validation? Is it dangerous to remove?

core/src/resolve-module.ts Outdated Show resolved Hide resolved
sources: [],
// this makes sure that the output declaration shape is valid
outputs: serialiseUnresolvedTemplates(outputs),
Copy link
Member Author

Choose a reason for hiding this comment

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

@vvagaytsev We neeed to avoid calling serialiseUnresolvedTemplates in production code; It is meant as a test utility. This is not the right appraoch; What we need to do is either change the schema so it accepts unresolved values, or to validate the schema after resolving outputs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Otherwise outputs will never be resolved

Copy link
Collaborator

Choose a reason for hiding this comment

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

@stefreak I agree, but thanks for reminding me.
I'm not sure if I did something like this in prod code; this statement was added in 9b55bbe.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah oh sorry, I somehow thought this line was changed by you 🤦 OK, I'll address this, will keep this open as a reminder for me

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's also used in dumpConfig function, but there it looks ok.


return {
partial: true,
resolved: deepMap(result.resolved, (v) => capture(v, context)) as Collection<ParsedTemplate>,
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
resolved: deepMap(result.resolved, (v) => capture(v, context)) as Collection<ParsedTemplate>,
resolved: deepMap(result.resolved, (v) => capture(v, this.context)) as Collection<ParsedTemplate>,

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.

2 participants