Skip to content

fix: guaranteed order of preprocessor execution #1489

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

Merged

Conversation

DarioSoller
Copy link
Contributor

@DarioSoller DarioSoller commented Apr 10, 2025

Description of changes:
Having multiple preprocessors defined in the SD config, did not guarantee the execution of the preprocessors in the exact order, how they have been configured in the SD config.

Technical reason behind that is, that it has been looped over the properties of a JS object, which had the respective preprocessor functions connected to the preprocessor names as the object properties. As we all know Javascript has a flaw, when it comes to ordering in JS objects.

Therefore we now rely on the right order, by looping over the preprocessor names in the appliedPreprocessors array parameter, which already has been available in the preprocess function.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1489.d16eby4ekpss5y.amplifyapp.com

@DarioSoller DarioSoller marked this pull request as ready for review April 10, 2025 23:33
@DarioSoller DarioSoller requested a review from a team as a code owner April 10, 2025 23:33
@jorenbroekema
Copy link
Collaborator

Can you add a changeset? npx changeset, patch is fine. And maybe a regression test?

@jorenbroekema jorenbroekema merged commit 6ff17ec into amzn:main Apr 17, 2025
6 checks passed
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.

3 participants