Skip to content

Conversation

matthewmayer
Copy link
Contributor

@matthewmayer matthewmayer commented Jul 5, 2025

WIP migration guide for

Preview is here https://deploy-preview-3559.fakerjs.dev/guide/upgrading.html

@matthewmayer matthewmayer requested a review from a team as a code owner July 5, 2025 08:58
Copy link

netlify bot commented Jul 5, 2025

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit e614db0
🔍 Latest deploy log https://app.netlify.com/projects/fakerjs/deploys/6868f7addea6ef00084c8b2e
😎 Deploy Preview https://deploy-preview-3559.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

codecov bot commented Jul 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.96%. Comparing base (623d274) to head (e614db0).
Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #3559   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files        2888     2888           
  Lines      221958   221958           
  Branches      931      930    -1     
=======================================
  Hits       221891   221891           
  Misses         67       67           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Shinigami92 Shinigami92 added the c: docs Improvements or additions to documentation label Jul 5, 2025
@Shinigami92 Shinigami92 added this to the v10.0 milestone Jul 5, 2025
@matthewmayer matthewmayer marked this pull request as draft July 5, 2025 09:04
@Shinigami92
Copy link
Member

Shinigami92 commented Jul 5, 2025

@matthewmayer THANKS a lot that you started to take this over 🚀
However it was my mistake that I did not communicate transparently that I also sit on the docs today.

But I was not that far as you are already.

Here is my current diff:

Details
---
outline: [2, 3]
---

# Upgrading to v10

This is the migration guide for upgrading from v9 to v10.

::: info Not the version you are looking for?

- [Upgrading to v9](https://v9.fakerjs.dev/guide/upgrading.html)
- [Upgrading to v8](https://v8.fakerjs.dev/guide/upgrading.html)
- [Upgrading to v7](https://v7.fakerjs.dev/guide/upgrading.html)
- [Upgrading to v6](https://v6.fakerjs.dev/migration-guide-v5/)

:::

## General Breaking Changes

### Requires Node v20.11+

Support for Node.js v18 has been discontinued as this version have reached their [end-of-life](https://github.com/nodejs/Release). Faker.js v10 requires a minimum of Node.js v20.11.

### ESM Only

We ship from now on only ESM. However, thanks to the [Node.js `require(esm)`](https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require), you can still use `@faker-js/faker` in CommonJS projects. This is supported by Node.js since v20.19 without any CI flags.

Faker decided to make this step, so we don't need anymore to distribute two different formats and so split the dist-size in half.

## Removals of Deprecated Code

Faker v10 removes all deprecated code that was marked as such: [#3553](https://github.com/faker-js/faker/pull/3553/files).

Lets merge forces and I will start reviewing your work 👍

@matthewmayer
Copy link
Contributor Author

matthewmayer commented Jul 5, 2025

Ah my bad didn't realise. Feel free to leave comments, or make edits directly to my draft.

@Shinigami92
Copy link
Member

In https://github.com/faker-js/faker/pull/3559/files#diff-3def678deb1b1d5a53948eb8491817dde4dc881e032e785fc61cc93d334eefcdR107 we have a roadmap section. Will we add a v10 section in a later PR after v10.0 got already released?
thoughts: Right now I'm not even sure if we have any plans for a v10+ roadmap or if we just "maintain" further and see which contributions come in

@matthewmayer
Copy link
Contributor Author

Yeah I think we could probably remove the roadmap. We might have a wishlist of future changes but they would not be tied to specific major versions.

@Shinigami92
Copy link
Member

I found docs/about/roadmap/index.md, we should at least correct the sections there.

docs/guide/randomizer.md line 21 could be removed (?! not sure about it)

found two methods in src/modules/helpers/index.ts, I will try to remove them in a separate PR

I think the section in the README.md will be managed by the GH workflow

@matthewmayer matthewmayer marked this pull request as ready for review July 5, 2025 12:33
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the migration guide from v9 to v10, adjusting Node.js requirements, explaining the new ESM-only package with CommonJS compatibility, and refreshing the list of removed deprecated methods.

  • Update guide headings, Node version support, and ESM/CommonJS guidance
  • Refresh tables of removed methods and their replacements
  • Update sidebar entry text for the upgrading guide

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/guide/upgrading.md Revised migration guide to v10: headings, Node requirements, ESM/CJS usage, and updated removal tables
docs/.vitepress/config.ts Updated sidebar label from "Upgrading to v9" to "Upgrading to v10"
Comments suppressed due to low confidence (4)

docs/guide/upgrading.md:24

  • The heading only mentions Node v18 but the guide requires a minimum of Node.js v20.19.0 (so Node v19 is also unsupported). Consider updating the heading to reflect the accurate minimum version (e.g., "Minimum Node.js v20.19.0+").
### Node v18 No Longer Supported

docs/guide/upgrading.md:15

  • The "Not the version you are looking for?" section only links to v9, but links to older migrations were removed. Restoring links to v8, v7, etc., would help users upgrading from earlier releases.
- [Upgrading to v9](https://v9.fakerjs.dev/guide/upgrading.html)

docs/guide/upgrading.md:41

  • The error snippet beginning with "Uncaught:" isn't inside a code block, so it won't render as formatted code. Wrap these lines in triple backticks to preserve formatting.
Uncaught:

docs/guide/upgrading.md:35

  • The example destructures fakerES, which isn't exported by the package; this may confuse readers. Consider showing how to import specific locales or remove the unused alias.
const { faker, fakerES } = require('@faker-js/faker'); // this still works

Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for preparing this.

@xDivisionByZerox xDivisionByZerox added the p: 1-normal Nothing urgent label Jul 5, 2025
@xDivisionByZerox xDivisionByZerox added this pull request to the merge queue Jul 5, 2025
Merged via the queue into next with commit 5d74cfd Jul 5, 2025
24 checks passed
@xDivisionByZerox xDivisionByZerox deleted the docs-migration-guide-v10 branch July 5, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: docs Improvements or additions to documentation p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants