Skip to content

Commit 2e670c4

Browse files
ibnuhmazipan
authored andcommitted
Terjemahan Bahasa Indonesia untuk debugging-in-vscode (vuejs#165)
* Terjemahan Bahasa Indonesia untuk debugging-in-vscode.md (vuejs#143) * Update title
1 parent d01886b commit 2e670c4

File tree

1 file changed

+36
-34
lines changed

1 file changed

+36
-34
lines changed
Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
---
2-
title: Debugging in VS Code
2+
title: Debug menggunakan VS Code
33
type: cookbook
44
order: 8
55
---
66

7-
Every application reaches a point where it's necessary to understand failures, small to large. In this recipe, we explore a few workflows for VS Code users who would like to debug their application in the browser.
7+
Setiap aplikasi akan mencapai titik di mana perlu untuk memahami galat, kecil atau besar. Di resep ini, kita mengeksplorasi beberapa alur kerja untuk pengguna VS Code yang ingin men-debug aplikasinya di browser.
88

9-
This recipe shows how to to debug [Vue CLI](https://github.com/vuejs/vue-cli) applications in VS Code as they run in the browser.
9+
Resep ini menunjukkan cara untuk men-debug aplikasi [Vue CLI](https://github.com/vuejs/vue-cli) di VS Code saat dijalankan di browser.
1010

11-
<p class="tip">Note: This recipe covers Chrome and Firefox. If you know how to setup VS Code debugging with other browsers, please consider sharing your insights (see bottom of the page).</p>
11+
<p class="tip">Catatan: Resep ini mencakup peramban Chrome dan Firefox. Jika anda tahu cara mengatur <i>debugger</i> VS Code untuk bekerja diperamban lain, silahkan pertimbangkan untuk berbagi (lihat bagian bawah halaman)</p>
1212

13-
## Prerequisites
13+
## Prasyarat
1414

15-
Make sure you have VS Code and the browser of your choice installed, and the latest version of the corresponding Debugger extension installed and enabled:
15+
Pastikan anda sudah menginstal VS Code dan peramban pilihan anda, juga ekstensi _debugger_-nya sudah dipasang dan diaktifkan.
1616

17-
* [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
18-
* [Debugger for Firefox](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-firefox-debug)
17+
- [_Debugger_ untuk Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
18+
- [_Debugger_ untuk Firefox](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-firefox-debug)
1919

20-
Install and create a project with the [vue-cli](https://github.com/vuejs/vue-cli), following the instructions in the [Vue CLI Guide](https://cli.vuejs.org/). Change into the newly created application directory and open VS Code.
20+
Pasang dan buat proyek dengan [vue-cli](https://github.com/vuejs/vue-cli), ikut instruksi [Panduan Vue CLI](https://cli.vuejs.org/). Lalu masuk ke folder proyek yang baru dibuat dan buka di VS Code.
2121

22-
### Displaying Source Code in the Browser
22+
### Menampilkan kode di Browser
2323

24-
Before you can debug your Vue components from VS Code, you need to update the generated Webpack config to build sourcemaps. We do this so that our debugger has a way to map the code within a compressed file back to its position in the original file. This ensures that you can debug an application even after your assets have been optimized by Webpack.
24+
Sebelum anda bisa mendebug komponen Vue dari VS Code, anda harus memperbarui konfigurasi Webpack yang barusan dibuat untuk membangun `sourcemaps`. Kita melakukan ini agar _debugger_ yang dipakai bisa memetakan kode didalam berkas yang terkompresi kembali ke berkas aslinya. Ini memastikan bahwa anda dapat men-debug aplikasi bahkan setelah aset atau kode anda sudah di optimisasi oleh Webpack.
2525

26-
If you use Vue CLI 2, set or update the `devtool` property inside `config/index.js`:
26+
Jika anda menggunakan Vue CLI 2, atur atau ubah properti `devtool` didalam berkas `config/index.js`:
2727

2828
```json
2929
devtool: 'source-map',
3030
```
3131

32-
If you use Vue CLI 3, set or update the `devtool` property inside `vue.config.js`:
32+
Jika anda menggunakan Vue CLI 3, atur atau ubah properti `devtool` didalam berkas `vue.config.js`:
3333

3434
```js
3535
module.exports = {
@@ -39,11 +39,13 @@ module.exports = {
3939
}
4040
```
4141

42-
### Launching the Application from VS Code
42+
### Menjalankan aplikasi dari VS Code
4343

4444
Click on the Debugging icon in the Activity Bar to bring up the Debug view, then click on the gear icon to configure a launch.json file, selecting **Chrome/Firefox: Launch** as the environment. Replace content of the generated launch.json with the corresponding configuration:
4545

46-
![Add Chrome Configuration](/images/config_add.png)
46+
Klik ikon _debugging_ di _Activity Bar_ VS Code untuk memunculkan tampilan Debug, lalu klik pada ikon roda gigi untuk mengonfigurasi berkas `launch.json`, pilih **Chrome/Firefox: _Launch_**
47+
48+
![Menambahkan konfigurasi Chrome](/images/config_add.png)
4749

4850
```json
4951
{
@@ -72,37 +74,37 @@ Click on the Debugging icon in the Activity Bar to bring up the Debug view, then
7274
}
7375
```
7476

75-
## Setting a Breakpoint
77+
## Mengatur _Breakpoint_
7678

77-
1. Set a breakpoint in **src/components/HelloWorld.vue** on `line 90` where the `data` function returns a string.
79+
1. Atur _breakpoint_ di **src/components/HelloWorld.vue** pada `baris 90` dimana _function_ `data` mengembalikan untaian.
7880

79-
![Breakpoint Renderer](/images/breakpoint_set.png)
81+
![_Renderer Breakpoint_](/images/breakpoint_set.png)
8082

81-
2. Open your favorite terminal at the root folder and serve the app using Vue CLI:
83+
2. Buka konsol favorit anda di folder utama aplikasi dan sajikan aplikasi menggunakan Vue CLI:
8284

83-
```
84-
npm start
85-
```
85+
```
86+
npm start
87+
```
8688

87-
3. Go to the Debug view, select the **'vuejs: chrome/firefox'** configuration, then press F5 or click the green play button.
89+
3. Buka tampilan Debug, pilih konfigurasi **'vuejs: chrome/firefox'**, lalu tekan F5 atau klik tombol mainkan yang berwarna hijau.
8890

89-
4. Your breakpoint should now be hit as a new browser instance opens `http://localhost:8080`.
91+
4. _Breakpoint_ anda akan terkena ketika peramban anda membuka `http://localhost:8080`.
9092

91-
![Breakpoint Hit](/images/breakpoint_hit.png)
93+
![_Breakpoint_ Yang Terkena](/images/breakpoint_hit.png)
9294

93-
## Alternative Patterns
95+
## Pola Alternatif
9496

95-
### Vue Devtools
97+
### Menggunakan alat pengembang Vue
9698

97-
There are other methods of debugging, varying in complexity. The most popular and simple of which is to use the excellent Vue.js devtools [for Chrome](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) and [for Firefox](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/). Some of the benefits of working with the devtools are that they enable you to live-edit data properties and see the changes reflected immediately. The other major benefit is the ability to do time travel debugging for Vuex.
99+
Ada cara lain untuk men-debug, kompleksitasnya beragam. Yang paling populer dan mudah adalah menggunakan alat pengembang Vue.js (_Vue.js Devtools_) yang bekerja sangat baik, silahkan pasang di peramban pilihan anda: [Chrome](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) atau [Firefox](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/). Beberapa manfaat bekerja dengan alat pengembang adalah memungkinkan anda untuk menyunting langsung properti data dan melihat perubahan yang secara otomatis langsung ditampilkan. Manfaat lain adalah memungkinkan anda untuk melakukan _Time travel debugging_ untuk Vuex.
98100

99-
![Devtools Timetravel Debugger](/images/devtools-timetravel.gif)
101+
![_Time Travel Debugger_ Pada Alat Pengembang](/images/devtools-timetravel.gif)
100102

101-
<p class="tip">Please note that if the page uses a production/minified build of Vue.js (such as the standard link from a CDN), devtools inspection is disabled by default so the Vue pane won't show up. If you switch to an unminified version, you may have to give the page a hard refresh to see them.</p>
103+
<p class="tip">Harap perhatikan bahwa jika halaman menggunakan paket Vue.js yang disusun untuk dijalankan pada aplikasi produksi atau yang sudah di perkecil (seperti menggunakan tautan dari CDN), inspeksi alat pengembang dinonaktifkan secara standar sehingga panel alat pengembang Vue.js tidak akan muncul. Jika anda beralih ke versi yang tidak diperkecil, anda mungkin harus memuat ulang halaman dengan keras, pada peramban Chrome/Firefox, bisa dengan menekan CTRL/CMD+SHIFT+R.</p>
102104

103-
### Simple Debugger Statement
105+
### Kode _Debugger_ Sederhana
104106

105-
The example above has a great workflow. However, there is an alternative option where you can use the [native debugger statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) directly in your code. If you choose to work this way, it's important that you remember to remove the statements when you're done.
107+
Contoh diatas memiliki alur kerja yang bagus. Namun, ada opsi alternatif di mana anda dapat menggunakan [kode _debugger_ bawaan](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) secara langsung. Jika anda memilih untuk bekerja menggunakan cara ini, sangat penting untuk mengingat untuk menghapus kode _debugger_ bawaannya saat anda sudah selesai.
106108

107109
```js
108110
<script>
@@ -121,6 +123,6 @@ export default {
121123
</script>
122124
```
123125

124-
## Acknowledgements
126+
## Ucapan Terima Kasih
125127

126-
This recipe was based on a contribution from [Kenneth Auchenberg](https://twitter.com/auchenberg), [available here](https://github.com/Microsoft/VSCode-recipes/tree/master/vuejs-cli).
128+
Resep ini berdasar pada kontribusi dari [Kenneth Auchenberg](https://twitter.com/auchenberg), [tersedia disini](https://github.com/Microsoft/VSCode-recipes/tree/master/vuejs-cli).

0 commit comments

Comments
 (0)