Skip to content

🎥 Make videos programmatically with React

update eslint config to newest

Jonny Burgerd88e6b0abf63
diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json
index a688b6b871..87925e96c6 100644
--- a/packages/eslint-config/package.json
+++ b/packages/eslint-config/package.json
@@ -19,12 +19,9 @@
"@remotion/eslint-plugin": "2.6.14",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
- "eslint-config-prettier": "8.3.0",
- "eslint-config-xo": "0.35.0",
- "eslint-config-xo-react": "0.24.0",
"eslint-plugin-10x": "1.5.0",
- "eslint-plugin-react": "7.26.1",
- "eslint-plugin-react-hooks": "4.3.0"
+ "eslint-plugin-react": "7.29.4",
+ "eslint-plugin-react-hooks": "4.4.0"
},
"devDependencies": {
"@types/node": "17.0.17",
diff --git a/packages/eslint-config/src/declarations.d.ts b/packages/eslint-config/src/declarations.d.ts
deleted file mode 100644
index 8233528ddc..0000000000
--- a/packages/eslint-config/src/declarations.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-declare module "eslint-config-xo/esnext" {
- export const rules: any;
-}
-declare module "eslint-config-xo-react" {
- export const plugins: any;
- export const rules: any;
-}
diff --git a/packages/eslint-config/src/index.ts b/packages/eslint-config/src/index.ts
index 897b14f0eb..03d3a70b7c 100644
--- a/packages/eslint-config/src/index.ts
+++ b/packages/eslint-config/src/index.ts
@@ -1,21 +1,555 @@
-import xo = require("eslint-config-xo/esnext");
-import xoReact = require("eslint-config-xo-react");
import { autoImports } from "./auto-import-rules";
-const baseExtends = ["eslint:recommended", "prettier"];
+const baseExtends = ["eslint:recommended"];
const getRules = (typescript: boolean) => {
return {
- ...xo.rules,
- ...xoReact.rules,
- "react/jsx-no-constructed-context-values": "off",
+ // prettier
+ curly: 0,
+ "lines-around-comment": 0,
+ "max-len": 0,
+ "no-confusing-arrow": 0,
+ "no-mixed-operators": 0,
+ "no-tabs": 0,
+ "no-unexpected-multiline": 0,
+ quotes: 0,
+ "@typescript-eslint/quotes": 0,
+ "babel/quotes": 0,
+ "array-bracket-newline": "off",
+ "array-bracket-spacing": "off",
+ "array-element-newline": "off",
+ "arrow-parens": "off",
+ "arrow-spacing": "off",
+ "block-spacing": "off",
+ "brace-style": "off",
+ "comma-dangle": "off",
+ "comma-spacing": "off",
+ "comma-style": "off",
+ "computed-property-spacing": "off",
+ "dot-location": "off",
+ "eol-last": "off",
+ "func-call-spacing": "off",
+ "function-call-argument-newline": "off",
+ "function-paren-newline": "off",
+ "generator-star": "off",
+ "generator-star-spacing": "off",
+ "implicit-arrow-linebreak": "off",
+ indent: "off",
+ "jsx-quotes": "off",
+ "key-spacing": "off",
+ "keyword-spacing": "off",
+ "linebreak-style": "off",
+ "multiline-ternary": "off",
+ "newline-per-chained-call": "off",
+ "new-parens": "off",
+ "no-arrow-condition": "off",
+ "no-comma-dangle": "off",
+ "no-extra-parens": "off",
+ "no-extra-semi": "off",
+ "no-floating-decimal": "off",
+ "no-mixed-spaces-and-tabs": "off",
+ "no-multi-spaces": "off",
+ "no-multiple-empty-lines": "off",
+ "no-reserved-keys": "off",
+ "no-space-before-semi": "off",
+ "no-trailing-spaces": "off",
+ "no-whitespace-before-property": "off",
+ "no-wrap-func": "off",
+ "nonblock-statement-body-position": "off",
+ "object-curly-newline": "off",
+ "object-curly-spacing": "off",
+ "object-property-newline": "off",
+ "one-var-declaration-per-line": "off",
+ "operator-linebreak": "off",
+ "padded-blocks": "off",
+ "quote-props": "off",
+ "rest-spread-spacing": "off",
+ semi: "off",
+ "semi-spacing": "off",
+ "semi-style": "off",
+ "space-after-function-name": "off",
+ "space-after-keywords": "off",
+ "space-before-blocks": "off",
+ "space-before-function-paren": "off",
+ "space-before-function-parentheses": "off",
+ "space-before-keywords": "off",
+ "space-in-brackets": "off",
+ "space-in-parens": "off",
+ "space-infix-ops": "off",
+ "space-return-throw-case": "off",
+ "space-unary-ops": "off",
+ "space-unary-word-ops": "off",
+ "switch-colon-spacing": "off",
+ "template-curly-spacing": "off",
+ "template-tag-spacing": "off",
+ "unicode-bom": "off",
+ "wrap-iife": "off",
+ "wrap-regex": "off",
+ "yield-star-spacing": "off",
+ "@babel/object-curly-spacing": "off",
+ "@babel/semi": "off",
+ "@typescript-eslint/brace-style": "off",
+ "@typescript-eslint/comma-dangle": "off",
+ "@typescript-eslint/comma-spacing": "off",
+ "@typescript-eslint/func-call-spacing": "off",
+ "@typescript-eslint/indent": "off",
+ "@typescript-eslint/keyword-spacing": "off",
+ "@typescript-eslint/member-delimiter-style": "off",
+ "@typescript-eslint/no-extra-parens": "off",
+ "@typescript-eslint/no-extra-semi": "off",
+ "@typescript-eslint/object-curly-spacing": "off",
+ "@typescript-eslint/semi": "off",
+ "@typescript-eslint/space-before-function-paren": "off",
+ "@typescript-eslint/space-infix-ops": "off",
+ "@typescript-eslint/type-annotation-spacing": "off",
+ "babel/object-curly-spacing": "off",
+ "babel/semi": "off",
+ "flowtype/boolean-style": "off",
+ "flowtype/delimiter-dangle": "off",
+ "flowtype/generic-spacing": "off",
+ "flowtype/object-type-curly-spacing": "off",
+ "flowtype/object-type-delimiter": "off",
+ "flowtype/quotes": "off",
+ "flowtype/semi": "off",
+ "flowtype/space-after-type-colon": "off",
+ "flowtype/space-before-generic-bracket": "off",
+ "flowtype/space-before-type-colon": "off",
+ "flowtype/union-intersection-spacing": "off",
+ "react/jsx-child-element-spacing": "off",
+ "react/jsx-closing-bracket-location": "off",
+ "react/jsx-closing-tag-location": "off",
"react/jsx-curly-newline": "off",
+ "react/jsx-curly-spacing": "off",
+ "react/jsx-equals-spacing": "off",
+ "react/jsx-first-prop-new-line": "off",
+ "react/jsx-indent": "off",
+ "react/jsx-indent-props": "off",
+ "react/jsx-max-props-per-line": "off",
+ "react/jsx-newline": "off",
+ "react/jsx-one-expression-per-line": "off",
+ "react/jsx-props-no-multi-spaces": "off",
+ "react/jsx-tag-spacing": "off",
+ "react/jsx-wrap-multilines": "off",
+ // xo config
+ "for-direction": "error",
+ "getter-return": "error",
+ "no-async-promise-executor": "error",
+ "no-await-in-loop": "error",
+ "no-compare-neg-zero": "error",
+ "no-cond-assign": "error",
+ "no-constant-condition": "error",
+ "no-control-regex": "error",
+ "no-debugger": "error",
+ "no-dupe-args": "error",
+ "no-dupe-else-if": "error",
+ "no-dupe-keys": "error",
+ "no-duplicate-case": "error",
+ "no-empty-character-class": "error",
+ "no-empty": [
+ "error",
+ {
+ allowEmptyCatch: true,
+ },
+ ],
+ "no-ex-assign": "error",
+ "no-extra-boolean-cast": "error",
+ // Disabled because of https://github.com/eslint/eslint/issues/6028
+ // 'no-extra-parens': [
+ // 'error',
+ // 'all',
+ // {
+ // conditionalAssign: false,
+ // nestedBinaryExpressions: false,
+ // ignoreJSX: 'multi-line'
+ // }
+ // ],
+ "no-func-assign": "error",
+ "no-import-assign": "error",
+ "no-inner-declarations": "error",
+ "no-invalid-regexp": "error",
+ "no-irregular-whitespace": "error",
+ "no-loss-of-precision": "error",
+ "no-misleading-character-class": "error",
+ "no-obj-calls": "error",
+ "no-promise-executor-return": "error",
+ "no-prototype-builtins": "error",
+ "no-regex-spaces": "error",
+ "no-setter-return": "error",
+ "no-sparse-arrays": "error",
+ "no-template-curly-in-string": "error",
+ "no-unreachable": "error",
+ "no-unreachable-loop": "error",
+ "no-unsafe-finally": "error",
+ "no-unsafe-negation": "error",
+ "no-unsafe-optional-chaining": [
+ "error",
+ {
+ disallowArithmeticOperators: true,
+ },
+ ],
+ "no-useless-backreference": "error",
+ "use-isnan": "error",
+ "valid-typeof": [
+ "error",
+ {
+ requireStringLiterals: false,
+ },
+ ],
+ "accessor-pairs": [
+ "error",
+ {
+ enforceForClassMembers: true,
+ },
+ ],
+ "array-callback-return": [
+ "error",
+ {
+ allowImplicit: true,
+ },
+ ],
+ "block-scoped-var": "error",
+ complexity: "warn",
+ "default-case": "error",
+ "default-case-last": "error",
+ "default-param-last": "error",
+ "dot-notation": "error",
+ eqeqeq: "error",
+ "grouped-accessor-pairs": ["error", "getBeforeSet"],
+ "guard-for-in": "error",
+ "no-alert": "error",
+ "no-caller": "error",
+ "no-case-declarations": "error",
+ "no-constructor-return": "error",
+ "no-else-return": [
+ "error",
+ {
+ allowElseIf: false,
+ },
+ ],
+ "no-empty-pattern": "error",
+ "no-eq-null": "error",
+ "no-eval": "error",
+ "no-extend-native": "error",
+ "no-extra-bind": "error",
+ "no-extra-label": "error",
+ "no-fallthrough": "error",
+ "no-global-assign": "error",
+ "no-implicit-coercion": "error",
+ "no-implicit-globals": "error",
+ "no-implied-eval": "error",
+ "no-iterator": "error",
+ "no-labels": "error",
+ "no-lone-blocks": "error",
+ "no-multi-str": "error",
+ "no-new-func": "error",
+ "no-new-wrappers": "error",
+ "no-nonoctal-decimal-escape": "error",
+ "no-new": "error",
+ "no-octal-escape": "error",
+ "no-octal": "error",
+ "no-proto": "error",
+ "no-redeclare": "error",
+ "no-return-assign": ["error", "always"],
+ "no-return-await": "error",
+ "no-script-url": "error",
+ "no-self-assign": [
+ "error",
+ {
+ props: true,
+ },
+ ],
+ "no-self-compare": "error",
+ "no-sequences": "error",
+ "no-throw-literal": "error",
+ "no-unmodified-loop-condition": "error",
+ "no-unused-expressions": [
+ "error",
+ {
+ enforceForJSX: true,
+ },
+ ],
+ "no-unused-labels": "error",
+ "no-useless-call": "error",
+ "no-useless-concat": "error",
+ "no-useless-escape": "error",
+ "no-useless-return": "error",
+ "no-void": "error",
+ "no-warning-comments": "warn",
+ "no-with": "error",
+ "prefer-promise-reject-errors": [
+ "error",
+ {
+ allowEmptyReject: true,
+ },
+ ],
+ "prefer-regex-literals": "error",
+ radix: "error",
+
+ // Disabled for now as it causes too much churn
+ // TODO: Enable it in the future when I have time to deal with
+ // the churn and the rule is stable and has an autofixer
+ // 'require-unicode-regexp': 'error',
+
+ yoda: "error",
+ "no-delete-var": "error",
+ "no-label-var": "error",
+ "no-restricted-globals": ["error", "event"],
+ "no-shadow-restricted-names": "error",
+ "no-undef-init": "error",
+ "no-undef": [
+ "error",
+ {
+ typeof: true,
+ },
+ ],
+ "no-unused-vars": [
+ "error",
+ {
+ vars: "all",
+ args: "after-used",
+ ignoreRestSiblings: true,
+ argsIgnorePattern: /^_/.source,
+ caughtErrors: "all",
+ caughtErrorsIgnorePattern: /^_$/.source,
+ },
+ ],
+ "no-buffer-constructor": "error",
+ "no-restricted-imports": [
+ "error",
+ "domain",
+ "freelist",
+ "smalloc",
+ "sys",
+ "colors",
+ ],
+
+ camelcase: [
+ "error",
+ {
+ properties: "always",
+ },
+ ],
+ "capitalized-comments": [
+ "error",
+ "always",
+ {
+ // You can also ignore this rule by wrapping the first word in quotes.
+ // c8 => https://github.com/bcoe/c8
+ ignorePattern: /pragma|ignore|prettier-ignore|webpack\w+:|c8/.source,
+ ignoreInlineComments: true,
+ ignoreConsecutiveComments: true,
+ },
+ ],
+ "func-name-matching": [
+ "error",
+ {
+ considerPropertyDescriptor: true,
+ },
+ ],
+ "func-names": ["error", "never"],
+ "lines-between-class-members": [
+ "error",
+ "always",
+ {
+ // Workaround to allow class fields to not have lines between them.
+ // TODO: Get ESLint to add an option to ignore class fields.
+ exceptAfterSingleLine: true,
+ },
+ ],
+ "max-depth": "warn",
+ "max-nested-callbacks": ["warn", 4],
+ "max-params": [
+ "warn",
+ {
+ max: 4,
+ },
+ ],
+ "max-statements-per-line": "error",
+ "no-array-constructor": "error",
+ "no-lonely-if": "error",
+ "no-multi-assign": "error",
+ "no-negated-condition": "error",
+ "no-new-object": "error",
+ "no-restricted-syntax": ["error", "WithStatement"],
+ "no-unneeded-ternary": "error",
+ // Disabled because of https://github.com/xojs/eslint-config-xo/issues/27
+ // 'object-property-newline': 'error',
+ "one-var": ["error", "never"],
+ "operator-assignment": ["error", "always"],
+ "padding-line-between-statements": [
+ "error",
+ {
+ blankLine: "always",
+ prev: "multiline-block-like",
+ next: "*",
+ },
+ ],
+ "prefer-exponentiation-operator": "error",
+ "spaced-comment": [
+ "error",
+ "always",
+ {
+ line: {
+ exceptions: ["-", "+", "*"],
+ markers: ["!", "/", "=>"],
+ },
+ block: {
+ exceptions: ["-", "+", "*"],
+ markers: ["!", "*"],
+ balanced: true,
+ },
+ },
+ ],
+ "constructor-super": "error",
+ "no-class-assign": "error",
+ "no-const-assign": "error",
+ "no-dupe-class-members": "error",
+ "no-new-symbol": "error",
+ "no-this-before-super": "error",
+ "no-useless-computed-key": [
+ "error",
+ {
+ enforceForClassMembers: true,
+ },
+ ],
+ "no-useless-constructor": "error",
+ "no-useless-rename": "error",
+ "require-yield": "error",
+ "symbol-description": "error",
+ "no-var": "error",
+ "object-shorthand": ["error", "always"],
+ "prefer-arrow-callback": [
+ "error",
+ {
+ allowNamedFunctions: true,
+ },
+ ],
+ "prefer-const": [
+ "error",
+ {
+ destructuring: "all",
+ },
+ ],
+ "prefer-numeric-literals": "error",
+ "prefer-rest-params": "error",
+ "prefer-spread": "error",
+ "prefer-object-spread": "error",
+ "prefer-destructuring": [
+ "error",
+ {
+ // `array` is disabled because it forces destructuring on
+ // stupid stuff like `foo.bar = process.argv[2];`
+ // TODO: Open ESLint issue about this
+ VariableDeclarator: {
+ array: false,
+ object: true,
+ },
+ AssignmentExpression: {
+ array: false,
+
+ // Disabled because object assignment destructuring requires parens wrapping:
+ // `let foo; ({foo} = object);`
+ object: false,
+ },
+ },
+ {
+ enforceForRenamedProperties: false,
+ },
+ ],
+ "no-useless-catch": "error",
+ // xo-react rules
+ "react/boolean-prop-naming": [
+ "error",
+ {
+ validateNested: true,
+ },
+ ],
+ "react/button-has-type": "error",
+ "react/default-props-match-prop-types": "error",
+ "react/function-component-definition": [
+ "error",
+ {
+ namedComponents: "arrow-function",
+ unnamedComponents: "arrow-function",
+ },
+ ],
+ "react/no-access-state-in-setstate": "error",
+ "react/no-children-prop": "error",
+ "react/no-danger": "error",
+ "react/no-danger-with-children": "error",
+ "react/no-deprecated": "error",
+ "react/no-did-update-set-state": "error",
+ "react/no-direct-mutation-state": "error",
+ "react/no-find-dom-node": "error",
+ "react/no-is-mounted": "error",
+ "react/no-redundant-should-component-update": "error",
+ "react/no-render-return-value": "error",
+ "react/no-typos": "error",
+ "react/no-string-refs": [
+ "error",
+ {
+ noTemplateLiterals: true,
+ },
+ ],
+ "react/no-this-in-sfc": "error",
+ "react/no-unescaped-entities": "error",
+ "react/no-unknown-property": "error",
+ "react/no-unsafe": "error",
+ "react/no-unused-prop-types": "error",
+ "react/no-unused-state": "error",
+ "react/prefer-read-only-props": "error",
+ "react/require-default-props": [
+ "error",
+ {
+ forbidDefaultForRequired: true,
+ ignoreFunctionalComponents: true,
+ },
+ ],
+ "react/self-closing-comp": "error",
+ "react/state-in-constructor": ["error", "never"],
+ "react/static-property-placement": "error",
+ "react/style-prop-object": "error",
+ "react/void-dom-elements-no-children": "error",
+ "react/jsx-boolean-value": "error",
+ "react/jsx-no-bind": [
+ "error",
+ {
+ allowArrowFunctions: true,
+ },
+ ],
+ "react/jsx-no-comment-textnodes": "error",
+ "react/jsx-no-duplicate-props": [
+ "error",
+ {
+ ignoreCase: true,
+ },
+ ],
+ "react/jsx-no-script-url": "error",
+ "react/jsx-no-undef": "error",
+ "react/jsx-curly-brace-presence": ["error", "never"],
+ "react/jsx-fragments": ["error", "syntax"],
+ "react/jsx-pascal-case": "error",
+ "react/jsx-sort-props": [
+ "error",
+ {
+ callbacksLast: true,
+ shorthandFirst: true,
+ noSortAlphabetically: true,
+ reservedFirst: true,
+ },
+ ],
+ "react/jsx-uses-react": "error",
+ "react/jsx-uses-vars": "error",
+
+ "react-hooks/rules-of-hooks": "error",
+ "react-hooks/exhaustive-deps": "warn",
+ // Turning off rules that are too strict or don't apply to Remotion
+ "react/jsx-no-constructed-context-values": "off",
"no-console": "off",
"10x/react-in-scope": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-key": "off",
"react/jsx-no-target-blank": "off",
- "react/jsx-tag-spacing": "off",
"react/prop-types": "off",
// The following rules are handled by typescript-eslint
...(typescript
@@ -56,21 +590,17 @@ export = {
es6: true,
jest: true,
},
- globals: {
- Text: "off",
- StyleSheet: "off",
- },
plugins: [
- ...xoReact.plugins,
- "@typescript-eslint/eslint-plugin",
"react",
+ "react-hooks",
+ "@typescript-eslint/eslint-plugin",
"10x",
"@remotion",
],
extends: baseExtends,
parser: require.resolve("@typescript-eslint/parser"),
parserOptions: {
- ecmaVersion: 2020,
+ ecmaVersion: 2021,
sourceType: "module",
ecmaFeatures: {
jsx: true,
@@ -87,7 +617,7 @@ export = {
rules: getRules(false),
settings: {
react: {
- version: "17.0.0",
+ version: "18.0.0",
},
},
};
diff --git a/packages/example/src/AudioTestingMute/index.tsx b/packages/example/src/AudioTestingMute/index.tsx
index d1d12ec903..751d3ba8bc 100644
--- a/packages/example/src/AudioTestingMute/index.tsx
+++ b/packages/example/src/AudioTestingMute/index.tsx
@@ -21,13 +21,13 @@ const AudioTestingMute: React.FC = () => {
const getMuteState = React.useCallback(
(type: 'movie' | 'music') => {
const muteParts = [
- {start: 1 * fps, end: 2 * fps},
+ {start: Number(fps), end: 2 * fps},
{start: 4 * fps, end: 5 * fps},
];
const toMute = muteParts.some(
(mp) => frame >= mp.start && frame <= mp.end
);
- return type == 'movie' ? toMute : !toMute;
+ return type === 'movie' ? toMute : !toMute;
},
[fps, frame]
);
diff --git a/packages/example/src/AudioVisualization/index.tsx b/packages/example/src/AudioVisualization/index.tsx
index ad80e8d4b1..cf5c3ad0aa 100644
--- a/packages/example/src/AudioVisualization/index.tsx
+++ b/packages/example/src/AudioVisualization/index.tsx
@@ -89,6 +89,7 @@ const AudioVisualization: React.FC = () => {
if (!audioData) {
return null;
}
+
const visualization = visualizeAudio({
fps,
frame,
diff --git a/packages/example/src/MdxTest/index.tsx b/packages/example/src/MdxTest/index.tsx
index 43b84d6f59..357b634db5 100644
--- a/packages/example/src/MdxTest/index.tsx
+++ b/packages/example/src/MdxTest/index.tsx
@@ -16,4 +16,5 @@ const MdxTest: React.FC = () => {
</AbsoluteFill>
);
};
+
export default MdxTest;
diff --git a/packages/example/src/NewPackAnnouncement/index.tsx b/packages/example/src/NewPackAnnouncement/index.tsx
index a40060f39e..41664e38ff 100644
--- a/packages/example/src/NewPackAnnouncement/index.tsx
+++ b/packages/example/src/NewPackAnnouncement/index.tsx
@@ -29,9 +29,11 @@ const getStickerScale = (frame: number, index: number): number => {
if (frame < start) {
return 0;
}
+
if (frame > start + duration) {
return 1;
}
+
return (frame - start) / duration;
};
diff --git a/packages/example/src/StaggerTesting/index.tsx b/packages/example/src/StaggerTesting/index.tsx
index fd9bb24a9d..67fdb2b00f 100644
--- a/packages/example/src/StaggerTesting/index.tsx
+++ b/packages/example/src/StaggerTesting/index.tsx
@@ -19,4 +19,4 @@ const SeriesTesting: FC = () => {
);
};
-export {SeriesTesting as SeriesTesting};
+export {SeriesTesting};
diff --git a/packages/example/src/StaggerType/index.tsx b/packages/example/src/StaggerType/index.tsx
index f3d538f23d..53b893cb4e 100644
--- a/packages/example/src/StaggerType/index.tsx
+++ b/packages/example/src/StaggerType/index.tsx
@@ -45,6 +45,7 @@ const StaggerType: React.FC = () => {
if (!isSecondHalf) {
return i % 2 === 0;
}
+
return Math.ceil(frame / 10) % 2 === i % 2;
})();
const color = mix(ratio, '#fff', '#000');
diff --git a/packages/example/src/Video.tsx b/packages/example/src/Video.tsx
index a6d407b128..4be4283de1 100644
--- a/packages/example/src/Video.tsx
+++ b/packages/example/src/Video.tsx
@@ -22,7 +22,7 @@ import {VideoSpeed} from './VideoSpeed';
import {VideoTesting} from './VideoTesting';
// Use it to test that UI does not regress on weird CSS
-//import './weird-css.css';
+// import './weird-css.css';
export const Index: React.FC = () => {
const inputProps = getInputProps();
diff --git a/packages/example/src/VideoOnCanvas/greenscreen.tsx b/packages/example/src/VideoOnCanvas/greenscreen.tsx
index 963ff8cd36..e500f636e6 100644
--- a/packages/example/src/VideoOnCanvas/greenscreen.tsx
+++ b/packages/example/src/VideoOnCanvas/greenscreen.tsx
@@ -16,6 +16,7 @@ export const Greenscreen: React.FC = () => {
) {
return;
}
+
const context = canvas.current.getContext('2d');
if (!context) {
@@ -34,6 +35,7 @@ export const Greenscreen: React.FC = () => {
imageFrame.data[i + 3] = 0;
}
}
+
context.putImageData(imageFrame, 0, 0);
video.current.requestVideoFrameCallback(() => onVideoFrame());
@@ -43,6 +45,7 @@ export const Greenscreen: React.FC = () => {
if (!video.current || !video.current.requestVideoFrameCallback) {
return;
}
+
video.current.requestVideoFrameCallback(() => onVideoFrame());
}, [onVideoFrame]);
diff --git a/packages/example/src/VideoOnCanvas/index.tsx b/packages/example/src/VideoOnCanvas/index.tsx
index be669e0861..236dd63e0c 100644
--- a/packages/example/src/VideoOnCanvas/index.tsx
+++ b/packages/example/src/VideoOnCanvas/index.tsx
@@ -16,6 +16,7 @@ export const VideoOnCanvas: React.FC = () => {
) {
return;
}
+
const context = canvas.current.getContext('2d');
if (!context) {
@@ -31,6 +32,7 @@ export const VideoOnCanvas: React.FC = () => {
if (!video.current || !video.current.requestVideoFrameCallback) {
return;
}
+
video.current.requestVideoFrameCallback(() => onVideoFrame());
}, [onVideoFrame]);
diff --git a/packages/example/src/webpack-override.ts b/packages/example/src/webpack-override.ts
index 0b8857695e..d8dfcea8df 100644
--- a/packages/example/src/webpack-override.ts
+++ b/packages/example/src/webpack-override.ts
@@ -17,6 +17,7 @@ export const webpackOverride: WebpackOverrideFn = (currentConfiguration) => {
));
return replaceLoadersWithBabel(currentConfiguration);
}
+
return currentConfiguration;
})();
return {
diff --git a/packages/lambda/remotionlambda.zip b/packages/lambda/remotionlambda.zip
index f9a0559713..4ec1422c1b 100644
Binary files a/packages/lambda/remotionlambda.zip and b/packages/lambda/remotionlambda.zip differ
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 76ac8d6699..487d39a0da 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -354,23 +354,17 @@ importers:
'@types/node': 17.0.17
'@typescript-eslint/eslint-plugin': 5.11.0
'@typescript-eslint/parser': 5.11.0
- eslint-config-prettier: 8.3.0
- eslint-config-xo: 0.35.0
- eslint-config-xo-react: 0.24.0
eslint-plugin-10x: 1.5.0
- eslint-plugin-react: 7.26.1
- eslint-plugin-react-hooks: 4.3.0
+ eslint-plugin-react: 7.29.4
+ eslint-plugin-react-hooks: 4.4.0
typescript: ^4.5.5
dependencies:
'@remotion/eslint-plugin': link:../eslint-plugin
'@typescript-eslint/eslint-plugin': 5.11.0_5448361d0c7d01128df3422f1139058a
'@typescript-eslint/parser': [email protected]
- eslint-config-prettier: 8.3.0
- eslint-config-xo: 0.35.0
- eslint-config-xo-react: 0.24.0_2c54d852e52d7b865ace652dae274235
eslint-plugin-10x: 1.5.0
- eslint-plugin-react: 7.26.1
- eslint-plugin-react-hooks: 4.3.0
+ eslint-plugin-react: 7.29.4
+ eslint-plugin-react-hooks: 4.4.0
devDependencies:
'@types/node': 17.0.17
typescript: 4.5.5
@@ -14496,13 +14490,6 @@ packages:
optionalDependencies:
source-map: 0.6.1
- /eslint-config-prettier/8.3.0:
- resolution: {integrity: sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==}
- hasBin: true
- peerDependencies:
- eslint: '>=7.0.0'
- dev: false
-
/eslint-config-prettier/[email protected]:
resolution: {integrity: sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==}
hasBin: true
@@ -14546,18 +14533,6 @@ packages:
eslint-plugin-testing-library: [email protected][email protected]
dev: false
- /eslint-config-xo-react/0.24.0_2c54d852e52d7b865ace652dae274235:
- resolution: {integrity: sha512-Hc6pHDJf8y71Uo1jwWJ85CaFGTPxHp26L+49H5jgALB1rTmmxMUA70sDv6qj3icPgSWbkiOvuHM6tis+ws3stQ==}
- engines: {node: '>=10'}
- peerDependencies:
- eslint: '>=7'
- eslint-plugin-react: '>=7.22.0'
- eslint-plugin-react-hooks: '>=4.2.0'
- dependencies:
- eslint-plugin-react: 7.26.1
- eslint-plugin-react-hooks: 4.3.0
- dev: false
-
/eslint-config-xo-react/0.25.0_3db5edbe424418fb7f5383c8a5845c49:
resolution: {integrity: sha512-YpABFxnoATAYtxsZQChZEbOkWqzCtcQDRdiUqHhLgG7hzbAEzPDmsRUWnTP8oTVLVFWrbgdf913b8kQJaR1cBA==}
engines: {node: '>=10'}
@@ -14583,15 +14558,6 @@ packages:
eslint-plugin-react-hooks: [email protected]
dev: true
- /eslint-config-xo/0.35.0:
- resolution: {integrity: sha512-+WyZTLWUJlvExFrBU/Ldw8AB/S0d3x+26JQdBWbcqig2ZaWh0zinYcHok+ET4IoPaEcRRf3FE9kjItNVjBwnAg==}
- engines: {node: '>=10'}
- peerDependencies:
- eslint: '>=7.20.0'
- dependencies:
- confusing-browser-globals: 1.0.10
- dev: false
-
/eslint-config-xo/[email protected]:
resolution: {integrity: sha512-QX+ZnQgzy/UtgF8dksIiIBzpYoEKmiL0CmZ8O0Gnby7rGXg8Cny1CXirmHp1zKYIpO7BuTmtWj8eUYOsGr0IGQ==}
engines: {node: '>=10'}
@@ -14730,8 +14696,8 @@ packages:
dependencies:
eslint: 8.13.0
- /eslint-plugin-react-hooks/4.3.0:
- resolution: {integrity: sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA==}
+ /eslint-plugin-react-hooks/4.4.0:
+ resolution: {integrity: sha512-U3RVIfdzJaeKDQKEJbz5p3NW8/L80PCATJAfuojwbaEL+gBjfGdhUcGde+WGUW46Q5sr/NgxevsIiDtNXrvZaQ==}
engines: {node: '>=10'}
peerDependencies:
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0
@@ -14753,7 +14719,7 @@ packages:
dependencies:
eslint: 8.13.0
- /eslint-plugin-react/7.26.1:
+ /eslint-plugin-react/[email protected]:
resolution: {integrity: sha512-Lug0+NOFXeOE+ORZ5pbsh6mSKjBKXDXItUD2sQoT+5Yl0eoT82DqnXeTMfUare4QVCn9QwXbfzO/dBLjLXwVjQ==}
engines: {node: '>=4'}
peerDependencies:
@@ -14762,6 +14728,7 @@ packages:
array-includes: 3.1.4
array.prototype.flatmap: 1.2.5
doctrine: 2.1.0
+ eslint: 7.32.0
estraverse: 5.2.0
jsx-ast-utils: 3.2.1
minimatch: 3.0.4
@@ -14775,7 +14742,7 @@ packages:
string.prototype.matchall: 4.0.6
dev: false
- /eslint-plugin-react/[email protected]:
+ /eslint-plugin-react/[email protected]:
resolution: {integrity: sha512-Lug0+NOFXeOE+ORZ5pbsh6mSKjBKXDXItUD2sQoT+5Yl0eoT82DqnXeTMfUare4QVCn9QwXbfzO/dBLjLXwVjQ==}
engines: {node: '>=4'}
peerDependencies:
@@ -14784,7 +14751,7 @@ packages:
array-includes: 3.1.4
array.prototype.flatmap: 1.2.5
doctrine: 2.1.0
- eslint: 7.32.0
+ eslint: 8.13.0
estraverse: 5.2.0
jsx-ast-utils: 3.2.1
minimatch: 3.0.4
@@ -14796,29 +14763,28 @@ packages:
resolve: 2.0.0-next.3
semver: 6.3.0
string.prototype.matchall: 4.0.6
- dev: false
- /eslint-plugin-react/[email protected]:
- resolution: {integrity: sha512-Lug0+NOFXeOE+ORZ5pbsh6mSKjBKXDXItUD2sQoT+5Yl0eoT82DqnXeTMfUare4QVCn9QwXbfzO/dBLjLXwVjQ==}
+ /eslint-plugin-react/7.29.4:
+ resolution: {integrity: sha512-CVCXajliVh509PcZYRFyu/BoUEz452+jtQJq2b3Bae4v3xBUWPLCmtmBM+ZinG4MzwmxJgJ2M5rMqhqLVn7MtQ==}
engines: {node: '>=4'}
peerDependencies:
- eslint: ^3 || ^4 || ^5 || ^6 || ^7
+ eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8
dependencies:
array-includes: 3.1.4
array.prototype.flatmap: 1.2.5
doctrine: 2.1.0
- eslint: 8.13.0
- estraverse: 5.2.0
+ estraverse: 5.3.0
jsx-ast-utils: 3.2.1
- minimatch: 3.0.4
+ minimatch: 3.1.2
object.entries: 1.1.5
object.fromentries: 2.0.5
object.hasown: 1.1.0
object.values: 1.1.5
- prop-types: 15.7.2
+ prop-types: 15.8.1
resolve: 2.0.0-next.3
semver: 6.3.0
string.prototype.matchall: 4.0.6
+ dev: false
/eslint-plugin-react/[email protected]:
resolution: {integrity: sha512-CVCXajliVh509PcZYRFyu/BoUEz452+jtQJq2b3Bae4v3xBUWPLCmtmBM+ZinG4MzwmxJgJ2M5rMqhqLVn7MtQ==}
@@ -15087,7 +15053,6 @@ packages:
/estraverse/5.3.0:
resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
engines: {node: '>=4.0'}
- dev: true
/estree-walker/0.6.1:
resolution: {integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==}
@@ -19638,7 +19603,6 @@ packages:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
dependencies:
brace-expansion: 1.1.11
- dev: true
/minimist-options/4.1.0:
resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==}