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
Refactor components to use a utility function to define jQuery plugins #32285
Conversation
980ba27
to
b5feae7
Compare
@@ -203,5 +219,6 @@ export { | |||
noop, | |||
reflow, | |||
getjQuery, | |||
onDOMContentLoaded | |||
onDOMContentLoaded, |
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.
Is the onDOMContentLoaded
export still used?
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.
Not that I'm aware of. I kept it like that because there is already a spec for it and to keep it testable. Also I wasn't sure if there would be some use case for it in the future.
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.
As the last resort we could rename this to _onDOMContentLoaded
, but since we test jQuery already, testing these individually might not be needed after all.
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.
It seems a better approach
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.
Actually, NVM my comment. Util isn't exposed in our public API https://github.com/twbs/bootstrap/blob/main/js/index.umd.js
So, I'd say @alpadev you can go ahead with this PR and ping us when it's ready. 👍
My only concern is that this shouldn't be part of the public API since it's not used anywhere else. That being said, there must be some way we can still test it. @rohit2sharma95 thoughts? |
BTW thanks for the PR, it definitely reduces the code and duplication :) |
5968339
to
45a279b
Compare
Closes #32286
TODO:
Preview: https://deploy-preview-32285--twbs-bootstrap.netlify.app/