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

Translated Static Type Checking #51

Merged
merged 1 commit into from Feb 3, 2020
Merged

Translated Static Type Checking #51

merged 1 commit into from Feb 3, 2020

Conversation

lunmay
Copy link
Contributor

@lunmay lunmay commented Feb 28, 2019

No description provided.

@netlify
Copy link

netlify bot commented Feb 28, 2019

Deploy preview for idreactjs ready!

Built with commit a1a2358

https://deploy-preview-51--idreactjs.netlify.com

@netlify
Copy link

netlify bot commented Feb 28, 2019

Deploy preview for id-reactjs ready!

Built with commit a1a2358

https://deploy-preview-51--id-reactjs.netlify.com

Copy link
Member

@regalius regalius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lunmay , There's several diction that I think can be improved and needs your opinion also about it, after that I think it'll be good to go!


### Adding Flow to a Project {#adding-flow-to-a-project}
### Menambahkan Flow ke Project {#adding-flow-to-a-project}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Menambahkan Flow ke Project {#adding-flow-to-a-project}
### Menambahkan Flow ke Proyek {#adding-flow-to-a-project}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't Menambahkan Flow ke sebuah Proyek sounds better?


Flow extends the JavaScript language with a special syntax for type annotations. However, browsers aren't aware of this syntax, so we need to make sure it doesn't end up in the compiled JavaScript bundle that is sent to the browser.
Flow memperluas bahasa JavaScript dengan sintaksis khusus untuk *type annotation*. Akan tetapi browser tidak mengenal sintaksis ini, jadi kita harus memastikan sintaksis tersebut dihapus dari bundel JavaScript hasil kompilasi yang akan dikirim ke browser.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Flow memperluas bahasa JavaScript dengan sintaksis khusus untuk *type annotation*. Akan tetapi browser tidak mengenal sintaksis ini, jadi kita harus memastikan sintaksis tersebut dihapus dari bundel JavaScript hasil kompilasi yang akan dikirim ke browser.
Flow memperluas bahasa JavaScript dengan sintaksis khusus untuk *type annotation*. Akan tetapi *browser* tidak mengenal sintaksis ini, jadi kita harus memastikan sintaksis tersebut dihapus dari bundel JavaScript hasil kompilasi yang akan dikirim ke *browser*.


#### Create React App {#create-react-app}
#### *Create React App* {#create-react-app}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create React App in this context is the name of the tool so we don't have to italicize it I think, also loanwords in heading doesn't have to be italicized 😄


