Impact of IE Discontinuation

Maintained on

> Internet Explorer will be disabled.

How many web engineers rejoiced at this one sentence?

Even after Chrome surpassed IE in market share and Edge switched to the Chromium rendering engine, a significant number of IE users remained in Japan.

Many developers struggled to use new convenient features to accommodate these IE users.

The kintone.Promise object was also provided by Cybozu to ensure asynchronous processing works in IE environments.

Furthermore, the internet is filled with both old methods to support IE and new methods that ignore IE, creating a significant barrier for JavaScript beginners.

This article explains the impact of the end of IE support on kintone development and what to keep in mind when writing code from now on.

IE Hasn’t Disappeared Completely

Please use Microsoft Edge with “Internet Explorer mode (IE mode)” to directly access traditional Internet Explorer-based websites and applications.

Microsoft ended support for the Internet Explorer 11 desktop application on some versions of Windows 10 on June 15, 2022, and IE was disabled through later updates.

However, Microsoft Edge’s IE mode still lets you open legacy sites built for IE.

IE mode is a compatibility feature for sites that require IE, such as internal systems. There is little reason to use a customized kintone through IE mode, so you can generally stop writing code to accommodate IE.

Impact on kintone development

Due to its nature, kintone executes uploaded JavaScript as-is without any compilation, so unless you transpile it in a development environment like Node.js, you had to consider IE during the coding stage.

If you can exclude IE, this is no longer necessary. Supported browsers change over time, so check kintone’s system requirements for the current list.

As long as different browsers have different rendering engines, the term “cross-browser compatibility” will remain, but it won’t be as costly as “IE and everything else.”

Now, let’s look at how to write code from here on.

Do not use var

var is a very flexible variable declaration.

Due to hoisting, a variable can be referenced before its declaration (it is undefined), and it can be redeclared without errors. It is also function-scoped rather than block-scoped.

This behavior can easily cause unintended bugs.

For those learning JavaScript from now on, “there is no var in variable definitions” will not cause any issues.

You should use let and const instead of var.

Furthermore, almost all variable definitions should be replaceable with const.

use_const_only
kintone.events.on('app.record.detail.show', (event) => {
  for (const [code, field] of Object.entries(event.record)) {
    console.log(`The content of field code ${code} is`, field.value);
  }
  return event;
});

Use async/await for Asynchronous Processing

Method chaining with .then() reduces readability as the processing grows longer. It is also inconvenient that errors in asynchronous code cannot be handled with try-catch.

With async/await, you can write asynchronous code like synchronous code, and both parallel processing with Promise.all and error handling with try-catch become easy.

use_async/await
kintone.events.on('...', async (event) => {
  try {
    const [clientRecords, departmentRecords] = await Promise.all([
      kintone.api(/* ... */),
      kintone.api(/* ... */),
    ]);
  } catch (error) {
    console.error(error);
  }
  return event;
});

Reference: Windows 11 system requirements, features, and device requirements

#JavaScript #kintone