vercel / vercel/next-learn

Update TypeScript Target to ES2017 for Top-Level Await Support

Open
#571 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.8k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

Description

This update changes the TypeScript compilation target from es5 to es2017 in the tsconfig.json file. The primary motivation for this change is to enable the use of top-level await in the project, which is not supported under the es5 target.

Benefits

  • Top-Level Await: Allows for more concise and readable asynchronous code at the top level, without wrapping it inside an async function.
  • Modern Features: Aligns the project with modern JavaScript features, improving compatibility with recent developments in the JavaScript ecosystem.

Impact

  • This change requires the environment where the code runs to support ECMAScript 2017 or later. Given the current state of JavaScript runtimes and browsers, this is a reasonable expectation.

Testing

  • Ensure that the project builds correctly with the new target.
  • Test key functionalities to confirm that no regressions are introduced by this change.

Additional Context

  • This change was prompted by encountering issues with using top-level await in the project, which led to TypeScript compiler errors under the es5 target.

Thank you for considering this update. It will make the project more flexible and maintain its compatibility with modern JavaScript standards.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Update the TypeScript compilation target in tsconfig.json from es5 to es2017. Start by inspecting that configuration, then build the project and test key functionality to confirm the new target works without regressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.