Skip to content

feat(exporters): added migration comments and test #10444

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

Merged
merged 15 commits into from
Nov 16, 2021

Conversation

igdmdimitrov
Copy link
Contributor

Closes #10247

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

Lipata
Lipata previously approved these changes Nov 10, 2021
@gedinakova gedinakova added 💥 status: in-test PRs currently being tested and removed ❌ status: awaiting-test PRs awaiting manual verification labels Nov 11, 2021
@gedinakova
Copy link
Contributor

@igdmdimitrov It seems we need to add the trailing comma (if it exists) to the comment, because it causes an error:
image

@gedinakova gedinakova added 🛠️ status: in-development Issues and PRs with active development on them and removed 💥 status: in-test PRs currently being tested labels Nov 11, 2021
@gedinakova
Copy link
Contributor

@igdmdimitrov @jackofdiamond5 @damyanpetev I'm not sure If we should comment the services out in the imports as well? Maybe only in the providers array?

@damyanpetev
Copy link
Member

@igdmdimitrov @jackofdiamond5 @damyanpetev I'm not sure If we should comment the services out in the imports as well? Maybe only in the providers array?

May be missing something, but is the comment message correct - IgxExcelExporterService has been removed.?
I thought it was available publicly as stand-alone service and if so that message is a bit misleading, no? And more to the point the use of it in provides can still have valid uses like overriding the service like { provide: IgxExcelExporterService , useClass: CustomService }, right?
In that case, especially if we can't detect with absolute certainty what the code is doing, adding just an explainer comment should be enough, just to indicate to updated project they can drop the provider most likely. IIRC that was kind of the general idea behind this. And even if we could, commenting out the service in code is kind of odd - like why leave it there? Either add the comment or remove it, doing both with the remove done with comment looks kinda messy in the end.

PS: The linked issue is not a bug btw, more like a nice-to-have enhancement for migrations
PPS: Not a huge fan of editing TypeScript code using Regex string manipulation - as you've seen it can get complicated handling code structure in just string without context (commas, formatting, etc). Ideally those changes should really target something very specific and be sure about it - there are some methods to find references to identifiers in the migration's tsUtils and perhaps some of that can be re-used.

@igdmdimitrov igdmdimitrov requested a review from Lipata November 12, 2021 13:42
@igdmdimitrov
Copy link
Contributor Author

@igdmdimitrov @jackofdiamond5 @damyanpetev I'm not sure If we should comment the services out in the imports as well? Maybe only in the providers array?

May be missing something, but is the comment message correct - IgxExcelExporterService has been removed.? I thought it was available publicly as stand-alone service and if so that message is a bit misleading, no? And more to the point the use of it in provides can still have valid uses like overriding the service like { provide: IgxExcelExporterService , useClass: CustomService }, right? In that case, especially if we can't detect with absolute certainty what the code is doing, adding just an explainer comment should be enough, just to indicate to updated project they can drop the provider most likely. IIRC that was kind of the general idea behind this. And even if we could, commenting out the service in code is kind of odd - like why leave it there? Either add the comment or remove it, doing both with the remove done with comment looks kinda messy in the end.

PS: The linked issue is not a bug btw, more like a nice-to-have enhancement for migrations PPS: Not a huge fan of editing TypeScript code using Regex string manipulation - as you've seen it can get complicated handling code structure in just string without context (commas, formatting, etc). Ideally those changes should really target something very specific and be sure about it - there are some methods to find references to identifiers in the migration's tsUtils and perhaps some of that can be re-used.

Addressed - now commenting only at the start of the file and mentioning the services used in the file.

@igdmdimitrov igdmdimitrov added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. 💥 status: in-test PRs currently being tested and removed 🛠️ status: in-development Issues and PRs with active development on them ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. labels Nov 15, 2021
@onlyexeption onlyexeption added ✅ status: verified Applies to PRs that have passed manual verification and removed 💥 status: in-test PRs currently being tested labels Nov 15, 2021
@DiyanDimitrov DiyanDimitrov merged commit 17d772a into master Nov 16, 2021
@DiyanDimitrov DiyanDimitrov deleted the dmdimitrov/exporter-services-migration branch November 16, 2021 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporters migrations version: 13.0.x ✅ status: verified Applies to PRs that have passed manual verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add migrations for the new way of providing exporter services
6 participants