Skip to content

Conversation

@pzuraq
Copy link
Contributor

@pzuraq pzuraq commented Apr 7, 2018

It turns out that helpers can actually be functions or classes, which
was not something which the original data model took into account.
This PR removes the notion of a unique "helper" type from the data
model in favor of deferring to whatever construct is ultimately
resolved: Either a class or a function.

The navigation index code has also been simplified a bit - it was pretty
hacked together after EmberConf, so it needed some straightening out.
For now, the rule is that every resolvable file gets an entry, and the
the last segment of the file path becomes the entry's name. Helpers and
components are {{curlied}} and everything else is CapitalCased.

We are also no longer making assumptions about what a file is exporting.
This means that if helper function or class is exported from resolved
directory, it will not show up in the navigation at all. We can work
on solving this use case later on, but I think it will be sufficiently
rare that we can punt on it until later. utils/ folders are
purposefully excluded from this and are placed instead in the module
structure, since that is the most common directory for helper functions.

We also need to consider how this structure may change with module
unification and nesting, but that's a problem for the future.

Closes #136

It turns out that helpers can actually be functions _or_ classes, which
was not something which the original data model took into account.
This PR removes the notion of a unique "helper" type from the data
model in favor of deferring to whatever construct is ultimately
resolved: Either a class or a function.

The navigation index code has also been simplified a bit - it was pretty
hacked together after EmberConf, so it needed some straightening out.
For now, the rule is that every resolvable file gets an entry, and the
the last segment of the file path becomes the entry's name. Helpers and
components are {{curlied}} and everything else is CapitalCased.

We are also no longer making assumptions about what a file is exporting.
This means that if  helper function or class is exported from resolved
directory, it will _not show up_ in the navigation at all. We can work
on solving this use case later on, but I think it will be sufficiently
rare that we can punt on it until later. `utils/` folders are
purposefully excluded from this and are placed instead in the module
structure, since that is the most common directory for helper functions.

We also need to consider how this structure may change with module
unification and nesting, but that's a problem for the future.
@pzuraq pzuraq force-pushed the refactor/remove-helper-items branch from 88d6db5 to f80e066 Compare April 13, 2018 22:16
@pzuraq
Copy link
Contributor Author

pzuraq commented Apr 15, 2018

Failures are due to an unrelated bug upstream that has been fixed. The fix has not yet propagated to Beta, but everything is green on Canary so going to merge this and publish for now.

@pzuraq pzuraq merged commit 9e823bd into master Apr 15, 2018
@pzuraq pzuraq deleted the refactor/remove-helper-items branch April 15, 2018 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helpers are not discovered

2 participants