zeroasterisk
zeroasterisk

Reputation: 2209

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

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?

Upvotes: 2

Views: 365

Answers (1)

handmade
handmade

Reputation: 201

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

Upvotes: 3

Related Questions