ember-cli-deprecation-workflow icon indicating copy to clipboard operation
ember-cli-deprecation-workflow copied to clipboard

flushDeprecations output no longer formatted

Open elwayman02 opened this issue 3 years ago • 4 comments

The output of flushDeprecations() no longer formats in a way that can be copied and pasted into the config file. We now get the raw string, which indicates this is likely a behavior change in Chrome DevTools/console.

Example:

"self.deprecationWorkflow = self.deprecationWorkflow || {};\nself.deprecationWorkflow.config = {\n  workflow: [\n    { handler: \"silence\", matchId: \"this-property-fallback\" },\n    { handler: \"silence\", matchId: \"manager-capabilities.modifiers-3-13\" }\n  ]\n};"

DevTools_-localhost_4200_components_navigation-list

elwayman02 avatar May 03 '21 19:05 elwayman02

Switching to a console.log here restores formatting in Chrome.

As a workaround, in the console:

console.log(deprecationWorkflow.flushDeprecations())

kategengler avatar Jul 08 '21 19:07 kategengler

@mixonic is this an acceptable fix?

elwayman02 avatar Jul 19 '21 19:07 elwayman02

@elwayman02 is a fix needed? flushDeprecations is supposed to give you a string of new contents for the deprecation config file. From your screenshot it seems like it is still doing that.

You can console.log( to print the string with formatting, or even copy(deprecationWorkflow.flushDeprecations()) to get the string into your OS pastebuffer.

mixonic avatar Jul 20 '21 00:07 mixonic

Well, prior to recent changes in behavior at the browser level, it printed with the correct formatting automatically. I always felt that one of the benefits of how this addon worked was that you could copy-paste the output of flushDeprecations into the file as part of onboarding. As someone who has had to update deprecations for ~50 addons over the last 2 months, I can say that it's a lot more time-consuming now, and while wrapping in console.log is an ok short-term workaround, I don't think it's an ideal developer experience to essentially force users of this addon to know that workaround instead of just having the output be formatted correctly when they call the documented method.

elwayman02 avatar Jul 20 '21 00:07 elwayman02