-
Notifications
You must be signed in to change notification settings - Fork 265
Translated Static Type Checking #51
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
Conversation
Deploy preview for idreactjs ready! Built with commit a1a2358 |
Deploy preview for id-reactjs ready! Built with commit a1a2358 |
There was a problem hiding this 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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Menambahkan Flow ke Project {#adding-flow-to-a-project} | |
### Menambahkan Flow ke Proyek {#adding-flow-to-a-project} |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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} |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? 😄
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
No description provided.