Skip to content

Commit

Permalink
fix: avoid EasyPrivacy rule breaking app initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
th0rgall committed Jul 25, 2023
1 parent 57b2c00 commit 0b38c28
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { page } from '$app/stores';
import { isActiveContains } from '../util/isActive';
import type { Garden } from '../types/Garden';
import type { User as FirebaseUser } from 'firebase/auth';
import trackEvent from '$lib/util/track-event';
import { trackEvent } from '$lib/util';
import { PlausibleEvent } from '$lib/types/Plausible';

// These are not Svelte stores, because we do not wish to listen to updates on them.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { doc, DocumentReference, getDoc, updateDoc } from 'firebase/firestore';
import { db } from './firebase';

import { getUser } from '$lib/stores/auth';
import trackEvent from '$lib/util/track-event';
import { trackEvent } from '$lib/util';
import { PlausibleEvent } from '$lib/types/Plausible';
import type { UserPublic } from '$lib/models/User';

Expand Down
1 change: 1 addition & 0 deletions src/lib/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export { parse, pick } from './accept-language-parser';
export { slugify } from './slugify';
export { default as getFileExtension } from './getFileExtension';
export { default as fetchFrom } from './fetchFrom';
export { default as trackEvent } from './track-plausible';
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// NOTE: the filename of this file used to be "track-event.ts", but in some @sveltejs/kit@>1.0.0 version,
// this started bundling to /_app/immutable/chunks/track-event.edc71b85.js (or similar), which is blocked by the EasyPrivacy rule "/track-event.":
// https://github.com/easylist/easylist/blob/55a90a03050c5a278c1497d8443143dfd3d8810f/easyprivacy/easyprivacy_general.txt#L3150
// Previously, the chuck would have been named /track-event-edc71b85.js, which doesn't match the rule due to the '-' instead of the '.'
//
// Do not name it track-event again.
import { dev } from '$app/environment';
import { user } from '$lib/stores/auth';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/translation-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type MessageFormatter = Flatten<typeof _>;
import { UTM_MEMBERSHIP_CAMPAIGN, WTMG_BLOG_BASE_URL } from '$lib/constants';
import createUrl from './create-url';
import { goto } from './navigate';
import trackEvent from './track-event';
import trackEvent from './track-plausible';

if (window) {
// This function is referenced below in the inline onclick handler.
Expand Down

0 comments on commit 0b38c28

Please sign in to comment.