diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 2ef2464d..00000000 --- a/.eslintignore +++ /dev/null @@ -1,14 +0,0 @@ -node_modules -.DS_store -.idea -docs -dist -dist-cfg -dist-vitest -examples/dist-tsc -build -releases -.tmp -.env -scripts -vitest.config.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 806fb273..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,55 +0,0 @@ -/* eslint-env node */ -const config = { - root: true, - env: { - browser: true, - es2021: true, - }, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - 'prettier', - ], - parserOptions: { - /** - * Required for eslint to work in our Reference based TypeScript project - * https://github.com/typescript-eslint/typescript-eslint/issues/2094#issuecomment-1564608505 - */ - EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true, - project: [ - './tsconfig.json', - './tsconfig.vitest.json', - './tsconfig.cfg.json', - './examples/tsconfig.json', - './visual-regression/tsconfig.json', - './performance/tsconfig.json', - ], - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - tsconfigRootDir: __dirname, - }, - rules: { - // Allow us to write async functions that don't use await - // Intresting commentary on this: https://github.com/standard/eslint-config-standard-with-typescript/issues/217 - '@typescript-eslint/require-await': 'off', - // Temporary relaxed rules while we tighten up our TypeScript code - // TODO: Remove these rules once we eliminate all of the unnecessary `any` types in the code - '@typescript-eslint/no-unsafe-argument': 'warn', - '@typescript-eslint/no-unsafe-assignment': 'warn', - '@typescript-eslint/no-unsafe-return': 'warn', - '@typescript-eslint/no-unsafe-call': 'warn', - '@typescript-eslint/no-non-null-assertion': 'warn', - '@typescript-eslint/no-unsafe-member-access': 'warn', - '@typescript-eslint/restrict-template-expressions': [ - 'warn', - { - allowNumber: true, - allowBoolean: true, - }, - ], - }, -}; - -module.exports = config; diff --git a/BROWSERS.md b/BROWSERS.md new file mode 100644 index 00000000..9afe3051 --- /dev/null +++ b/BROWSERS.md @@ -0,0 +1,100 @@ +# Browser Support + +LightningJS is designed with legacy devices in mind, ensuring compatibility with a wide variety of browsers. From **Chrome v38**, released in late 2014, to the latest modern browsers, LightningJS provides a reliable and efficient rendering experience. + +## WebGL Compatibility + +LightningJS relies on **WebGL 1.x** (based on OpenGL ES 2.0) or newer for its rendering capabilities. If WebGL 1.x is supported in the browser, LightningJS will run without issues. Here are some key points about our WebGL implementation: + +- **Independent Rendering**: LightningJS is a contained renderer that uses WebGL, giving us full pixel-for-pixel control over the output. +- **No CSS Dependency**: Unlike traditional DOM/CSS rendering, LightningJS avoids reliance on CSS features, extensions, or browser-specific CSS implementations. +- **Consistency**: In our experience, WebGL support is consistent across browsers. Once LightningJS is confirmed to work in a browser, it will deliver uniform output. + +## Supported Browsers and Quirks + +Below is a detailed breakdown of confirmed browsers that work with LightningJS, along with the quirks or features specific to their versions: + +| **Browser** | **Version** | **Quirks / Features** | +| ------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| **Chrome** | v38 | Bottom line for support; introduces Promises. Lacks `createImageBitmap`, iterable `UInt8Array/UInt8ClampedArray`. `ImageData` is mostly broken. | +| | v48 | Adds support for `Blob:` and `Data:` in the Fetch API. | +| | v49 | Introduces Proxies, improving reactive property handling in Blits. Not used in the Renderer. | +| | v50 | Adds `createImageBitmap` (without options object). Enables Image Worker in a web worker. | +| | v52 | Adds `config` for `createImageBitmap`, including support for alpha channel. | +| | v54 | Enables resizing in `createImageBitmap`. | +| | v63 | Adds support for dynamic imports. | +| | v71 | Introduces `globalThis`. | +| **WPEWebKit** | 2017 | Adds support for Image Worker and `createImageBitmap`. | +| | 2.22 | Full support, including Lightning Native mode (disables DOM/CSS compositing except for ``, `