Skip to content

✨ Add deprecate config migrate util#494

Merged
wwilsman merged 2 commits intomasterfrom
ww/deprecate-config-util
Aug 13, 2021
Merged

✨ Add deprecate config migrate util#494
wwilsman merged 2 commits intomasterfrom
ww/deprecate-config-util

Conversation

@wwilsman
Copy link
Copy Markdown
Contributor

@wwilsman wwilsman commented Aug 13, 2021

What is this?

We currently only have a single place where config migrations log a few deprecation warnings, and that is in @percy/core. We also had/have deprecations in the Storybook SDK, although that SDK recently left beta and so the deprecations are/will be removed. In the future, other config deprecations might come up, and so it would be helpful to consolidate how deprecations are handled into a single migrate util passed along just like the other current migrate utils.

This PR also updates @percy/core migration deprecations to use the new util.

Depends on #493 as these changes are how I discovered those bugs.

@wwilsman wwilsman added the ✨ enhancement New feature or request label Aug 13, 2021
@wwilsman wwilsman requested a review from Robdel12 August 13, 2021 19:41
Base automatically changed from ww/config-util-bugs to master August 13, 2021 19:58
Copy link
Copy Markdown
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

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

🏁

'will be removed in 1.0.0. Use `discovery.requestHeaders` instead.'
expect(mocked.migrate.deprecate).toEqual([
['snapshot.authorization', { map: 'discovery.authorization', type: 'config', in: '1.0.0' }],
['snapshot.requestHeaders', { map: 'discovery.requestHeaders', type: 'config', in: '1.0.0' }]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wonder if we should open an issue like "v1.0.0 deprecations" and list the various deprecations we've made/make sure to remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea.

@wwilsman wwilsman force-pushed the ww/deprecate-config-util branch from 341a583 to 7098d50 Compare August 13, 2021 20:06
@wwilsman wwilsman enabled auto-merge (squash) August 13, 2021 20:09
@wwilsman wwilsman merged commit b7a4658 into master Aug 13, 2021
@wwilsman wwilsman deleted the ww/deprecate-config-util branch August 13, 2021 20:14
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.

2 participants