discourse/spec
Joffrey JAFFEUX bbddce4d3a
DEV: updates js transpiler to use babel 7 (#10627)
Updates our js transpiler code to use Babel 7.11.6

List of changes in this commit:

- Updates plugins, babel plugins all have a new version which doesn't contain -es2015- anymore
- Drops [transform-es2015-classes](https://babeljs.io/docs/en/babel-plugin-transform-classes) this plugin shouldn't be needed now that we don't support IE
- Drops check-es2015-constants, checking constants is now part of babel and the check-constants plugin is deprecated. As a result the behavior slightly changed, and is now wrapping every const call in a readOnlyError function which would throw if assigned a new value. This explains the modified spec.
- Adds [proposal-optional-chaining](https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining)

```javascript
const obj = {
  foo: {
    bar: {
      baz: 42,
    },
  },
};

const baz = obj?.foo?.bar?.baz; // 42
```

- Adds [proposal-json-strings](https://babeljs.io/docs/en/babel-plugin-proposal-json-strings)

```javascript
// IN
const ex = "before
after";
//                ^ There's a U+2028 char between 'before' and 'after'


// OUT
const ex = "before\u2028after";
//                ^ There's a U+2028 char between 'before' and 'after'
```

- Adds [proposal-nullish-coalescing-operator](https://babeljs.io/docs/en/babel-plugin-proposal-nullish-coalescing-operator)

```javascript
var object = {};
var foo = object.foo ?? "default"; // default
```

- Adds [proposal-logical-assignment-operators](https://babeljs.io/docs/en/babel-plugin-proposal-logical-assignment-operators)

```javascript
let a;
let b = 2;
a ||= b; // 2
```

- Adds [proposal-numeric-separator](https://babeljs.io/docs/en/babel-plugin-proposal-numeric-separator)

```javascript
let budget = 1_000_000_000_000;
console.log(budget === 10 ** 12); // true
```

- Adds proposal-object-rest-spread https://babeljs.io/docs/en/babel-plugin-proposal-object-rest-spread

```javascript
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
console.log(x); // 1
console.log(y); // 2
console.log(z); // { a: 3, b: 4 }
```

- Adds proposal-optional-catch-binding https://babeljs.io/docs/en/babel-plugin-proposal-optional-catch-binding

```javascript
try {

} catch {

} finally {
  // ensures finally is available in every browsers
}
```

- Adds improved regex support for firefox through (transform-dotall-regex](https://babeljs.io/docs/en/next/babel-plugin-transform-dotall-regex.html) and (proposal-unicode-property-regex](https://babeljs.io/docs/en/babel-plugin-proposal-unicode-property-regex)

- Drops async/generator stuff, the browser we target should allow to use this (excepts iterable async)
2020-09-15 09:26:33 +02:00
..
components DEV: Add include_pms option to TopicQuery (#10647) 2020-09-14 12:07:35 +01:00
fabricators DEV: Add include_pms option to TopicQuery (#10647) 2020-09-14 12:07:35 +01:00
fixtures SECURITY: return error on oversized images 2020-09-14 10:45:11 +10:00
helpers Fix the build. 2020-09-09 15:43:38 +08:00
import_export FEATURE: Rake task to export groups (#9450) 2020-04-17 14:59:54 -07:00
initializers FIX: We need to skip users with associated reviewables when auto-approving (#9080) 2020-03-02 14:33:52 -05:00
integration FIX: Pluralized translation overrides didn't work for en_US 2020-08-29 00:11:46 +02:00
integrity DEV: Check English locale for errors in CI 2020-06-03 21:54:58 +02:00
jobs FEATURE: Remove user topic timers and migrate to bookmarks with reminders (#10474) 2020-09-14 11:11:55 +10:00
lib FEATURE: allow to extend topic_eager_loads in Search (#10625) 2020-09-14 11:58:28 +10:00
mailers FEATURE: Allow email image embed with secure media (#10563) 2020-09-10 09:50:16 +10:00
models DEV: updates js transpiler to use babel 7 (#10627) 2020-09-15 09:26:33 +02:00
multisite FIX: invalid urls should not break store.has_been_uploaded? 2020-06-25 15:00:15 +10:00
requests FIX: TopicQuery.list_private_messages_unread ignore notification level 2020-09-15 13:33:11 +08:00
script/import_scripts FIX: improve Vanilla importing (#10478) 2020-08-24 16:19:57 -04:00
serializers SECURITY: Mod should not see group_users and second_factor_enabled. 2020-09-11 10:23:35 +08:00
services DEV: remove stubs from silencer spec 2020-09-14 11:48:48 +10:00
support DEV: Improve docs for Sidekiq job assertion helpers. 2020-07-24 17:37:22 +08:00
tasks FEATURE: Add uploads:batch_migrate_from_s3 task to limit total posts migrated at once (#9933) 2020-06-04 09:48:11 +10:00
views/omniauth_callbacks FEATURE: Use full page redirection for all external auth methods (#8092) 2019-10-08 12:10:43 +01:00
rails_helper.rb FIX: SiteSettings::LocalProcessProvider didn't work on multisite 2020-08-20 11:15:20 +02:00
swagger_helper.rb DEV: Add rswag to aid in api documention (#9546) 2020-04-27 16:40:07 -06:00