@remotion/bundler 4.0.140 → 4.0.142

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.
@@ -69,6 +69,12 @@ function RefreshModuleRuntime() {
69
69
  let refreshModuleRuntime = RefreshModuleRuntime.toString();
70
70
  refreshModuleRuntime = refreshModuleRuntime.slice(refreshModuleRuntime.indexOf('{') + 1, refreshModuleRuntime.lastIndexOf('}'));
71
71
  const ReactRefreshLoader = function (source, inputSourceMap) {
72
- this.callback(null, `${source}\n\n;${refreshModuleRuntime}`, inputSourceMap);
72
+ // Importing a module that declares the global variables _a and _b
73
+ // will conflict with the global variables that React Fast Refresh uses.
74
+ // https://github.com/remotion-dev/remotion/issues/3699
75
+ const renamedSymbols = refreshModuleRuntime
76
+ .replace(/_a/g, '_remotion_globalVariableA')
77
+ .replace(/_b/g, '_remotion_globalVariableB');
78
+ this.callback(null, `${source}\n;${renamedSymbols}`, inputSourceMap);
73
79
  };
74
80
  exports.default = ReactRefreshLoader;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fs_1 = require("fs");
4
+ const path_1 = require("path");
5
+ const vitest_1 = require("vitest");
6
+ (0, vitest_1.test)('Warrant the hack we have in loader.ts ', () => {
7
+ const path = (0, path_1.join)(process.cwd(), 'dist', 'fast-refresh', 'loader.js');
8
+ const contents = (0, fs_1.readFileSync)(path, 'utf-8');
9
+ (0, vitest_1.expect)(contents).toContain('var _a, _b');
10
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "4.0.140",
3
+ "version": "4.0.142",
4
4
  "description": "Bundler for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -25,9 +25,9 @@
25
25
  "style-loader": "2.0.0",
26
26
  "source-map": "0.7.3",
27
27
  "webpack": "5.83.1",
28
- "remotion": "4.0.140",
29
- "@remotion/studio": "4.0.140",
30
- "@remotion/studio-shared": "4.0.140"
28
+ "@remotion/studio": "4.0.142",
29
+ "remotion": "4.0.142",
30
+ "@remotion/studio-shared": "4.0.142"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "react": ">=16.8.0",
package/renderEntry.tsx CHANGED
@@ -15,12 +15,12 @@ import type {
15
15
  } from 'remotion';
16
16
  import {
17
17
  AbsoluteFill,
18
+ Internals,
19
+ VERSION,
18
20
  continueRender,
19
21
  delayRender,
20
22
  getInputProps,
21
23
  getRemotionEnvironment,
22
- Internals,
23
- VERSION,
24
24
  } from 'remotion';
25
25
  import {NoReactInternals} from 'remotion/no-react';
26
26
 
@@ -420,7 +420,7 @@ if (typeof window !== 'undefined') {
420
420
  };
421
421
  };
422
422
 
423
- window.siteVersion = '10';
423
+ window.siteVersion = '11';
424
424
  window.remotion_version = VERSION;
425
425
  window.remotion_setBundleMode = setBundleModeAndUpdate;
426
426
  }