remotion 3.3.98 → 3.3.100

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.
@@ -41,7 +41,6 @@ export declare const Internals: {
41
41
  RemotionContextProvider: (props: import("./wrap-remotion-context.js").RemotionContextProviderProps) => JSX.Element;
42
42
  CSSUtils: typeof CSSUtils;
43
43
  setupEnvVariables: () => void;
44
- ENV_VARIABLES_ENV_NAME: "ENV_VARIABLES";
45
44
  MediaVolumeContext: import("react").Context<MediaVolumeContextValue>;
46
45
  SetMediaVolumeContext: import("react").Context<SetMediaVolumeContextValue>;
47
46
  validateDurationInFrames: ({ allowFloats, component, durationInFrames, }: {
@@ -73,7 +73,6 @@ exports.Internals = {
73
73
  RemotionContextProvider: wrap_remotion_context_js_1.RemotionContextProvider,
74
74
  CSSUtils,
75
75
  setupEnvVariables: setup_env_variables_js_1.setupEnvVariables,
76
- ENV_VARIABLES_ENV_NAME: setup_env_variables_js_1.ENV_VARIABLES_ENV_NAME,
77
76
  MediaVolumeContext: volume_position_state_js_1.MediaVolumeContext,
78
77
  SetMediaVolumeContext: volume_position_state_js_1.SetMediaVolumeContext,
79
78
  validateDurationInFrames: validate_duration_in_frames_js_1.validateDurationInFrames,
package/dist/cjs/nonce.js CHANGED
@@ -9,7 +9,13 @@ exports.NonceContext = (0, react_1.createContext)({
9
9
  const useNonce = () => {
10
10
  const context = (0, react_1.useContext)(exports.NonceContext);
11
11
  const [nonce, setNonce] = (0, react_1.useState)(() => context.getNonce());
12
+ const lastContext = (0, react_1.useRef)(context);
13
+ // Only if context changes, but not initially
12
14
  (0, react_1.useEffect)(() => {
15
+ if (lastContext.current === context) {
16
+ return;
17
+ }
18
+ lastContext.current = context;
13
19
  setNonce(context.getNonce);
14
20
  }, [context]);
15
21
  return nonce;
@@ -1,2 +1 @@
1
- export declare const ENV_VARIABLES_ENV_NAME: "ENV_VARIABLES";
2
1
  export declare const setupEnvVariables: () => void;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupEnvVariables = exports.ENV_VARIABLES_ENV_NAME = void 0;
3
+ exports.setupEnvVariables = void 0;
4
4
  const get_environment_js_1 = require("./get-environment.js");
5
- exports.ENV_VARIABLES_ENV_NAME = 'ENV_VARIABLES';
6
5
  const getEnvVariables = () => {
7
6
  if ((0, get_environment_js_1.getRemotionEnvironment)() === 'rendering') {
8
7
  const param = window.remotion_envVariables;
@@ -12,11 +11,10 @@ const getEnvVariables = () => {
12
11
  return { ...JSON.parse(param), NODE_ENV: process.env.NODE_ENV };
13
12
  }
14
13
  if ((0, get_environment_js_1.getRemotionEnvironment)() === 'preview') {
15
- // Webpack will convert this to an object at compile time.
16
- // Don't convert this syntax to a computed property.
14
+ // For the Preview, we already set the environment variables in index-html.ts.
15
+ // We just add NODE_ENV here.
17
16
  return {
18
- ...process.env.ENV_VARIABLES,
19
- NODE_ENV: process.env.NODE_ENV,
17
+ NODE_ENV: 'development',
20
18
  };
21
19
  }
22
20
  throw new Error('Can only call getEnvVariables() if environment is `rendering` or `preview`');
@@ -1 +1 @@
1
- export declare const VERSION = "3.3.98";
1
+ export declare const VERSION = "3.3.100";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Automatically generated on publish
5
- exports.VERSION = '3.3.98';
5
+ exports.VERSION = '3.3.100';
@@ -58,7 +58,7 @@ function truthy(value) {
58
58
  }
59
59
 
60
60
  // Automatically generated on publish
61
- const VERSION = '3.3.98';
61
+ const VERSION = '3.3.100';
62
62
 
63
63
  const checkMultipleRemotionVersions = () => {
64
64
  if (typeof globalThis === 'undefined') {
@@ -542,7 +542,13 @@ const NonceContext = createContext({
542
542
  const useNonce = () => {
543
543
  const context = useContext(NonceContext);
544
544
  const [nonce, setNonce] = useState(() => context.getNonce());
545
+ const lastContext = useRef(context);
546
+ // Only if context changes, but not initially
545
547
  useEffect(() => {
548
+ if (lastContext.current === context) {
549
+ return;
550
+ }
551
+ lastContext.current = context;
546
552
  setNonce(context.getNonce);
547
553
  }, [context]);
548
554
  return nonce;
@@ -2218,7 +2224,6 @@ const RemotionRoot = ({ children, numberOfAudioTags }) => {
2218
2224
  return (jsx(NonceContext.Provider, { value: nonceContext, children: jsx(TimelineContext.Provider, { value: timelineContextValue, children: jsx(SetTimelineContext.Provider, { value: setTimelineContextValue, children: jsx(PrefetchProvider, { children: jsx(NativeLayersProvider, { children: jsx(CompositionManagerProvider, { numberOfAudioTags: numberOfAudioTags, children: jsx(DurationsContextProvider, { children: children }) }) }) }) }) }) }));
2219
2225
  };
2220
2226
 
2221
- const ENV_VARIABLES_ENV_NAME = 'ENV_VARIABLES';
2222
2227
  const getEnvVariables = () => {
2223
2228
  if (getRemotionEnvironment() === 'rendering') {
2224
2229
  const param = window.remotion_envVariables;
@@ -2228,11 +2233,10 @@ const getEnvVariables = () => {
2228
2233
  return { ...JSON.parse(param), NODE_ENV: process.env.NODE_ENV };
2229
2234
  }
2230
2235
  if (getRemotionEnvironment() === 'preview') {
2231
- // Webpack will convert this to an object at compile time.
2232
- // Don't convert this syntax to a computed property.
2236
+ // For the Preview, we already set the environment variables in index-html.ts.
2237
+ // We just add NODE_ENV here.
2233
2238
  return {
2234
- ...process.env.ENV_VARIABLES,
2235
- NODE_ENV: process.env.NODE_ENV,
2239
+ NODE_ENV: 'development',
2236
2240
  };
2237
2241
  }
2238
2242
  throw new Error('Can only call getEnvVariables() if environment is `rendering` or `preview`');
@@ -2403,7 +2407,6 @@ const Internals = {
2403
2407
  RemotionContextProvider,
2404
2408
  CSSUtils,
2405
2409
  setupEnvVariables,
2406
- ENV_VARIABLES_ENV_NAME,
2407
2410
  MediaVolumeContext,
2408
2411
  SetMediaVolumeContext,
2409
2412
  validateDurationInFrames,
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '3.3.98';
2
+ const VERSION = '3.3.100';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "3.3.98",
3
+ "version": "3.3.100",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",