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

Throw error when setting non-serializable macro config #1083

Merged

Conversation

mydea
Copy link
Contributor

@mydea mydea commented Jan 20, 2022

This PR ensures an error is thrown when trying to set a non-serializable macro config.

Not sure about the tests, if that is the correct way to put them or if there is a better way to add them - happy to change that if somebody points me to a better/correct way!

Closes #1082

@ef4
Copy link
Contributor

ef4 commented Jan 25, 2022

Thanks, this looks good.

@ef4 ef4 merged commit 5d1f19a into embroider-build:main Jan 25, 2022
@ef4 ef4 added the enhancement New feature or request label Feb 8, 2022
mydea added a commit to getsentry/sentry-javascript that referenced this pull request Oct 24, 2022
When defining Sentry config in `ENV['@sentry/ember'].sentry`, this goes through @embroider/macros under the hood. This relies on config being serializable, which means that e.g. you cannot use regex in the config.

To make this easier to pin down (as the error message can be a bit cryptic), this now validates the passed config (based on embroider-build/embroider#1083) and shows a helpful warning message.

Note that this also moved this around a bit, leading to config being written only once on build, which should be a bit faster.
mydea added a commit to getsentry/sentry-javascript that referenced this pull request Oct 27, 2022
When defining Sentry config in `ENV['@sentry/ember'].sentry`, this goes through @embroider/macros under the hood. This relies on config being serializable, which means that e.g. you cannot use regex in the config.

To make this easier to pin down (as the error message can be a bit cryptic), this now validates the passed config (based on embroider-build/embroider#1083) and shows a helpful warning message.

Note that this also moved this around a bit, leading to config being written only once on build, which should be a bit faster.
mydea added a commit to getsentry/sentry-javascript that referenced this pull request Oct 28, 2022
When defining Sentry config in `ENV['@sentry/ember'].sentry`, this goes through @embroider/macros under the hood. This relies on config being serializable, which means that e.g. you cannot use regex in the config.

To make this easier to pin down (as the error message can be a bit cryptic), this now validates the passed config (based on embroider-build/embroider#1083) and shows a helpful warning message.

Note that this also moved this around a bit, leading to config being written only once on build, which should be a bit faster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-serializable objects in macro config should be a build error
2 participants