Skip to content

Commit b2f14db

Browse files
authored
Merge branch 'main' into types/random/array/variable-types
2 parents a9c4639 + 0afdf03 commit b2f14db

File tree

4 files changed

+72
-56
lines changed

4 files changed

+72
-56
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
version: 6
3232

3333
- name: Set node version to ${{ matrix.node_version }}
34-
uses: actions/setup-node@v2
34+
uses: actions/setup-node@v3
3535
with:
3636
node-version: ${{ matrix.node_version }}
3737
cache: 'pnpm'
@@ -80,7 +80,7 @@ jobs:
8080
version: 6
8181

8282
- name: Set node version to 16
83-
uses: actions/setup-node@v2
83+
uses: actions/setup-node@v3
8484
with:
8585
node-version: 16
8686
cache: 'pnpm'
@@ -111,7 +111,7 @@ jobs:
111111
version: 6
112112

113113
- name: Set node version to 16
114-
uses: actions/setup-node@v2
114+
uses: actions/setup-node@v3
115115
with:
116116
node-version: 16
117117
cache: 'pnpm'

docs/migration-guide-v5/index.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,49 @@ Faker now ships with its own types! Remove `@types/faker` from your `package.jso
3636

3737
### Tree-shaking
3838

39-
Faker now supports tree-shaking! We highly recommend that you take advantage of your bundler's tree-shaking capabilities and change how you import Faker. This is especially true if you're importing Faker in the browser.
39+
:::warning
40+
Tree shaking is not yet fully supported due to some structural issues. But we plan to make Faker fully tree-shakable in the future.
41+
:::
4042

41-
Faker is a giant package made up of many megabytes of strings. Only import what you need.
43+
For now Faker supports tree-shaking for some parts, and we highly recommend that you take advantage of your bundler's tree-shaking capabilities and change how you import Faker right now.
4244

43-
:::tip
44-
Migrating to the new tree-shakeable syntax should be quick and painless.
45-
:::
45+
Instead of using:
4646

47-
For JS:
47+
```ts
48+
// js
49+
const faker = require('@faker-js/faker');
4850

49-
```js
51+
// ts
52+
import faker from '@faker-js/faker';
53+
```
54+
55+
You should switch to:
56+
57+
```ts
58+
// js
5059
const { faker } = require('@faker-js/faker');
5160

52-
// Or specific locale
53-
const fakerDe = require('@faker-js/faker/locale/de');
61+
// ts
62+
import { faker } from '@faker-js/faker';
5463
```
5564

56-
For TS:
65+
If you only need one specific language, we highly recommend to make use of the locale specific imports like:
5766

5867
```ts
59-
import { faker } from '@faker-js/faker';
68+
// js
69+
const fakerDe = require('@faker-js/faker/locale/de');
6070

61-
// Or specific locale
71+
// ts
6272
import fakerDe from '@faker-js/faker/locale/de';
6373
```
6474

65-
Please [open an issue on GitHub](https://github.com/faker-js/faker/issues/new?assignees=&labels=pending+triage&template=freestyle.md) if we've missed any steps.
75+
This is especially true if you're importing Faker in the browser.
76+
77+
Faker is a giant package made up of many megabytes of strings. Only import what you need.
78+
79+
_We plan to load the locales in another way in a future major release._
80+
81+
---
6682

6783
Happy Faking!
6884

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"conventional-changelog-cli": "~2.2.2",
102102
"cypress": "~9.5.0",
103103
"esbuild": "~0.14.23",
104-
"eslint": "~8.9.0",
104+
"eslint": "~8.10.0",
105105
"eslint-config-prettier": "~8.4.0",
106106
"eslint-define-config": "~1.2.5",
107107
"eslint-gitignore": "~0.1.0",
@@ -124,7 +124,7 @@
124124
"vitepress": "~0.22.3",
125125
"vitest": "~0.5.4"
126126
},
127-
"packageManager": "[email protected].1",
127+
"packageManager": "[email protected].2",
128128
"engines": {
129129
"node": ">=14.0.0",
130130
"npm": ">=7.0.0"

pnpm-lock.yaml

Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)