Skip to content

refactor(core): improve extensibility of DiscussionPage #2

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

DavideIadeluca
Copy link
Member

@DavideIadeluca DavideIadeluca commented Sep 17, 2024

No description provided.

@DavideIadeluca DavideIadeluca changed the title Di/discussionpage extensibility refactor(core): improve extensibility of DiscussionPage Sep 17, 2024
@DavideIadeluca DavideIadeluca added the enhancement New feature or request label Sep 17, 2024
@DavideIadeluca DavideIadeluca self-assigned this Sep 17, 2024
@DavideIadeluca DavideIadeluca marked this pull request as ready for review September 17, 2024 10:25
@imorland
Copy link

Shouldn't we also add a hook so that we can insert Related Discussions via a new ItemList here? Don't we currently navigate the DOM for adding that?

@DavideIadeluca
Copy link
Member Author

Shouldn't we also add a hook so that we can insert Related Discussions via a new ItemList here? Don't we currently navigate the DOM for adding that?

The viewItems() method provides sufficient extensibility for third-party extensions. The remainder of the component is already quite extensible

@imorland
Copy link

Shouldn't we also add a hook so that we can insert Related Discussions via a new ItemList here? Don't we currently navigate the DOM for adding that?

The viewItems() method provides sufficient extensibility for third-party extensions. The remainder of the component is already quite extensible

Are you sure?
https://github.com/glowingblue/flarum-ext-related/blob/878e695ee4cfca5c908fb9e6055f3ea7827217d9/js/src/forum/addRelatedDiscussions.js#L49

@imorland
Copy link

Remember we want to avoid any DOM manipulation for the best compatibility...

@DavideIadeluca
Copy link
Member Author

Yes, adding an item to viewItems() will work. It will be the exact same DOM in the end as right now, without requiring direct DOM manipulations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants