remap-keys / remap

Keymap Customization Web app for your keyboard.
https://remap-keys.app
Other
220 stars 27 forks source link

Upgrade Typescipt and @typescript-eslint/parser #826

Closed L4Ph closed 2 months ago

L4Ph commented 2 months ago
  1. Viteで推奨されている"moduleResolution": "bundler"が動作しないため、Typescriptをv5へアップグレード
  2. その過程でビルド時に大量に発生するLine 0: Parsing error: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be used. Use 'identifierToKeywordKind(identifier)' insteadというエラーを解消するために@typescript-eslint/parserをv7へアップグレード
yoichiro commented 2 months ago

@L4Ph When executing yarn start to launch the server locally, the server can't be launched with the following error occurs:

Failed to compile.

./node_modules/date-fns/intervalToDuration.mjs
Can't import the named export 'differenceInHours' from non EcmaScript module (only default export is available)
L4Ph commented 2 months ago

Maybe adding the following to webpack.config.js will fix the problem. Should I send the branches separately? @yoichiro

// webpack.config.js
// module.rules
{
  test: /\.mjs$/,
  include: /node_modules/,
  type: 'javascript/auto',
}
yoichiro commented 2 months ago

@L4Ph Thank you for the suggestion. Yes, I know that this issue will be solved when appending the definition into the webpack.config.js file. However, we can't have a webpack.config.js file because we're using the react-scripts currently.

L4Ph commented 2 months ago

@yoichiro Thank you, CRA forgot to mention that Webpack is hidden.

There are two possible approaches:

  1. Use react-app-rewired to patch Webpack
  2. Prioritize Vite's support

To be honest, the first point will cause the response to Vite to be increasingly delayed and there is a possibility that it will "break" the CRA.

yoichiro commented 2 months ago

To be honest, the first point will cause the response to Vite to be increasingly delayed and there is a possibility that it will "break" the CRA.

@L4Ph Yes, I feel same thing actually as well. I think that we need to progress forward to migrate "Webpack" to "Vite". That is, we should take a risk of failure of launching the server locally rather than supporting the Webpack5. Of course, to do that, we need to progress to support "Vite" quickly.

If you agree my proposal, I merge this pull request. How about it?

L4Ph commented 2 months ago

@yoichiro

If that's okay with you, I support that too. I will do my best to support Vite.

yoichiro commented 2 months ago

@L4Ph Thank you for your contributions! I merge this pull request. Move forward to supporting Vite!