Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt specific corrections #2410

Merged
merged 3 commits into from Jan 21, 2022
Merged

Nuxt specific corrections #2410

merged 3 commits into from Jan 21, 2022

Conversation

gsqrt2
Copy link
Contributor

@gsqrt2 gsqrt2 commented Jan 20, 2022

Minor adjustments so that the example doesn't need tinkering to run in latest default Nuxt installation.

Line 38: Nuxt does not use a src folder by default & convert name to multi-word to avoid naming convention errors.
Line 83: Removed id attribute from page container div. Nuxt adds its own id="app" to the app root container.
Line 85: Convert name to multi-word to avoid naming convention errors.
Line 89: Import component before use, component autoload occasionally fails.
Line 91: Fix typo client-only

Minor adjustments so that the example doesn't need tinkering to run in latest default Nuxt installation.

Line 38: Nuxt does not use a src folder by default & convert name to multi-word to avoid naming convention errors.
Line 83: Removed id attribute from page container div. Nuxt adds its own id="app" to the app root container.
Line 85:  Convert name to multi-word to avoid naming convention errors.
Line 91: Fix typo client-only
@netlify
Copy link

netlify bot commented Jan 20, 2022

✔️ Deploy Preview for tiptap-embed ready!

🔨 Explore the source changes: c708aa8

🔍 Inspect the deploy log: https://app.netlify.com/sites/tiptap-embed/deploys/61ea7a4bfbf60300083dadb8

😎 Browse the preview: https://deploy-preview-2410--tiptap-embed.netlify.app

Copy link
Contributor

@hanspagel hanspagel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Tiptap should be one word. Can you use Tiptap, TiptapEditor and tiptap-editor in all occurrences?

docs/installation/nuxt.md Show resolved Hide resolved
@@ -35,7 +35,7 @@ npm install @tiptap/vue-2 @tiptap/starter-kit
If you followed step 1 and 2, you can now start your project with `npm run serve`, and open [http://localhost:8080/](http://localhost:8080/) in your favorite browser. This might be different, if you’re working with an existing project.

## 3. Create a new component
To actually start using Tiptap, you’ll need to add a new component to your app. Let’s call it `Tiptap` and put the following example code in `src/components/Tiptap.vue`.
To actually start using Tiptap, you’ll need to add a new component to your app. Let’s call it `TipTap` and put the following example code in `~/components/TipTap.vue`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ is an alias for the user home directory, so if someone is created the file from the CLI it would end up in the wrong location.

Can you just write components/TiptapEditor here - without the ~?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a Nuxt project configuration ~ refers to the root folder of the project. In contrast to a vue project created with vue-cli project, the official Nuxt cli project creator (create-nuxt-app) uses this notation out of the box.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I know. But if some says "create a file", which you normally do on your file system, editor, the bash ... in that context it stands for a different folder, the user home.

If we would say "import that component" (which then would happen in the Nuxt context) that would be a different thing, and would make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, didn't realize it was a wording problem. Then components/TiptapEditor.vue should do just fine.

@gsqrt2
Copy link
Contributor Author

gsqrt2 commented Jan 20, 2022

Thanks for the PR! Tiptap should be one word. Can you use Tiptap, TiptapEditor and tiptap-editor in all occurrences?

Glad I can be of use!

So, when using one word components, default and strongly-recommended eslint rule vue/multi-word-component-names fails:

This rule require component names to be always multi-word, except for root App components, and built-in components provided by Vue, such as or . This prevents conflicts with existing and future HTML elements, since all HTML elements are a single word.

We could use TiptapEditor, as you suggest, in both the simple and v-model cases, which would also bridge the component name difference that users face when transitioning from 4. Add it to your app to 5. Use v-model (optional).
Will submit such changes for review.

Copy link
Contributor Author

@gsqrt2 gsqrt2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Component name changed for this document only. The name was not changed in the v-model example because it is a pure vue demo embed that is reused in the Vue 3 installation example. Refactoring it could cause unnecessary complications.

@gsqrt2 gsqrt2 requested a review from hanspagel January 20, 2022 19:06
@hanspagel hanspagel merged commit 5a58153 into ueberdosis:main Jan 21, 2022
@hanspagel
Copy link
Contributor

Awesome! Thanks for your work on this. 🙏

@gsqrt2 gsqrt2 deleted the patch-1 branch January 21, 2022 10:13
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.

None yet

2 participants