分段流星应用程序-仅加载一半的客户端或共享数据库的两个应用程序 [英] Segmented Meteor App(s) - loading only half the client or two apps sharing a database

查看:91
本文介绍了分段流星应用程序-仅加载一半的客户端或共享数据库的两个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解发布和订阅的安全模型.

I understand the security model of publish and subscribe.

但是我正在开发一个较大的应用程序,其中也许70%仅由管理员使用,但仅限于不到1%的用户群.

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.

将所有仅由管理员使用的模板,css,额外的javascript和"add ons"(如wysiwyg编辑器)发送给所有应用程序用户似乎很可怕.

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"?

如果没有,我认为我唯一的选择是并排使用两个不同的流星应用程序,它们都使用相同的数据库,但是具有完全不同的应用程序/接口/会话. 查看2个具有相同数据库的应用程序

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?

推荐答案

一个简单但不完整的解决方案是在Template.mytemplate.created事件中动态加载css和js依赖项.您仍将拥有共享的html和程序包代码,但是,取决于应用程序,这可能很好.

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

这篇关于分段流星应用程序-仅加载一半的客户端或共享数据库的两个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