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

Document all the things... #291

Merged
merged 20 commits into from
Dec 30, 2017
Merged

Document all the things... #291

merged 20 commits into from
Dec 30, 2017

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Dec 29, 2017

Adds API documentation for all public APIs (and some private ones).

Also enables the require-jsdoc eslint rule to ensure all functions are documented going forward...

Closes #285

Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

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

👍

Stores the provided application instance so that tests being ran will be aware of the application under test.

Required by `setupApplicationContext` method.
Used by `setupContext` and `setupRenderingContext` when present.
Copy link
Member

Choose a reason for hiding this comment

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

should we use - prefixes here to make that a markdown list?

let { tagName, type } = el;
/**
@private
@method isFormControl
Copy link
Member

Choose a reason for hiding this comment

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

btw with documentation the @method attribute is inferred from the function name, so this is not necessarily needed afaik

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, should I remove it across the board?

Copy link
Member

Choose a reason for hiding this comment

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

you might want to verify my statement, but unless you see any additional value in having the function name repeated here I see no reason for keeping them

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, just confirmed. Neither documentation nor eslint need the @method.

/**
@private
@method __click__
@param {Element} element the element to trigger events on
Copy link
Member

Choose a reason for hiding this comment

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

description sounds like it was copy pasted from another function... 😉

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, it seems correct to me? The element arg is the thing we trigger all the various events (focusin, focus, click, etc) on...

Copy link
Member

Choose a reason for hiding this comment

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

sure, though "trigger events on" sounds like something that the description for triggerEvent() should say, not necessarily the docs for click()

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, a “click” is actually many events 🤔

But either way, I take your point. I should also make that clearer in the click docs too.

@method settled
@returns {Promise<void>} resolves when settled
*/
export default function settled() {
Copy link
Member

Choose a reason for hiding this comment

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

unrelated to this PR but I'm wondering if we should implement this using waitUntil() and moving the backoff algorithm into waitUntil() 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I had the same thought actually. Will work on that after these changes have landed.

setupRenderingTest(hooks);

test('does something awesome', function(assert) {
render(hbs`{{awesome-sauce}}`);
Copy link
Member

Choose a reason for hiding this comment

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

this example is not using async/await, which seems a little strange as it's the default now 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Totally agreed. Will update.

@@ -38,6 +95,12 @@ export function pauseTest() {
return context.pauseTest();
}

/**
Resumes a test previously paused by `return pauseTest()`.
Copy link
Member

Choose a reason for hiding this comment

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

I prefer await pauseTest() since return pauseTest() will make resumeTest() essentially impossible

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 will update

let result = validateErrorHandler();
assert.ok(result.isValid, result.message);
});
```
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer it if the @example block would be moved below the function signature documentation

Copy link
Member Author

Choose a reason for hiding this comment

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

Totally agreed. Will update.

Also use alternate JSDoc style with prefixed `*` on each line. Without
this the indentation of the example block is lost.
@rwjblue rwjblue merged commit 7598c5b into emberjs:master Dec 30, 2017
@rwjblue rwjblue deleted the more-docs branch December 30, 2017 03:51
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.

3 participants