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

flushDeprecations output no longer formatted #103

Open
elwayman02 opened this issue May 3, 2021 · 4 comments · May be fixed by #155
Open

flushDeprecations output no longer formatted #103

elwayman02 opened this issue May 3, 2021 · 4 comments · May be fixed by #155

Comments

@elwayman02
Copy link
Contributor

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

@kategengler
Copy link
Member

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

As a workaround, in the console:

console.log(deprecationWorkflow.flushDeprecations())

@elwayman02
Copy link
Contributor Author

@mixonic is this an acceptable fix?

@mixonic
Copy link
Member

mixonic commented Jul 20, 2021

@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.

@elwayman02
Copy link
Contributor Author

elwayman02 commented Jul 20, 2021

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 added a commit to elwayman02/ember-cli-deprecation-workflow that referenced this issue May 17, 2023
Fixes ember-cli#103 by documented the suggested command in the README. This will improve the user experience for developers.
@elwayman02 elwayman02 linked a pull request May 17, 2023 that will close this issue
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 a pull request may close this issue.

3 participants