@tolgee/core 5.10.0 → 5.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -134,7 +134,9 @@ declare function createTolgee(options: TolgeeOptions): Readonly<{
134
134
  language?: string | undefined;
135
135
  defaultLanguage?: string | undefined;
136
136
  availableLanguages?: string[] | undefined;
137
- fallbackLanguage?: import("./types").FallbackLanguageOption;
137
+ fallbackLanguage?: import("./types").FallbackLanguageOption; /**
138
+ * Turn off/on events emitting. Is on by default.
139
+ */
138
140
  ns?: string[] | undefined;
139
141
  fallbackNs?: import("./types").FallbackGeneral;
140
142
  defaultNs: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolgee/core",
3
- "version": "5.10.0",
3
+ "version": "5.10.1",
4
4
  "description": "Library providing ability to translate messages directly in context of developed application.",
5
5
  "main": "./dist/tolgee.cjs.js",
6
6
  "module": "./dist/tolgee.esm.js",
@@ -68,5 +68,5 @@
68
68
  "access": "public"
69
69
  },
70
70
  "sideEffects": false,
71
- "gitHead": "2fd3b3f7cdf7e71df7a5e40fc1374afd5a02f2ca"
71
+ "gitHead": "619a60f30c44c59db1866be0fcbc7f5dc26eb81d"
72
72
  }
@@ -277,9 +277,6 @@ export function Controller({ options }: StateServiceProps) {
277
277
  let result: Promise<void> | undefined = undefined;
278
278
  checkCorrectConfiguration();
279
279
  if (!state.isRunning()) {
280
- if (self.isDev()) {
281
- cache.invalidate();
282
- }
283
280
  state.setRunning(true);
284
281
  pluginService.run();
285
282
  result = loadInitial();
package/src/TolgeeCore.ts CHANGED
@@ -14,11 +14,18 @@ function createTolgee(options: TolgeeOptions) {
14
14
  options,
15
15
  });
16
16
 
17
+ if (controller.isDev()) {
18
+ // override existing data in DevMode
19
+ controller.invalidate();
20
+ }
21
+
17
22
  // restarts tolgee while applying callback
18
23
  function withRestart(callback: () => void) {
19
24
  const wasRunning = controller.isRunning();
20
25
  wasRunning && controller.stop();
21
26
  callback();
27
+ // invalidate cache when tolgee configuration is updated/plugin added in DevMode
28
+ controller.isDev() && controller.invalidate();
22
29
  wasRunning && controller.run();
23
30
  }
24
31