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

fix(engine-core): change console.errors to console.warns(#3692) #3698

Merged
merged 6 commits into from
Sep 29, 2023

Conversation

yashpatel1998
Copy link
Contributor

Details

change console.errors to console.warns
*fix: display warning instead of errors if the rendering continues despite the absence of lwc:dom="manual" directive

Does this pull request introduce a breaking change?

  • ✅ No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • ✅ No, it does not introduce an observable change.

@yashpatel1998 yashpatel1998 requested a review from a team as a code owner September 5, 2023 15:45
@salesforce-cla
Copy link

salesforce-cla bot commented Sep 5, 2023

Thanks for the contribution! Before we can merge this, we need @yashpatel1998 to sign the Salesforce Inc. Contributor License Agreement.

@abdulsattar
Copy link
Contributor

abdulsattar commented Sep 7, 2023

@yashpatel1998 what's the motivation for this? console.error doesn't block rendering and will continue. I found the relevant issue.

Thanks for this PR! You need to accept the CLA before we merge, though.

@yashpatel1998
Copy link
Contributor Author

yashpatel1998 commented Sep 8, 2023

@abdulsattar I have already accepted the CLA, but seems it is not reflected here
image
image

@jmsjtu
Copy link
Member

jmsjtu commented Sep 12, 2023

@yashpatel1998 could you confirm that the email used to sign your commits is the same as the one listed on your GitHub account (yashpatel.dev@gmail.com)?

If they are different, it could cause issues with the CLA bot.

@yashpatel1998
Copy link
Contributor Author

@jmsjtu I confirm it is the same email address. Will re-running the bot pipeline fix the issue by any chance?

@nolanlawson
Copy link
Contributor

@yashpatel1998 You could try pushing a new commit to this branch?

@nolanlawson
Copy link
Contributor

BTW this will almost certainly have some broken tests once the CI runs... if you do cd packages/@lwc/integration-karma && yarn test, you will see the test failures.

@yashpatel1998
Copy link
Contributor Author

@nolanlawson Pushed the integration-karma test changes. Could you check if the changes look good now?
A side note, the tests were failing for me in development mode with below error but succeeded for production. Not sure if this is intended.
image

@nolanlawson
Copy link
Contributor

@yashpatel1998 If the tests are failing in development mode, it looks like it's because there is a console.warn/error that is not being accounted for. The test are designed such that, if you forget to add the correct expect().toLog*Dev wrapper, then it will fail the tests overall.

Thank you again for the PR!

@nolanlawson nolanlawson mentioned this pull request Sep 26, 2023
@yashpatel1998
Copy link
Contributor Author

@nolanlawson Got you. Let me look into it and push the fix. Thank you for the help ! :)

replace spyOn(console, 'error') with spyOn(console, 'warn') in unit tests to check for logging of warn when manipulating node without lwc:dom="manual"
@yashpatel1998
Copy link
Contributor Author

@nolanlawson Lastest commit should fix the failing tests. Let me know if there are changes to be done.

Copy link
Contributor

@nolanlawson nolanlawson left a comment

Choose a reason for hiding this comment

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

LGTM. +1 when the CI tests are passing.

Thank you @yashpatel1998 !! 🎉

@nolanlawson
Copy link
Contributor

This doesn't fully resolve #3692 but it does fix probably the biggest source of spurious console errors.

@yashpatel1998
Copy link
Contributor Author

@nolanlawson Do you want me to replace other console.errors as part of the same issue later?

Excited for my first successful contribution to the framework! 😁

@nolanlawson
Copy link
Contributor

@yashpatel1998 Sure, those can be done in a separate PR. :) Thanks again for the contribution!

@nolanlawson
Copy link
Contributor

Integration tests are failing but they look unrelated to this PR. Might need to check if something changed in Chrome or something.

@yashpatel1998
Copy link
Contributor Author

Yeah, seems like.
Sure. I will take a look at the new PR,

@nolanlawson
Copy link
Contributor

Thanks very much!

@nolanlawson nolanlawson merged commit 36585c7 into salesforce:master Sep 29, 2023
11 checks passed
This was referenced Sep 29, 2023
@yashpatel1998 yashpatel1998 deleted the yash/issue-3692 branch September 30, 2023 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants