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

nav: refactor util/sidebar.js? #894

Closed
jorgeorpinel opened this issue Jan 5, 2020 · 2 comments
Closed

nav: refactor util/sidebar.js? #894

jorgeorpinel opened this issue Jan 5, 2020 · 2 comments
Labels
type: enhancement Something is not clear, small updates, improvement suggestions website: eng-doc DEPRECATED JS engine for /doc

Comments

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Jan 5, 2020

I find it too complicated for the following reasons:

  1. Its purpose is dual:
    a) transform sidebar.json into a different format (used at server load time), and
    b) provide helpers to find sidebar items in different situations (mainly for run-time).
    Each of these purposes could have its own separate module, and I have the impression they could be implemented in a more simple, obvious way.
  2. It has several recursive functions, which could be rewritten as loops for performance

Furthermore, the very need for this module is questionable, per #888.

Related issues that could be resolved/eliminated by fully addressing this:

@jorgeorpinel jorgeorpinel added type: enhancement Something is not clear, small updates, improvement suggestions website: eng-doc DEPRECATED JS engine for /doc labels Jan 5, 2020
@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Jan 5, 2020

I'm not usually the one to suggest this kind of refactoring and I don't expect to have any priority assigned here soon, but I just wanted to leave my thoughts for the record and a possible future revisit.
Docs Engine 2.0 perhaps 😉

@jorgeorpinel jorgeorpinel added status: research Writing concrete steps for the issue question labels Jan 5, 2020
@shcheklein shcheklein added the A: docs Area: user documentation (gatsby-theme-iterative) label Jan 6, 2020
@jorgeorpinel jorgeorpinel changed the title web: refactor util/sidebar.js? app: refactor util/sidebar.js? Jan 9, 2020
@jorgeorpinel jorgeorpinel removed A: docs Area: user documentation (gatsby-theme-iterative) status: research Writing concrete steps for the issue labels Jan 18, 2020
@jorgeorpinel jorgeorpinel changed the title app: refactor util/sidebar.js? nav: refactor util/sidebar.js? Jan 18, 2020
@shcheklein
Copy link
Member

Closing in favor of #1044 ... All mentioned items in the second section of this ticket are closed by the way, most of them are fixed. So this ticket is about complexity of the approach, I think #1044 is more or less the same. @jorgeorpinel feel free to reiterate your comments there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Something is not clear, small updates, improvement suggestions website: eng-doc DEPRECATED JS engine for /doc
Projects
None yet
Development

No branches or pull requests

2 participants