-
-
Notifications
You must be signed in to change notification settings - Fork 950
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
Release v6.0.0 Roadmap #542
Comments
Beta has been released: https://github.com/faker-js/faker/releases/tag/v6.0.0-beta.0 |
I saw y'all released v6.0.0 - just wanted to say A W E S O M E and THANK YOU to everyone involved in all of this 🤩 |
V6 stable works great in our repository, we just need little adjustments. |
What kind of adjustments? Did some types/methods change from 5.5.3 to v6.0.0? |
@ST-DDT const pastYearDate = Faker.date.past(1);
const pastTwoYearsDate = Faker.date.past(2, pastYearDate); into this: const pastYearDate = Faker.date.past(1);
const pastTwoYearsDate = Faker.date.past(2, pastYearDate.toISOString()); 2] We have to remove memory optimisation for loading just two locales on boot instead of all. import fakerStatic from 'faker';
import FakerLib from 'faker/lib';
const AVAILABLE_LOCALES = ['cz', 'de', 'en', 'es', 'fr', 'ja', 'ko', 'ru', 'sk', 'uk', 'vi'];
export const Faker = ((): FakerType => {
const faker: FakerType = new FakerLib({locale: 'en', localeFallback: 'en'});
const rndLocale = faker.random.arrayElement(AVAILABLE_LOCALES);
faker.locales[rndLocale] = require(`faker/lib/locales/${rndLocale}`);
faker.locales.en = require('faker/lib/locales/en');
faker.locale = rndLocale;
faker.seed(seed);
return faker;
})(); This saved not small number of MB in memory of our CI, which led to faster builds. |
So something like this (not tested): import { Faker } from '@faker-js/faker';
new Faker({
locale: 'rndLocale',
localeFallback: 'en',
locales: [
...require(`@faker-js/faker/locale/${rndLocale}`).locales
]
}) This could be a workaround for now, but we plan to change stuff in later major versions. But for the next versions we want to concentrate on bug fixes and small features. |
Why merge it? AFAICT these instances are exactly what they need/re-create. Maybe we should export the locales (definitions) as well.
This is the old import from 553 for comparison. |
Yeah yeah, we should, but that means we need to change stuff in our bundling process, and that's something I would like to tackle in v7+
Oh, I thought because they wanted to change the locale dynamically at runtime instead of everytime call the factory and creating a fully new instance 🤔 |
Yeah, it's surprising to not see this called out in the changelog. All the places we're using this library use the |
@joequincy If you mean you should use But if really someone to early tackle such thinks and make sure that it works for cjs and esm, feel free. I just currently want to focus my time as planned. |
@joequincy I really don't understand why, because we exported it as normal and as default Lines 33 to 37 in c5df7ee
The only thing I could think of would be that esbuild mess up with something 🤷 |
Yeah, I've updated our imports already and it's an otherwise seamless version bump. I do think either this should be called out in the release notes as a breaking change or the build process should be tweaked so that |
We do have the migration guide: https://fakerjs.dev/migration-guide-v5/#tree-shaking |
No critical issues with the release have been reported. |
This is our planned roadmap to v6.0.0.
Feel free to suggest changes or report important bugs/incompatibilities.
Vet v6.0.0-alpha.x types emitted types against v5.5.3 Vet v6.0.0-alpha.5 types emitted types against v5.5.3 #305 (Not yet assigned)The text was updated successfully, but these errors were encountered: