From 3b837c6f0683226180f924b82382989eff3518b1 Mon Sep 17 00:00:00 2001 From: Rezmason Date: Fri, 23 May 2025 12:49:10 -0700 Subject: [PATCH] Massive overhaul: the renderers are now classes that implement Renderer; replaced webpack and rollup with vite; converted bundle-contents to "core" and "full" bundle profiles; renamed "inclusions" to "staticAssets", which are "url" base64-encoded images and "raw" text strings; renamed the Matrix component module to the JSX extension; built out a test scaffold at tools/test/index.html to manually test the various deploy options. --- .babelrc | 6 - TODO.txt | 13 +- eslint.config.js | 31 + index.html | 16 +- js/{Matrix.js => Matrix.jsx} | 100 +- js/bundle-contents.js | 5 - js/bundles/core.js | 6 + js/bundles/full.js | 6 + js/fetchLibraries.js | 8 +- js/inclusions.js | 74 - js/main.js | 27 +- js/regl/main.js | 170 - js/regl/renderer.js | 139 + js/regl/utils.js | 12 +- js/renderer.js | 92 + js/staticAssets.js | 77 + js/utils/config.js | 7 +- js/webgpu/main.js | 217 - js/webgpu/renderer.js | 178 + js/webgpu/utils.js | 14 +- package-lock.json | 7767 +++++----------------- package.json | 47 +- prettier_command.txt | 1 - public/index.html | 11 - rollup.config.mjs | 72 - tools/dev.config.js | 9 + tools/test/index.html | 48 + js/index.js => tools/test/test-react.jsx | 42 +- webpack.config.js | 61 - 29 files changed, 2338 insertions(+), 6918 deletions(-) delete mode 100644 .babelrc create mode 100644 eslint.config.js rename js/{Matrix.js => Matrix.jsx} (70%) delete mode 100644 js/bundle-contents.js create mode 100644 js/bundles/core.js create mode 100644 js/bundles/full.js delete mode 100644 js/inclusions.js delete mode 100644 js/regl/main.js create mode 100644 js/regl/renderer.js create mode 100644 js/renderer.js create mode 100644 js/staticAssets.js delete mode 100644 js/webgpu/main.js create mode 100644 js/webgpu/renderer.js delete mode 100644 prettier_command.txt delete mode 100644 public/index.html delete mode 100644 rollup.config.mjs create mode 100644 tools/dev.config.js create mode 100644 tools/test/index.html rename js/index.js => tools/test/test-react.jsx (74%) delete mode 100644 webpack.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index de8ffde..0000000 --- a/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": [ - "@babel/preset-env", - "@babel/preset-react" - ] -} \ No newline at end of file diff --git a/TODO.txt b/TODO.txt index 19679d7..29ef061 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,8 +1,11 @@ TODO: - Make sure component works right - bundled, of course - webpack? + WebGPU formulate is expensive + Mirror pass clicks bug + + Minify bundles + Naming "matrix" for the github repo, "digital-rain" and "DigitalRain" for everything else Minimum react requirement? + Retire fetchLibraries? Move off of regl Unify implementations? Responsive changes @@ -14,10 +17,10 @@ TODO: return boolean of whether all deltas are simple Resource changes are simple if they're cached and loaded, false otherwise remake the pipeline if anything returns false - Create multiple distributions + Core vs full core One embedded MSDF, combined from the two main glyph sets and their configs - fun + full Other MSDFs and configs and then one with built-in MSDF generation (TTF + glyphString) --> MSDF diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..c957a61 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,31 @@ +import js from "@eslint/js"; +import globals from "globals"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; + +export default [ + { ignores: ["dist", "lib"] }, + { + files: ["**/*.{js,jsx,mjs}"], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + parserOptions: { + ecmaVersion: "latest", + ecmaFeatures: { jsx: true }, + sourceType: "module", + }, + }, + plugins: { + "react-hooks": reactHooks, + "react-refresh": reactRefresh, + }, + rules: { + ...js.configs.recommended.rules, + ...reactHooks.configs.recommended.rules, + "no-unused-vars": "off", + "no-unused-labels": "off", + "react-refresh/only-export-components": ["warn", { allowConstantExport: true }], + }, + }, +]; diff --git a/index.html b/index.html index 6a365b6..8fb440c 100644 --- a/index.html +++ b/index.html @@ -5,19 +5,27 @@ - +