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

Make rollup warnings build errors. #6850

Closed
wants to merge 1 commit into from

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Dec 4, 2019

This will ensure that all messages that are emitted to the console by rollup trigger a build failure and therefore prevent landing any changes to Ember Data that would introduce such a warning.

Follow up to #6809 (comment)

@rwjblue rwjblue requested a review from runspired December 4, 2019 14:49
This will ensure that all messages that are emitted to the console by
rollup trigger a build failure and therefore prevent landing any changes
to Ember Data that would introduce such a warning.
@rwjblue rwjblue force-pushed the do-not-tolerate-warnings branch from df6cef0 to eb60be5 Compare December 4, 2019 14:50
Copy link
Contributor

@runspired runspired left a comment

Choose a reason for hiding this comment

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

we already throw an error at build unless this is in a consuming app instead of our own, so I'm not sure what the advantage here is.

Edit: The intent here is to throw for any unhandled warning and not just the ones we know are due to us and how to handle.

I'm not sure how I feel about the potential work interruption when we encounter a rollup warning we haven't learned how to handle yet. The project halting for something that isn't required to be resolved immediately seems bad.

Since these are just warnings and not build errors, might be better to instead of throwing for all use an ENV flag to conditionally print the unhandled warnings when not locally developing and suppress them the rest of the time for consumers.

if (message.code === 'CIRCULAR_DEPENDENCY') {
return;
} else if (message.code === 'NON_EXISTENT_EXPORT') {
} else if (message.code === 'NON_EXISTENT_EXPORT' && message.message.includes('ts-interfaces')) {
Copy link
Contributor

@runspired runspired Dec 4, 2019

Choose a reason for hiding this comment

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

the removed slashes were there intentionally although I do see how it might look like a borked regex ;)

It's unlikely for this shorter string to match anything the longer string didn't match but the slashes were insurance we were finding a warning that included this string as part of a file path.

On the code style change I'm mixed. Folks rushed into using contains and includes and startsWith in our library and test code and I recently had to revert all of that to get us back to IE11 support. I like using new things but I dislike mixing styles. Overall though this is clearly a build file so its a bit more clear that it works here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Folks rushed into using contains and includes and startsWith in our library and test code and I recently had to revert all of that to get us back to IE11 support. I like using new things but I dislike mixing styles.

Ya, but this is Node code and has no requirement for IE11 support.

return;
}
} else if (message.code === 'UNRESOLVED_IMPORT') {
if (!this.isDevelopingAddon()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we shouldn't remove this check as rollup, babel, rollup plugins, broccoli, and broccoli-rollup may all be a different version in a consuming app than what we test and ship with. It's better to print an unnecessary warning than to break the build for those folks.

const chalk = require('chalk');
// make warning actionable
// eslint-disable-next-line no-console
console.log(
Copy link
Contributor

Choose a reason for hiding this comment

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

this warning (which is nicely actionable) would not pertain to any errors that don't match the removed message.code === 'UNRESOLVED_IMPORT'. We should bring back that condition.

@runspired
Copy link
Contributor

These have been build errors on master for some time, closing as unnecessary

@runspired runspired closed this Sep 2, 2022
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