Skip to content
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

Adding additional functionality to Helpers.js #28

Open
2 tasks
joe-allen-89 opened this issue Jan 29, 2025 · 4 comments
Open
2 tasks

Adding additional functionality to Helpers.js #28

joe-allen-89 opened this issue Jan 29, 2025 · 4 comments

Comments

@joe-allen-89
Copy link
Contributor

joe-allen-89 commented Jan 29, 2025

Whilst we want to add certain helpers to reduce code complexity and code duplication conscious we don't want to turn the migration scripts into constant helper functions, so wanted to have an open issue for anybody to add any ideas they have for potential helper functions, or any ideas on ways we can replicate these with the likes of lodash in scripts rather than adding helper functions.

The ones currently identified are:

Feel free to either edit this issue to add ideas or comment below.

@oliverfoster
Copy link
Member

  1. Use lodash _.set https://lodash.com/docs/4.17.15#set

Image

@oliverfoster
Copy link
Member

oliverfoster commented Jan 29, 2025

Please consider only adding helpers with the greatest utility - the more helpers we have the harder it is to read the migration scripts. Reducing repetition here is not necessarily a benefit. Keep it simple, use straightforward javascript. Repeat things inside a readable number of lines to reduce scrolling, such that other people can read your describe blocks and mutations without needing wider context. Rely on others documented code.

These helpers, for example, exist in lodash, which can be imported using import _ from 'lodash';

Image

_.has
_.set

@oliverfoster
Copy link
Member

Are there any more helpers that should be bought forward?

@chris-steele
Copy link

@oliverfoster I've gone through quite a few plugins now and haven't seen need for any other helpers 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

6 participants