question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Order of documents vary between development and production builds

See original GitHub issue

Bug Report

Describe the bug

The order of the menu is different between the development and production version of the same set of files.

Development Version Production Version

From what I can see, it is based on the file names rather than the order. My file structure looks like but when I change the folder names to be 1-brand and 2-atoms they order correctly. To then get the documents to arrange correctly, I have to do the order ascending (without setting the order: ‘ascending’ option as that does nothing) and then work with it looking strange in the dev version

  • OS: OSX 10.3.4
  • Node/npm version: 10.1.0/5.6.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
pedronauckcommented, Jul 16, 2018

Can be a good choice, but I have some points:

  • I think that an array of objects can be a better solution in this case
  • Import .mdx directly can be bad because we’ll need to transpile they after import to read and this can be a performance leaky

Another solution that I’m thinking about is using an export const instead of a front matter to define document settings, so we can easily import the menu and using on the definition, like that:

// src/components/index.js
export const menu = {
  name: 'Components',
  order: 1
}

// docs/components/Alert.mdx
import { menu } from 'src/components'

export const meta = {
  menu,
  name: 'Alert',
  order: 2,
}

What do you thinking about that @mAAdhaTTah?

2reactions
mAAdhaTTahcommented, Jul 16, 2018

Do you have some idea about that feature @mAAdhaTTah ?

I think defining the menu & submenu items via a multi-dimensional array, rather in the front-matter of the pages, would be better. The annoying thing is wanting to rearrange the location of a page on the list and needing to change every single page in order to get it into the right place.

First thought is something like this:

// doczrc.js
export default {
  menu: [
    ["Introduction", ["quickstart", "changelog"]]
    ["Walkthrough", ["setup", "deploying"]]
  ]
};

Even better if we could maybe import the files:

// doczrc.js
import quicksart from './docs/quickstart.mdx';

export default {
  menu: [
    ["Introduction", [quickstart]]
    // etc.
  ]
};

Thoughts?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Technical Documentation in Software Development: Types, ...
And different types of documents are created through the whole software development lifecycle (SDLC). Documentation exists to explain product ...
Read more >
What is an Engineering Change Order (ECO)?
An engineering change order (ECO) is a document that specifies either new product design details or proposed changes to existing products. ECOs provide...
Read more >
5 Steps to a Successful Release Management Process
Build release. With the release plan finalized, you can start designing and building the product for release. This is the actual “development” of...
Read more >
Deployment environment
Architectures. Deployment architectures vary significantly, but, broadly, the tiers are bookended by starting at development (DEV) and ending at production ( ...
Read more >
What is Product Development? The 6 Stage Process ...
The product development process is a six-stage plan that involves taking a product from initial concept to final market launch.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found