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 flushDeprecations non-destructive #205

Open
simonihmig opened this issue Jan 24, 2025 · 0 comments
Open

Make flushDeprecations non-destructive #205

simonihmig opened this issue Jan 24, 2025 · 0 comments

Comments

@simonihmig
Copy link
Contributor

When I already had something in my deprecation-workflow.js but a new deprecation got added, I would like to be able to update my existing config by calling deprecationWorkflow.flushDeprecations(). But this ignores all previous content and just emits a new config.

For example I have this:

import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow';

setupDeprecationWorkflow({
  throwOnUnhandled: true,
  workflow: [
    { handler: 'log', matchId: 'deprecate-ember-error' },
  ],
});

Now when I run my tests (which hit deprecate-ember-error and let's say a new one called 'foo.bar') and call deprecationWorkflow.flushDeprecations()...

Expected

I would expect the existing workflow entry not to be touched, same as any other config like throwOnUnhandled.

import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow';

setupDeprecationWorkflow({
  throwOnUnhandled: true,
  workflow: [
    { handler: 'log', matchId: 'deprecate-ember-error' },
    { handler: 'silence', matchId: 'foo.bar' },
  ],
});

Actual
The existing config is not taken into account at all. You get the same as if the initial config was empty. throwOnUnhandled is removed, the matching workflow is overridden with defaults (silence instead of log):

import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow';

setupDeprecationWorkflow({
  workflow: [
    { handler: 'silence', matchId: 'deprecate-ember-error' },
    { handler: 'silence', matchId: 'foo.bar' },
  ],
});
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

No branches or pull requests

1 participant