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

Publish ambient types #77

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Publish ambient types #77

merged 1 commit into from
Jul 25, 2023

Conversation

gitKrystan
Copy link
Contributor

@gitKrystan gitKrystan commented Jan 4, 2023

@gitKrystan gitKrystan force-pushed the ambient-types branch 2 times, most recently from a373404 to 284e7d9 Compare January 4, 2023 22:10
@@ -0,0 +1,18 @@
export default class TestLoader {
Copy link
Contributor Author

@gitKrystan gitKrystan Jan 4, 2023

Choose a reason for hiding this comment

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

Based on the docs for this library, I'm not sure how much of this should actually be public. All I need for emberjs/ember-qunit#994 is loadModules, moduleLoadFailure, addModuleExcludeMatcher and addModuleIncludeMatcher.

Choose a reason for hiding this comment

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

Should we comment out the rest and see if anyone asks for them?

Choose a reason for hiding this comment

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

I guess at the end of the day this whole package is probably pretty "private" anyway 🤷🏼‍♂️

Choose a reason for hiding this comment

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

Ok so looking at the implementation, I would guess that shouldLoadModule, listModules, listTestModules, require, unsee and moduleLoadFailure are probably meant to be private helpers.

Copy link

@chancancode chancancode Jan 4, 2023

Choose a reason for hiding this comment

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

In that case, it may make more sense to declare the default export as an object with a load method on it? I don't think TestLoader is really meant to be instantiated or subclassed by anyone outside of here. The fact that it happens to be a class appears to be an implementation detail.

Choose a reason for hiding this comment

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

OTOH, the readme says....

// optionally override TestLoader.prototype.shouldLoadModule

🤷🏼 🤷🏼 🤷🏼

I guess you can take all of that information and decide what to do with them as you see fit, this is just an "internal" support package and I don't think these things were thought through very rigorously at the time.

Choose a reason for hiding this comment

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

ember-qunit does new TestLoader().loadModules()

It probably should have just called load() which does exactly that, but oh well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

README says "optionally override TestLoader.prototype.shouldLoadModule" so I am going to make that public also

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am working on ember-qunit anyway, so I just made that call the static load method and made loadModules private and the constructor protected.

@gitKrystan gitKrystan force-pushed the ambient-types branch 3 times, most recently from c021e6e to 68d52ec Compare January 4, 2023 22:48
@ef4 ef4 merged commit 6e99b26 into ember-cli:master Jul 25, 2023
@gitKrystan gitKrystan deleted the ambient-types branch July 25, 2023 21: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.

4 participants