Segmented Meteor App(s) - loading only half the client or two apps sharing a database

可紊 提交于 2019-12-22 11:33:59

问题


I understand the security model of publish and subscribe.

But I'm working on a somewhat large application, of which perhaps 70% will be admin only, restricted to less than 1% of the user base.

It seems horrible to send all the templates, css, and extra javascript and "add ons" (like wysiwyg editor) which are only going to be used by the admins, to all app users.

Is there a way to only send clientside stuff to certain users (or only when the user triggers a different "section"?

If not, i think my only option would be to have two different meteor applications side-by-side, which both use the same database, but have completely different applications/interfaces/sessions. see 2 apps with same database

Any other suggestions/ideas?


回答1:


A simple, but incomplete solution would be dynamically loading css and js dependencies at Template.mytemplate.created event. You'll still have shared html and packages code, but, depending on the application, it could be fine.

If you need more control over template dispatching this conversation at meteor talk group illustrates a couple of different solutions.

https://groups.google.com/forum/?fromgroups=#!searchin/meteor-talk/templates$2020/meteor-talk/F3DnoieDK00



来源:https://stackoverflow.com/questions/15606169/segmented-meteor-apps-loading-only-half-the-client-or-two-apps-sharing-a-dat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!