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.

Improve the Nuxt.js integration

See original GitHub issue

We see that a lot of you are using tiptap with Nuxt.js, so we want to improve the experience with that.

Client Side Rendering for the Editor

It’s not obvious that tiptap needs to be executed on the client side. It’s required to wrap the editor in an <client-only /> component, but it’s easy to forget.

  • Throw a helpful exception if tiptap is rendered on the server

Source: #131

Server Side Rendering for the Content

It’s already possible to render the tiptap content in a read-only instance, that should help for the use in apps. If you’re using tiptap to write a blog post, you’d want to render the content on the server side to deliver plain HTML to user. Plain HTML can be easily indexed by Google and others, viewed without JavaScript and so on.

  • Provide an easy way to render the content on the server side

Source: https://github.com/ueberdosis/tiptap/issues/547#issuecomment-685251674

Nuxt.js Integration Guide

There are a few issues using tiptap with Nuxt.js for the first time. You need to understand the difference between client side and server side rendering, you shouldn’t create the instance in the data() method (see below) and probably more. A short guide would probably help to get things right easier.

  • Add a Nuxt.js Integration Guide to the documentation

What else?

I don’t have much experience with Nuxt.js. Is there anything that you have been missing?

Would love to hear your ideas how we can improve the integration.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

13reactions
hanspagelcommented, Sep 3, 2020

Just wanted to chime in and say that I got the rendering working in tiptap 2. It looks like that:

import { generateHtml } from '@tiptap/core'

const doc = {
  'type': 'document',
  'content': [{
    'type': 'paragraph',
    'attrs': {
      'align': 'left'
    },
    'content': [{
      'type': 'text',
      'text': 'My sample text'
    }]
  }]
}

const extensions = […]

const html = generateHtml(doc, extensions)

That makes it possible to render the HTML without an actual tiptap instance. The current implementation still needs a document, but I’m going to add JSDOM support (needed when there is no actual window). That’ll bring this feature to the server side, e. g. for Nuxt.js.

Hope you’re all as hyped about tiptap 2 as I am. 😅

3reactions
hanspagelcommented, May 31, 2021

Does that help? https://www.tiptap.dev/api/utilities/html

If you encounter an issue with that utility, would you mind to create a new issue with a detailed error (+ stack trace)? Happy to help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Boost the Performance of Your Nuxt.js Website
Improving the performance of your Nuxt.js site ... One of the biggest advantages of Nuxt.js is that you can leverage the Vue.js ecosystem....
Read more >
Nuxt - The Intuitive Vue Framework
Build your next Vue.js application with confidence using Nuxt. An open source framework making web development simple and powerful.
Read more >
Vue and Nuxt Performance Optimization Checklist
Read the comprehensive and in-depth technical article summarizing how to improve the site performance with efficient use of Vue.js and Nuxt.
Read more >
How to improve the PageSpeed score of your Nuxt.js website ...
Try to add maxSize to your nuxt.config.js to force webpack to split your bundle into smaller chunks. But don't try to set the...
Read more >
Nuxt.js integration - New Relic Documentation
With our Nuxt.js dashboard, you can easily track your application error rate, initial page load average, route changes, throughput, and page views with ......
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