-
Notifications
You must be signed in to change notification settings - Fork 142
Add warnings for conflicting/deprecated component attribs #1057
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
Conversation
ang-zeyu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 Just some nits:
openorclose
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use console.warn for now since they are warnings? Then we can change back to logger once it's working.
marvinchin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see a more structured way of flagging errors to the user :) Added a couple of suggestions to make these logging functions more versatile.
marvinchin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@nbriannl resolve the conflicts |
0e04800 to
f9e2e31
Compare
Use console log instead of logger add warning for modal slots Rewrite more efficient methods and use element Rewrite docs and reduce obvious code Reduce obvious code Remove empty lines Add gaurd clause and remove excessive todo Change console log to warn and remove return Change console log to warn Add more warns for dropdown Use conflicting instead of inconsistent Change c to child Add note regarding conlifcting attribs Restructure warnDeprecatedAttributes Use Foreach instead of loop Group all warns and put at start of parsing methods Restructure warnDeprecatedSlotName
f9e2e31 to
de67b19
Compare
* 'master' of https://github.com/MarkBind/markbind: 2.12.0 Update outdated test files Update vue-strap version to v2.0.1-markbind.37 Fix refactor to processDynamicResources (MarkBind#1092) Implement lazy page building for markbind serve (MarkBind#1038) Add warnings for conflicting/deprecated component attribs (MarkBind#1057) Allow changing parameter properties (MarkBind#1075) Custom timezone for built-in timestamp (MarkBind#1073) Fix reload inconsistency when updating frontmatter (MarkBind#1068) Implement an api to ignore content in certain tags (MarkBind#1047) Enable AppVeyor CI (MarkBind#1040) Add heading and line highlighting to code blocks (MarkBind#1034) Add dividers and fix bug in siteNav (MarkBind#1063) Fixed navbar no longer covers modals (MarkBind#1070) Add copy code-block plugin (MarkBind#1043) Render plugins on dynamic resources (MarkBind#1051) Documentation for Implement no-* attributes for <box> (MarkBind#1042) Migrate to bootstrap-vue popovers (MarkBind#1033) Refactor preprocess and url processing functions (MarkBind#1026) Add pageNav to Using Plugins Page (MarkBind#1062)
Replace console with logger A follow up to #1057. Let us also remove the error handler instance var And directly use logger instead
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [X] Other, please explain: Add warning for bad markbind attribute usage
Fixes #1048
What is the rationale for this request?
Discussion here MarkBind/vue-strap#118 (comment)
Warning the user at compile time of the usage of conflicting/deprecated attributes in components is good for author usability.
What changes did you make? (Give an overview)
When parsing component attributes, check for presence of inconsistent, and deprecated attributes and warn accordingly.
Used console.log instead of logger utility because
parser.test.jsfails. This might possibly be a bug regarding howlogger.jsresolves the directory. See #1060No documentation needed since it is a warning on the CLI side.
Provide some example code that this change will affect:
The code in this gist will now produce warnings
https://gist.github.com/nbriannl/5c44b3ee8a8af78c45a7a4f3659ce196
Is there anything you'd like reviewers to focus on?
Instead of writing another method to warn for deprecated slot name (which is incurring an addtional 1 pass search on the element's children), I wanted to change
renameSlottoprocessSlotwhich will do both checking for deprecated slot name, and renaming. But this assumes that every rename of a slot is for a deprecated name. Therefore, I stuck with making two separate functions.Testing instructions:
markbind servethe example code in the gist.https://gist.github.com/nbriannl/5c44b3ee8a8af78c45a7a4f3659ce196
You should see

Proposed commit message: (wrap lines at 72 characters)
Add warnings for conflicting/deprecated component attribs