Skip to content

Commit b960e5e

Browse files
authored
import as kısmında kaldım
1 parent 8318c4a commit b960e5e

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

1-js/13-modules/02-import-export/article.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# Export and Import
1+
# Dışa Aktarma ve Dahil Etme
22

3-
Export and import directives are very versatile.
3+
Dışa aktarma ve dahil etme yönergeleri çok yönlüdür.
44

5-
In the previous chapter we saw a simple use, now let's explore more examples.
5+
Önceki bölümde basit bir kullanımı gördük. Şimdi daha fazla örnek keşfedelim.
66

7-
## Export before declarations
7+
## Bildirimler Önce Dışa Aktarım
88

9-
We can label any declaration as exported by placing `export` before it, be it a variable, function or a class.
9+
Bir değişken, fonksyion ya da bir sınıf olsun, herhangi bir bildirimi önce `export` diyerek dışa aktarılmış olarak etiketleyebiliriz.
1010

11-
For instance, here all exports are valid:
11+
Örneğin, buradaki tüm dışa aktarımlar geçerlidir:
1212

1313
```js
14-
// export an array
14+
// Bir diziyi dışarıya atkarma
1515
*!*export*/!* let months = ['Jan', 'Feb', 'Mar','Apr', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
1616

17-
// export a constant
17+
// Bir sabiti dışarıya aktarma
1818
*!*export*/!* const MODULES_BECAME_STANDARD_YEAR = 2015;
1919

20-
// export a class
20+
// Bir sınıfı dışarıya aktarma
2121
*!*export*/!* class User {
2222
constructor(name) {
2323
this.name = name;
@@ -26,25 +26,25 @@ For instance, here all exports are valid:
2626
```
2727

2828
````smart header="No semicolons after export class/function"
29-
Please note that `export` before a class or a function does not make it a [function expression](info:function-expressions-arrows). It's still a function declaration, albeit exported.
29+
Unutmayın ki, bir sınıf veya fonksyiondan önce `export` bir [işlev ifadeleri](info:function-expressions-arrows) yapmaz. Dışarıya aktarılmasına rağmen hala bir işlev bildirgesidir.
3030
31-
Most JavaScript style guides recommend semicolons after statements, but not after function and class declarations.
31+
Javascript stil kılavuzlarının çoğu ifadelerden sonra noktalı birgül önermektedir ama işlev ve sınıf bildirimlerinden sonra değil.
3232
33-
That's why there should be no semicolons at the end of `export class` and `export function`.
33+
Bu nedenle `export class` ve `export function` sonuna noktalı virgül konuşmamalıdır..
3434
3535
```js
3636
export function sayHi(user) {
3737
alert(`Hello, ${user}!`);
38-
} *!* // no ; at the end */!*
38+
} *!* // sonunda ; yok */!*
3939
```
4040
4141
````
4242

43-
## Export apart from declarations
43+
## Bildirimlerden ayrı dışa aktarma
4444

45-
Also, we can put `export` separately.
45+
Ayrıca, `export` ayrı ayrı koyabiliriz.
4646

47-
Here we first declare, and then export:
47+
Burada önce bildirir sonra dışarıya aktarırız:
4848

4949
```js
5050
// 📁 say.js
@@ -57,15 +57,15 @@ function sayBye(user) {
5757
}
5858

5959
*!*
60-
export {sayHi, sayBye}; // a list of exported variables
60+
export {sayHi, sayBye}; // dışa aktarıların değişkenlerin listesi
6161
*/!*
6262
```
6363

64-
...Or, technically we could put `export` above functions as well.
64+
...Veya teknik olarak `export` fonksiyonların üstüne koyabiliriz.
6565

66-
## Import *
66+
## İmport *
6767

68-
Usually, we put a list of what to import into `import {...}`, like this:
68+
Genelde, `import {...}` içine neyin içine aktarılacağını içeren bir liste koyarız, şöyle:
6969

7070
```js
7171
// 📁 main.js
@@ -77,7 +77,7 @@ sayHi('John'); // Hello, John!
7777
sayBye('John'); // Bye, John!
7878
```
7979

80-
But if the list is long, we can import everything as an object using `import * as <obj>`, for instance:
80+
Ama liste uzunsa, `import * as <obj>` kullanarak her şeyi nesne olarak alabiliriz, örneğin:
8181

8282
```js
8383
// 📁 main.js
@@ -89,29 +89,29 @@ say.sayHi('John');
8989
say.sayBye('John');
9090
```
9191

92-
At first sight, "import everything" seems such a cool thing, short to write, why should we ever explicitly list what we need to import?
92+
İlk bakışta, "her şeyi dahil etmek" kısa yazıldığı için güzel gözüküyor. İçeriye aktarmamız için neye ihtiyaç varsa neden açıkça listeleyelim?
9393

94-
Well, there are few reasons.
94+
Bunun bir kaç nedeni var.
9595

96-
1. Modern build tools ([webpack](http://webpack.github.io) and others) bundle modules together and optimize them to speedup loading and remove unused stuff.
96+
1. Modern derleme araçları ([webpack](http://webpack.github.io) ve diğerleri) modülleri bir araya getirir ve kullanılmasını önleyen yükleme işlemlerini hızlandırmak ve kaldırmak için optimize eder.
9797

98-
Let's say, we added a 3rd-party library `lib.js` to our project with many functions:
98+
Diyelim ki, birçok fonksiyona sahip projemize 3. parti bir kütüphane `lib.js` ekledik.
9999
```js
100100
// 📁 lib.js
101101
export function sayHi() { ... }
102102
export function sayBye() { ... }
103103
export function becomeSilent() { ... }
104104
```
105105

106-
Now if we only use one of `lib.js` functions in our project:
106+
Şimdi projemizde `lib.js` fonksiyonlarından sadece birini kullanırsak
107107
```js
108108
// 📁 main.js
109109
import {sayHi} from './lib.js';
110110
```
111-
...Then the optimizer will automatically detect it and totally remove the other functions from the bundled code, thus making the build smaller. That is called "tree-shaking".
111+
...Ardından optimizer otomatik olarak algılar ve diğer işlevleri birlikte verilen koddan tamamen kaldırır, böylece yapı daha küçük hale gelir. Buna "tree-shaking" denilir.
112112

113-
2. Explicitly listing what to import gives shorter names: `sayHi()` instead of `lib.sayHi()`.
114-
3. Explicit imports give better overview of the code structure: what is used and where. It makes code support and refactoring easier.
113+
2. Açıkça listelemek ne içeri aktarılacaksa daha kısa isimler verilir: `lib.sayHi()` yerine `sayHi()`.
114+
3. Açıkça dahil etmek kod kod yapısında daha iyi genel bakışı sağlar: Nerede, ne kullanılır. Kod desteğini ve yeniden düzenlemeyi kolaylaştırır.
115115

116116
## Import "as"
117117

0 commit comments

Comments
 (0)