Initial editor tabs implementation with CAD package guides #519

Merged
franknoirot merged 12 commits from editor-tabs into main 2021-09-20 09:55:30 +02:00
Showing only changes of commit 4c4f5643f4 - Show all commits

View File

@@ -1,7 +1,12 @@
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
// Extracts YAML frontmatter from Markdown files
// Gotten from this helpful comment on a react-markdown GitHub Issue: https://github.com/remarkjs/react-markdown/issues/164#issuecomment-890497653
export function extractMetaData(text: string): Array<any> {
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
const metaData = {} as any
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
export function useMarkdownMetaData(text: string): Array<any> {
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
return React.useMemo(() => {
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
const metaData = {} as any
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
/* ... */
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
return [rawMetaData, metaData]
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
}, [text])
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
}
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
const metaRegExp = RegExp(/^---[\r\n](((?!---).|[\r\n])*)[\r\n]---$/m)
// get metadata
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
Irev-Dev commented 2021-09-19 08:40:37 +02:00 (Migrated from github.com)
Review

Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe

export function useMarkdownMetaData(text: string): Array<any> {
  return React.useMemo(() => {
    const metaData = {} as any
    /* ... */
    return [rawMetaData, metaData]
  }, [text])
}
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe ```suggestion export function useMarkdownMetaData(text: string): Array<any> { return React.useMemo(() => { const metaData = {} as any /* ... */ return [rawMetaData, metaData] }, [text]) } ```
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
franknoirot commented 2021-09-19 15:49:30 +02:00 (Migrated from github.com)
Review

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.

Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.