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.

Doc on vanilla javascript is weird

See original GitHub issue

What’s the URL to the page you’re sending feedback for?

https://tiptap.dev/installation#vanilla-java-script

What part of the documentation needs improvement?

It says vanilla javascript but then it mixes up nodejs:

import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'

with vanilla javascript:

document.querySelector('.element')

There is no document in nodejs and there are no package imports in vanilla javascript.

This makes no sense.

What is helpful about that part?

Absolutely nothing.

What is hard to understand, missing or misleading?

As described above

Anything to add? (optional)

“Frameworks” are bloatware.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
danielpunkasscommented, May 13, 2022

Thanks @binyamin ! I went one step further and packed it all in a single file and it seems to work. Great for early/easy hackjing around.

<head>
<script type="module">
import { Editor } from 'https://esm.sh/@tiptap/core'
import StarterKit from 'https://esm.sh/@tiptap/starter-kit'

new Editor({
  element: document.querySelector('.element'),
  extensions: [
    StarterKit,
  ],
  content: '<p>Hello World!</p>',
})
</script>
</head>
<body>
<div class="element"></div>
</body>
3reactions
hanspagelcommented, Feb 5, 2022

Phew, thanks for the feedback.

Actually, import does work in the browser environment now:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

And vanilla JavaScript doesn’t mean no build system, for example Vite (which is really amazing) helps with that, even for vanilla JavaScript apps:

https://vitejs.dev/guide/#trying-vite-online

That said, I feel you. All that can be very confusing. I’ll check what we can do to simplify the guide. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

DOM Ready vanilla javascript not working - Stack Overflow
The thing is: if you declare a variable inside a function, it's not visible outside that function. And you're passing a function to ......
Read more >
You're Missing Out on Vanilla JS. Don't bring the ... - Medium
Sounds strange at first, but vanilla is actually the way to go. ... And if you are, you've got bigger problems than how...
Read more >
How Important is Vanilla Javascript in 2021 - YouTube
Get The Practical Javascript Coursehttps://codingphase.teach...
Read more >
You SHOULD Learn Vanilla JavaScript Before JS Frameworks
The history of the Vanilla JS site, which poses as a "JS framework" site, is short but funny. Eric Wastl created it in...
Read more >
Is Vanilla JavaScript worth learning? Absolutely.
Did I mention that although many frameworks lack decent documentation, they have a pretty complex code? But hey, piece of cake, right? You ......
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