Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build tooling: Remove support for IE11 #31110

Merged
merged 16 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ jobs:
- name: Lint JavaScript and Styles
run: npm run lint

- name: Lint ES5 built files (IE11)
run: npx eslint --parser-options=ecmaVersion:5 --no-eslintrc --no-ignore ./build/**/*.js

- name: Type checking
run: npm run build:package-types

Expand Down
77 changes: 16 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"babel-plugin-react-native-platform-specific-extensions": "1.1.1",
"babel-plugin-transform-remove-console": "6.9.4",
"benchmark": "2.1.4",
"browserslist": "4.15.0",
"browserslist": "4.16.5",
"chalk": "4.0.0",
"commander": "4.1.0",
"concurrently": "3.5.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/babel-preset-default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ module.exports = ( api ) => {
} );

const getPresetEnv = () => {
const opts = {};
const opts = {
include: [ 'proposal-nullish-coalescing-operator' ],
};

if ( isTestEnv ) {
opts.targets = {
Expand Down
70 changes: 13 additions & 57 deletions packages/babel-preset-default/test/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
@@ -1,67 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Babel preset default transpilation works properly 1`] = `
"import _asyncToGenerator from \\"@babel/runtime/helpers/asyncToGenerator\\";
import _awaitAsyncGenerator from \\"@babel/runtime/helpers/awaitAsyncGenerator\\";
import _wrapAsyncGenerator from \\"@babel/runtime/helpers/wrapAsyncGenerator\\";
import _regeneratorRuntime from \\"@babel/runtime/regenerator\\";
describe('Babel preset default', function () {
function foo() {
return _foo.apply(this, arguments);
"describe('Babel preset default', () => {
async function* foo() {
await 1;
yield 2;
}

function _foo() {
_foo = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return _awaitAsyncGenerator(1);

case 2:
_context.next = 4;
return 2;

case 4:
case \\"end\\":
return _context.stop();
}
}
}, _callee);
}));
return _foo.apply(this, arguments);
}

test('support for async generator functions', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
var generator;
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
generator = foo();
_context2.t0 = expect;
_context2.next = 4;
return generator.next();

case 4:
_context2.t1 = _context2.sent;
(0, _context2.t0)(_context2.t1).toEqual({
done: false,
value: 2
});

case 6:
case \\"end\\":
return _context2.stop();
}
}
}, _callee2);
})));
test('support for optional chaining', function () {
test('support for async generator functions', async () => {
const generator = foo();
expect(await generator.next()).toEqual({
done: false,
value: 2
});
});
test('support for optional chaining', () => {
var _obj$foo, _obj$foo2;

var obj = {
const obj = {
foo: {
bar: 42
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function BlockNavigation( {
const _selectedBlockClientId = getSelectedBlockClientId();
const _rootBlocks = __unstableGetClientIdsTree();
const _rootBlock =
selectedBlockClientId && ! isArray( selectedBlockClientId )
_selectedBlockClientId && ! isArray( _selectedBlockClientId )
? __unstableGetClientIdWithClientIdsTree(
getBlockHierarchyRootClientId(
_selectedBlockClientId
Expand Down
1 change: 0 additions & 1 deletion packages/browserslist-config/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// browserslist-config/index.js
module.exports = [
'> 1%',
'ie >= 11',
'last 1 Android versions',
'last 1 ChromeAndroid versions',
'last 2 Chrome versions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export function useResizeLabel( {
* Cached dimension values to check for width/height updates from the
* sizes property from useResizeAware()
*/
const { width, height } = sizes;
const heightRef = useRef( height );
const widthRef = useRef( width );

Expand All @@ -78,8 +79,6 @@ export function useResizeLabel( {
*/
const moveTimeoutRef = useRef();

const { width, height } = sizes;

const unsetMoveXY = () => {
/*
* If axis is controlled, we will avoid resetting the moveX and moveY values.
Expand Down