浏览代码

Reverted class properties adoption. Fixed Safari support.

Mr.doob 4 年之前
父节点
当前提交
e7ba1550cd
共有 5 个文件被更改,包括 19 次插入56 次删除
  1. 0 21
      .babelrc.json
  2. 0 29
      package-lock.json
  3. 0 2
      package.json
  4. 3 3
      src/textures/Texture.js
  5. 16 1
      utils/build/rollup.config.js

+ 0 - 21
.babelrc.json

@@ -1,21 +0,0 @@
-{
-  "presets": [
-    [
-      "@babel/preset-env",
-      {
-        "modules": false,
-        "targets": ">0.3%, not dead",
-        "loose": true,
-        "bugfixes": true
-      }
-    ]
-  ],
-  "plugins": [
-    [
-      "@babel/plugin-proposal-class-properties",
-      {
-        "loose": true
-      }
-    ]
-  ]
-}

+ 0 - 29
package-lock.json

@@ -76,25 +76,6 @@
         }
         }
       }
       }
     },
     },
-    "@babel/eslint-parser": {
-      "version": "7.12.16",
-      "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.12.16.tgz",
-      "integrity": "sha512-NZHtJr2pLRYcQjvo/GVU3kFxIGEHveswoWfY5Wm2tJ7pb3AoqoQ+PP17rRTDh+POFWM15VvH+23x2/9Od0CYxQ==",
-      "dev": true,
-      "requires": {
-        "eslint-scope": "5.1.0",
-        "eslint-visitor-keys": "^1.3.0",
-        "semver": "^6.3.0"
-      },
-      "dependencies": {
-        "semver": {
-          "version": "6.3.0",
-          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
-          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
-          "dev": true
-        }
-      }
-    },
     "@babel/generator": {
     "@babel/generator": {
       "version": "7.12.15",
       "version": "7.12.15",
       "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.15.tgz",
       "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.15.tgz",
@@ -1956,16 +1937,6 @@
         "htmlparser2": "^5.0.1"
         "htmlparser2": "^5.0.1"
       }
       }
     },
     },
-    "eslint-scope": {
-      "version": "5.1.0",
-      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz",
-      "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==",
-      "dev": true,
-      "requires": {
-        "esrecurse": "^4.1.0",
-        "estraverse": "^4.1.1"
-      }
-    },
     "eslint-utils": {
     "eslint-utils": {
       "version": "2.1.0",
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
       "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",

+ 0 - 2
package.json

@@ -27,7 +27,6 @@
     "test": "test"
     "test": "test"
   },
   },
   "eslintConfig": {
   "eslintConfig": {
-    "parser": "@babel/eslint-parser",
     "root": true,
     "root": true,
     "extends": "mdcs",
     "extends": "mdcs",
     "plugins": [
     "plugins": [
@@ -85,7 +84,6 @@
   "homepage": "https://threejs.org/",
   "homepage": "https://threejs.org/",
   "devDependencies": {
   "devDependencies": {
     "@babel/core": "^7.12.16",
     "@babel/core": "^7.12.16",
-    "@babel/eslint-parser": "^7.12.16",
     "@babel/plugin-proposal-class-properties": "^7.12.13",
     "@babel/plugin-proposal-class-properties": "^7.12.13",
     "@babel/preset-env": "^7.12.16",
     "@babel/preset-env": "^7.12.16",
     "@rollup/plugin-babel": "^5.3.0",
     "@rollup/plugin-babel": "^5.3.0",

+ 3 - 3
src/textures/Texture.js

@@ -19,9 +19,6 @@ let textureId = 0;
 
 
 class Texture extends EventDispatcher {
 class Texture extends EventDispatcher {
 
 
-	static DEFAULT_IMAGE = undefined;
-	static DEFAULT_MAPPING = UVMapping;
-
 	constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {
 	constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {
 
 
 		super();
 		super();
@@ -330,6 +327,9 @@ class Texture extends EventDispatcher {
 
 
 }
 }
 
 
+Texture.DEFAULT_IMAGE = undefined;
+Texture.DEFAULT_MAPPING = UVMapping;
+
 Texture.prototype.isTexture = true;
 Texture.prototype.isTexture = true;
 
 
 function serializeImage( image ) {
 function serializeImage( image ) {

+ 16 - 1
utils/build/rollup.config.js

@@ -1,7 +1,6 @@
 import babel from '@rollup/plugin-babel';
 import babel from '@rollup/plugin-babel';
 import { nodeResolve } from '@rollup/plugin-node-resolve';
 import { nodeResolve } from '@rollup/plugin-node-resolve';
 import { terser } from 'rollup-plugin-terser';
 import { terser } from 'rollup-plugin-terser';
-import babelrc from '../../.babelrc.json';
 
 
 function glconstants() {
 function glconstants() {
 
 
@@ -290,6 +289,22 @@ function polyfills() {
 
 
 }
 }
 
 
+const babelrc = {
+	presets: [
+		[
+			'@babel/preset-env',
+			{
+				modules: false,
+				// the supported browsers of the three.js browser bundle
+				// https://browsersl.ist/?q=%3E0.3%25%2C+not+dead
+				targets: '>0.3%, not dead',
+				loose: true,
+				bugfixes: true,
+			}
+		]
+	]
+};
+
 export default [
 export default [
 	{
 	{
 		input: 'src/Three.js',
 		input: 'src/Three.js',