meteor3: purge dead client packages — web UI renders on 3.1

alanning:roles removed (client crashed the whole bundle; plain user.roles
checks instead), selaias:cookie-consent replaced by in-repo React banner,
publish-performant-counts vendored with countAsync, Meteor.autorun dropped
(App)/Tracker.autorun (FiresMap), and the map publications not covered by
the REST smoke (activefiresmyloc, activefiresunionmyloc, fireAlerts,
oauth.verifyConfiguration) converted to async APIs.

Verified in browser: / and /fires render with map + cookie banner, zero
uncaught exceptions. REST smoke byte-identical (12/12).
This commit is contained in:
vjrj 2026-07-14 11:32:19 +02:00
parent 0ff9848cd4
commit eb3aec82ae
16 changed files with 194 additions and 50 deletions

View file

@ -1,5 +1,18 @@
/* global Facts */
import { Roles } from 'meteor/alanning:roles';
import { Meteor } from 'meteor/meteor';
import { Facts } from 'meteor/facts-base';
Facts.setUserIdFilter(userId => Roles.userIsInRole(userId, ['admin']));
/*
* alanning:roles removed (1.x is dead on Meteor 3 crashes the whole client
* bundle at load and 4.x needs a data migration we don't want). Admin check
* against the plain `user.roles` field, cached at startup: facts are
* dev/admin instrumentation and the admin set essentially never changes.
*/
const adminIds = new Set();
Meteor.startup(async () => {
await Meteor.users
.find({ roles: 'admin' }, { fields: { _id: 1 } })
.forEachAsync(u => adminIds.add(u._id));
});
Facts.setUserIdFilter(userId => adminIds.has(userId));