There is also [an option](https://flow.org/en/docs/config/options/#toc-all-boolean) to force Flow to check *all* files regardless of the annotation. This can be too noisy for existing projects, but is reasonable for a new project if you want to fully type it with Flow.
Tersedia juga [sebuah *opsi*](https://flow.org/en/docs/config/options/#toc-all-boolean) untuk memaksa Flow untuk mengecek *semua* *file* tanpa melihat adanya anotasi. Ini bisa berakibat terlalu "ramai" untuk proyek yang sudah ada, tetapi cukup bagi proyek baru jika Anda ingin menggunakan Flow secara lengkap.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tersedia juga [sebuah *opsi*](https://flow.org/en/docs/config/options/#toc-all-boolean) untuk memaksa Flow untuk mengecek *semua* *file* tanpa melihat adanya anotasi. Ini bisa berakibat terlalu "ramai" untuk proyek yang sudah ada, tetapi cukup bagi proyek baru jika Anda ingin menggunakan Flow secara lengkap.
Tersedia juga [sebuah *opsi*](https://flow.org/en/docs/config/options/#toc-all-boolean) untuk memaksa Flow untuk mengecek *semua* berkas tanpa melihat adanya anotasi. Ini akan terasa terlalu "ramai" untuk proyek yang sudah ada, tetapi cukup masuk akal bagi proyek baru jika Anda ingin menggunakan Flow secara lengkap.

What do you think? 😄

### Configuring the TypeScript Compiler {#configuring-the-typescript-compiler}
The compiler is of no help to us until we tell it what to do. In TypeScript, these rules are defined in a special file called `tsconfig.json`. To generate this file:
### Mengonfigurasi Kompiler TypeScript {#configuring-the-typescript-compiler}
Kompiler tidak akan membantu kita hingga kita memberi tahu apa yang harus kompiler lakukan. Pada TypeScript, aturan ini didefinisikan pada *file* khusus yang diberi nama `tsconfig.json`. Untuk membuat *file* ini:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Kompiler tidak akan membantu kita hingga kita memberi tahu apa yang harus kompiler lakukan. Pada TypeScript, aturan ini didefinisikan pada *file* khusus yang diberi nama `tsconfig.json`. Untuk membuat *file* ini:
Kompiler tidak akan membantu kita hingga kita memberi tahu apa yang harus kompiler lakukan. Pada TypeScript, aturan ini didefinisikan pada berkas khusus yang diberi nama `tsconfig.json`. Untuk membuat berkas ini:


Of the many options, we'll look at `rootDir` and `outDir`. In its true fashion, the compiler will take in typescript files and generate javascript files. However we don't want to get confused with our source files and the generated output.
Dari sekian banyak opsi, mari kita lihat opsi `rootDir` dan `outDir`. Awalnya, kompiler akan mengambil *file* TypeScript dan menciptakan *file* JavaScript. Akan tetapi kita tidak ingin mencampur aduk *file* sumber dengan *file* keluaran yang diciptakan..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Dari sekian banyak opsi, mari kita lihat opsi `rootDir` dan `outDir`. Awalnya, kompiler akan mengambil *file* TypeScript dan menciptakan *file* JavaScript. Akan tetapi kita tidak ingin mencampur aduk *file* sumber dengan *file* keluaran yang diciptakan..
Dari sekian banyak opsi, mari kita lihat opsi `rootDir` dan `outDir`. Awalnya, kompiler akan mengambil berkas TypeScript dan menciptakan berkas JavaScript. Akan tetapi kita tidak ingin mencampur aduk berkas sumber dengan berkas keluaran yang diciptakan..

@@ -259,40 +259,41 @@ We'll address this in two steps:
}
```

Great! Now when we run our build script the compiler will output the generated javascript to the `build` folder. The [TypeScript React Starter](https://github.com/Microsoft/TypeScript-React-Starter/blob/master/tsconfig.json) provides a `tsconfig.json` with a good set of rules to get you started.
Kini, jika kita menjalankan skrip *build*, maka kompiler akan menghasilkan kode JavaScript ke *folder* `build`. [TypeScript React Starter](https://github.com/Microsoft/TypeScript-React-Starter/blob/master/tsconfig.json) menyediakan `tsconfig.json` dengan sekumpulan aturan yang layak bagi Anda untuk memulai.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Kini, jika kita menjalankan skrip *build*, maka kompiler akan menghasilkan kode JavaScript ke *folder* `build`. [TypeScript React Starter](https://github.com/Microsoft/TypeScript-React-Starter/blob/master/tsconfig.json) menyediakan `tsconfig.json` dengan sekumpulan aturan yang layak bagi Anda untuk memulai.
Kini, jika kita menjalankan *build script*, maka kompiler akan menghasilkan kode JavaScript di *folder* `build`. [TypeScript React Starter](https://github.com/Microsoft/TypeScript-React-Starter/blob/master/tsconfig.json) menyediakan `tsconfig.json` dengan sekumpulan aturan yang cukup bagi Anda untuk memulai.

What do you think? 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kompiler isn't a translation of compiler. should just use compiler i think

__Local Declarations__
Sometimes the package that you want to use doesn't bundle declarations nor is it available on DefinitelyTyped. In that case, we can have a local declaration file. To do this, create a `declarations.d.ts` file in the root of your source directory. A simple declaration could look like this:
__Deklarasi Lokal__
Terkadang *package* yang ingin digunakan tidak memiliki deklarasi terbundel atau tidak tersedia di DefinitelyTyped. Pada kasus ini, kita bisa membuat *file* deklarasi lokal. Untuk melakukannya, buat *file* `declarations.d.ts` pada akar direktori sumber Anda. Deklarasi sederhana tampak sebagai berikut:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Terkadang *package* yang ingin digunakan tidak memiliki deklarasi terbundel atau tidak tersedia di DefinitelyTyped. Pada kasus ini, kita bisa membuat *file* deklarasi lokal. Untuk melakukannya, buat *file* `declarations.d.ts` pada akar direktori sumber Anda. Deklarasi sederhana tampak sebagai berikut:
Terkadang *package* yang ingin digunakan tidak memiliki deklarasi terbundel atau tidak tersedia di DefinitelyTyped. Pada kasus ini, kita bisa membuat berkas deklarasi lokal. Untuk melakukannya, buat berkas `declarations.d.ts` pada akar direktori sumber Anda. Deklarasi sederhana tampak sebagai berikut:

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

Successfully merging this pull request may close these issues.

None yet

4 participants