You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From #5803 it seems that implementers are trying to monkey-patch our code instead of creating their own components. Instead of adding complexity to check if DOM elements exist before binding event listeners etc., we should make sure that the JS code ('model') is decoupled as much as possible from the view to make life for skinned viewers easier.
The text was updated successfully, but these errors were encountered:
We don't need to change the code structure in order to support skinned viewers.
In the linked PR, the author seems to have removed some HTML in order to "skin" the viewer. The JS logic that supports these modules is still present, even though the UI controls are gone. Since (library) code size is not a concern in this case, they (third-party developers) can simply use CSS to change the appearance of the viewer (and use e.g. display:none to hide certain controls).
For anything more flexible than that, we have to support optional features (e.g. via //#if .. //#endif) or plugins. This is not a trivial effort, but PRs are welcome, I guess.
You are right. We have already decoupled the viewer code a lot by moving the different components into seperate files and classes. Now skinned viewers can disable functionality more easily. Since there are no other concrete plans to improve this even further, I'm closing this as solved. PRs are still welcome if there are places where even more decoupling is possible.
From #5803 it seems that implementers are trying to monkey-patch our code instead of creating their own components. Instead of adding complexity to check if DOM elements exist before binding event listeners etc., we should make sure that the JS code ('model') is decoupled as much as possible from the view to make life for skinned viewers easier.
The text was updated successfully, but these errors were encountered: