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

Fix mistranslated sentence #151

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Conversation

warmwhiten
Copy link
Contributor

@warmwhiten warmwhiten commented May 26, 2022

안녕하세요, 잘못 번역된 부분이 있는 것 같아 수정했습니다. 리뷰 부탁드립니다.

docs/documentation/ko/tutorials/Babel with TypeScript.md

AS-IS : 프레임워크를 사용하여 프로젝트를 만들고 있다면 결정은 여러분 손에 달려있습니다.
TO-BE: 프레임워크를 사용하여 프로젝트를 만들고 있다면 이 결정은 여러분을 위해 자동으로 처리됩니다.

@github-actions
Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @bumkeyy, @yeonjuan, @guyeol, and @dvlprsh - if they write a comment saying "LGTM" then it will be merged.

@github-actions
Copy link
Contributor

Translation of Babel with TypeScript.md

title: Using Babel with TypeScript
layout: docs
permalink: /ko/docs/handbook/babel-with-typescript.html
oneline: How to create a hybrid Babel + TypeScript project

translatable: true

Babel vs TypeScript tsc

When you create a modern JavaScript project, you might be thinking about the correct way to convert from TypeScript to JavaScript files.

In many cases the answer depends on the project "Depends on" or "Someone may have decided on your behalf' will be. What if tsdx, Angular, NestJSor an existing framework such as Getting StartedIf you are creating a project using the framework mentioned in , this decision will be handled automatically for you.

However, here's an intuitive way to use:

  • Are the build output results and source input files pretty much the same? tscUse .
  • Do you need a build pipeline that produces multiple potential deliverables? babelTranspiling with , tscCheck the type with .

Transpiling is Babel, the type is tsc

This is a common pattern for projects with existing build infrastructure that may have been ported from the JavaScript code base to TypeScript.

This technique, by Babel preset-typescriptto generate a JS file, and then use TypeScript to check for type and .d.ts This is a compound approach to generating files.

Because Babel supports TypeScript, you can work with existing build pipelines and JS output times can be faster because Babel doesn't inspect code types.

Type checking and d.ts file generation

The downside of using Babel is that you can't do type checking while switching TS to JS. This means that type errors that you don't catch in the editor may be included in your production code.

Also, Babel for TypeScript .d.ts Because you can't create files, it can be harder to work with if your project is a library.

To resolve these issues, we recommend that you set up a command that allows you to use TSC to check the type of the project. This is part of the Babel configuration. tsconfig.jsonThis means replicating to and verifying that the following flags are enabled:

"compilerOptions": {
  // tsc를 사용해 .js 파일이 아닌 .d.ts 파일이 생성되었는지 확인합니다.
  "declaration": true,
  "emitDeclarationOnly": true,
  // Babel이 TypeScript 프로젝트의 파일을 안전하게 트랜스파일할 수 있는지 확인합니다.
  "isolatedModules": true
}

For more information on these flags, please refer to the following:

Generated by 🚫 dangerJS against 64c040d

@dvlprsh
Copy link
Contributor

dvlprsh commented Sep 27, 2022

LGTM

@github-actions github-actions bot merged commit 7b48c07 into microsoft:main Sep 27, 2022
@github-actions
Copy link
Contributor

Merging because @dvlprsh is a code-owner of all the changes - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants