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
3 changed files with 21 additions and 25 deletions
Showing only changes of commit 65fc526220 - Show all commits

View File

@@ -1,10 +1,10 @@
import { extractMetaData } from 'src/helpers/markdown'
import { useMarkdownMetaData } from 'src/helpers/markdown'
import Editor from 'rich-markdown-editor'
import { useRef } from 'react'
import KeyValue from 'src/components/KeyValue/KeyValue'
export default function EditorGuide({ content }) {
const [rawMetadata, metadata] = extractMetaData(content)
const [rawMetadata, metadata] = useMarkdownMetaData(content)
const processedContent = rawMetadata
? content.replace(rawMetadata[0], '')

View File

@@ -2,7 +2,7 @@
Irev-Dev commented 2021-09-19 09:28:03 +02:00 (Migrated from github.com)
Review

I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project.
I should add a .md file in src/helpers/cadPackages thats an explanation of how the integrations work, as there are more parts to it now as well.

I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project. I should add a `.md` file in `src/helpers/cadPackages` thats an explanation of how the integrations work, as there are more parts to it now as well.
Irev-Dev commented 2021-09-19 09:28:03 +02:00 (Migrated from github.com)
Review

I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project.
I should add a .md file in src/helpers/cadPackages thats an explanation of how the integrations work, as there are more parts to it now as well.

I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project. I should add a `.md` file in `src/helpers/cadPackages` thats an explanation of how the integrations work, as there are more parts to it now as well.
franknoirot commented 2021-09-19 15:51:37 +02:00 (Migrated from github.com)
Review

Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.

Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.
franknoirot commented 2021-09-19 15:51:37 +02:00 (Migrated from github.com)
Review

Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.

Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.
title: OpenSCAD
Written with: Custom language
Kernal type: BREP
Maintained by: [Marius Kintel + 15 members](https://github.com/openscad)
Irev-Dev commented 2021-09-19 09:28:03 +02:00 (Migrated from github.com)
Review

I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project.
I should add a .md file in src/helpers/cadPackages thats an explanation of how the integrations work, as there are more parts to it now as well.

I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project. I should add a `.md` file in `src/helpers/cadPackages` thats an explanation of how the integrations work, as there are more parts to it now as well.
franknoirot commented 2021-09-19 15:51:37 +02:00 (Migrated from github.com)
Review

Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.

Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.
Maintained by: [Marius Kintel and contributors](https://github.com/openscad/openscad/graphs/contributors)
Irev-Dev commented 2021-09-19 09:28:03 +02:00 (Migrated from github.com)
Review

I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project.
I should add a .md file in src/helpers/cadPackages thats an explanation of how the integrations work, as there are more parts to it now as well.

I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project. I should add a `.md` file in `src/helpers/cadPackages` thats an explanation of how the integrations work, as there are more parts to it now as well.
franknoirot commented 2021-09-19 15:51:37 +02:00 (Migrated from github.com)
Review

Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.

Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.
Documentation: [openscad.org](https://openscad.org/)
---
OpenSCAD is a solid 3D modeler that enables the creation of parametric models using its scripting language. Models are created by utilizing a technique called constructive solid geometry. According to this technique, simple objects can be transformed and combined in order to create almost any complex model.

View File

@@ -1,29 +1,25 @@
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 useMarkdownMetaData(text: string): Array<any> {
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.
return React.useMemo(() => {
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.
const metaRegExp = RegExp(/^---[\r\n](((?!---).|[\r\n])*)[\r\n]---$/m) 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.
// 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]) } ```
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 rawMetaData = metaRegExp.exec(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.
let keyValues
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.
if (rawMetaData !== null) {
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.
// rawMeta[1] are the stuff between "---"
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.
keyValues = rawMetaData[1].split('\n')
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.
// which returns a list of key values: ["key1: value", "key2: value"]
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.
keyValues.forEach((keyValue) => {
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.
// split each keyValue to keys and values
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 [, key, value] = keyValue.split(/(.+): (.+)/)
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.
metaData[key] = value.trim()
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.
}
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]
}, [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.
const metaRegExp = RegExp(/^---[\r\n](((?!---).|[\r\n])*)[\r\n]---$/m)
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.
// 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]) } ```
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 rawMetaData = metaRegExp.exec(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.
let keyValues
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.
if (rawMetaData!) {
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.
// rawMeta[1] are the stuff between "---"
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.
keyValues = rawMetaData[1].split('\n')
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.
// which returns a list of key values: ["key1: value", "key2: value"]
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.
keyValues.forEach((keyValue) => {
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.
// split each keyValue to keys and values
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 [, key, value] = keyValue.split(/(.+): (.+)/)
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.
metaData[key] = value.trim()
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.
}
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.
}
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]) } ```
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.