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

Re-export helpers from index #1539

Merged
merged 2 commits into from
May 5, 2024

Conversation

charlesfries
Copy link
Contributor

Before

import min from 'ember-math-helpers/helpers/min';
import max from 'ember-math-helpers/helpers/max';

After

import { min, max } from 'ember-math-helpers';

@RobbieTheWagner
Copy link
Owner

@charlesfries I am not sure I love manually updating a file to import from. What is the benefit of making this change?

@charlesfries
Copy link
Contributor Author

@RobbieTheWagner Just makes it marginally easier to import the helpers while using strict mode/template imports. And yeah I get that concern--maybe we could dynamically generate the file.

Regardless here are some examples of this feature from other addons:

https://github.com/jmurphyau/ember-truth-helpers/blob/master/packages/ember-truth-helpers/src/index.ts

https://github.com/ember-intl/ember-intl/blob/main/packages/ember-intl/addon/index.ts

https://github.com/trusted-american/design-system/blob/master/addon/index.ts

@RobbieTheWagner
Copy link
Owner

@RobbieTheWagner Just makes it marginally easier to import the helpers while using strict mode/template imports. And yeah I get that concern--maybe we could dynamically generate the file.

Regardless here are some examples of this feature from other addons:

https://github.com/jmurphyau/ember-truth-helpers/blob/master/packages/ember-truth-helpers/src/index.ts

https://github.com/ember-intl/ember-intl/blob/main/packages/ember-intl/addon/index.ts

https://github.com/trusted-american/design-system/blob/master/addon/index.ts

Fair enough. It doesn't hurt anything to include this. Should we mention this in the docs?

@charlesfries
Copy link
Contributor Author

Added docs for this as well as the template registry. I can break the latter out into a separate PR if you'd prefer

@RobbieTheWagner RobbieTheWagner merged commit e856703 into RobbieTheWagner:main May 5, 2024
10 checks passed
@RobbieTheWagner
Copy link
Owner

Thanks for the PR!

@charlesfries charlesfries deleted the index branch May 5, 2024 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants