Răsfoiți Sursa

Merge pull request #2034 from overleaf/as-upgrade-babel

Upgrade babel to v7

GitOrigin-RevId: 1626f0d3343a5cb32a71dba5a8f32657b2d7237c
Alasdair Smith 7 ani în urmă
părinte
comite
48481e431e

+ 2 - 2
services/web/.babelrc

@@ -1,7 +1,7 @@
 {
 {
   "presets": [
   "presets": [
-    "react",
-    ["env", { "modules": false }]
+    "@babel/react",
+    ["@babel/env", { "modules": false }]
   ],
   ],
   "plugins": ["angularjs-annotate"]
   "plugins": ["angularjs-annotate"]
 }
 }

Fișier diff suprimat deoarece este prea mare
+ 2398 - 1827
services/web/package-lock.json


+ 6 - 5
services/web/package.json

@@ -26,6 +26,10 @@
     "format:fix": "prettier-eslint '**/*.js' --write"
     "format:fix": "prettier-eslint '**/*.js' --write"
   },
   },
   "dependencies": {
   "dependencies": {
+    "@babel/cli": "^7.5.5",
+    "@babel/core": "^7.5.5",
+    "@babel/preset-env": "^7.5.5",
+    "@babel/preset-react": "^7.0.0",
     "@overleaf/o-error": "^2.1.0",
     "@overleaf/o-error": "^2.1.0",
     "archiver": "0.9.0",
     "archiver": "0.9.0",
     "async": "0.6.2",
     "async": "0.6.2",
@@ -98,6 +102,7 @@
     "settings-sharelatex": "^1.1.0",
     "settings-sharelatex": "^1.1.0",
     "temp": "^0.8.3",
     "temp": "^0.8.3",
     "underscore": "1.6.0",
     "underscore": "1.6.0",
+    "url-parse": "^1.4.7",
     "uuid": "^3.0.1",
     "uuid": "^3.0.1",
     "v8-profiler-node8": "^6.0.1",
     "v8-profiler-node8": "^6.0.1",
     "valid-url": "^1.0.9",
     "valid-url": "^1.0.9",
@@ -108,12 +113,8 @@
   "devDependencies": {
   "devDependencies": {
     "acorn": "^6.1.0",
     "acorn": "^6.1.0",
     "acorn-walk": "^6.1.1",
     "acorn-walk": "^6.1.1",
-    "babel-cli": "^6.26.0",
-    "babel-core": "^6.26.0",
-    "babel-loader": "^7.1.2",
+    "babel-loader": "^8.0.6",
     "babel-plugin-angularjs-annotate": "^0.10.0",
     "babel-plugin-angularjs-annotate": "^0.10.0",
-    "babel-preset-env": "^1.6.1",
-    "babel-preset-react": "^6.16.0",
     "chai": "3.5.0",
     "chai": "3.5.0",
     "chai-spies": "^1.0.0",
     "chai-spies": "^1.0.0",
     "clean-css-cli": "^4.2.1",
     "clean-css-cli": "^4.2.1",

+ 1 - 18
services/web/public/src/ide/editor/Document.js

@@ -1,12 +1,7 @@
 /* eslint-disable
 /* eslint-disable
     camelcase,
     camelcase,
-    constructor-super,
     handle-callback-err,
     handle-callback-err,
     max-len,
     max-len,
-    no-constant-condition,
-    no-eval,
-    no-return-assign,
-    no-this-before-super,
     no-undef,
     no-undef,
 */
 */
 // TODO: This file was created by bulk-decaffeinate.
 // TODO: This file was created by bulk-decaffeinate.
@@ -73,19 +68,7 @@ define([
       }
       }
 
 
       constructor(ide, doc_id) {
       constructor(ide, doc_id) {
-        {
-          // Hack: trick Babel/TypeScript into allowing this before super.
-          if (false) {
-            super()
-          }
-          let thisFn = (() => {
-            return this
-          }).toString()
-          let thisName = thisFn
-            .slice(thisFn.indexOf('return') + 6 + 1, thisFn.indexOf(';'))
-            .trim()
-          eval(`${thisName} = this;`)
-        }
+        super()
         this.ide = ide
         this.ide = ide
         this.doc_id = doc_id
         this.doc_id = doc_id
         this.connected = this.ide.socket.socket.connected
         this.connected = this.ide.socket.socket.connected

+ 1 - 18
services/web/public/src/ide/editor/ShareJsDoc.js

@@ -1,11 +1,6 @@
 /* eslint-disable
 /* eslint-disable
     camelcase,
     camelcase,
-    constructor-super,
     max-len,
     max-len,
-    no-constant-condition,
-    no-eval,
-    no-return-assign,
-    no-this-before-super,
     no-undef,
     no-undef,
     no-unused-vars,
     no-unused-vars,
 */
 */
@@ -35,21 +30,9 @@ define(['utils/EventEmitter', 'libs/sharejs'], function(EventEmitter, ShareJs) {
         this.prototype.FATAL_OP_TIMEOUT = 30000
         this.prototype.FATAL_OP_TIMEOUT = 30000
       }
       }
       constructor(doc_id, docLines, version, socket) {
       constructor(doc_id, docLines, version, socket) {
+        super()
         // Dencode any binary bits of data
         // Dencode any binary bits of data
         // See http://ecmanaut.blogspot.co.uk/2006/07/encoding-decoding-utf8-in-javascript.html
         // See http://ecmanaut.blogspot.co.uk/2006/07/encoding-decoding-utf8-in-javascript.html
-        {
-          // Hack: trick Babel/TypeScript into allowing this before super.
-          if (false) {
-            super()
-          }
-          let thisFn = (() => {
-            return this
-          }).toString()
-          let thisName = thisFn
-            .slice(thisFn.indexOf('return') + 6 + 1, thisFn.indexOf(';'))
-            .trim()
-          eval(`${thisName} = this;`)
-        }
         this.doc_id = doc_id
         this.doc_id = doc_id
         this.socket = socket
         this.socket = socket
         this.type = 'text'
         this.type = 'text'

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff