Skip to content

feat(project): support front-matter with Editor#122

Merged
benjamincanac merged 6 commits intodevfrom
feat/118
Mar 8, 2022
Merged

feat(project): support front-matter with Editor#122
benjamincanac merged 6 commits intodevfrom
feat/118

Conversation

@smarroufin
Copy link
Copy Markdown
Contributor

Resolves #118

@smarroufin smarroufin requested review from a team, Flosciante and benjamincanac and removed request for a team March 7, 2022 15:02
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 7, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nuxtlabs/nuxt-com/2otjy3BcPfAHzASHSZU9fUqJyyja
✅ Preview: https://nuxt-com-git-feat-118-nuxtlabs.vercel.app

@smarroufin
Copy link
Copy Markdown
Contributor Author

WIP.

At this point we are waiting for jonschlinkert/gray-matter#132 to be merged.
We can make it work locally by reproducing the PR changes in our node_modules.

Also waiting for directives on the handling of the content changes.
Should we save everything in localstorage or not? If so, how do we map it properly in storage so we can switch between files? Do we copy the "cache" mechanism of Docus?

@benjamincanac
Copy link
Copy Markdown
Member

@smarroufin Why is this PR mandatory?

For file changes, for now you can make a function that will parse and concat the data to have it ready to be sent somewhere. We can assume that it won't be stored in localStorage but sent to the API.

@smarroufin
Copy link
Copy Markdown
Contributor Author

Oops, yes it wasn't that obvious.
There is a crash when loading the /content page. Buffer is not defined.
Like this: https://stackoverflow.com/questions/60772266/getting-buffer-is-not-defined-when-using-gray-matter-in-angular/60772329#60772329

Ok for the preparation for sending data. I'll adjust my code and let it pending. We'll talk about it more tomorrow.

@smarroufin
Copy link
Copy Markdown
Contributor Author

I made a workaround to have it working for know.

We have another issue, flat library does not support esm, so yarn build breaks. It does not seem to be moving since last year according to the repo issues: hughsk/flat#101
Do we want to aim for an alternative library, or is there a way to transpile it with some nitro/vite/whatever stuff?

@benjamincanac
Copy link
Copy Markdown
Member

You can try to add it in vite.optmizeDeps nuxt config:

vite: {
  optimizeDeps: {
    include: ['...']
  }
}

@benjamincanac benjamincanac marked this pull request as ready for review March 8, 2022 15:10
@benjamincanac benjamincanac merged commit a467601 into dev Mar 8, 2022
@benjamincanac benjamincanac deleted the feat/118 branch March 8, 2022 15:16
larbish pushed a commit that referenced this pull request Aug 18, 2022
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
danielroe pushed a commit that referenced this pull request Oct 18, 2023
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
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.

DocusEditor content ref should only be the content without front-matter

2 participants