Famabara

Посты по тегу: Nuxt

ChatGPT 5 - туфта, не заменит программистов (реальный пример на Nuxt 4)

3 дн. назад
OpenAI зарелизили ChatGPT 5 - очередную самую крутую модель своей нейросети. А что в итоге?
Мой промпт:
Я делаю build nuxt 3 / nuxt 4 приложения.
Как понять в какие чанки какие файлы залезли?
Почему чанки такие большие?

До этого спрашивал у 4-ки - предлагал ставить vite-bundle-visualizer. Сразу говорю - это не надо делать, всё уже есть встроенное. Сегодня появилась возможность спросить у 5-ки - повторно спросил. Пятый ChatGPT опять предлагает поставить пакет, на этот раз rollup-plugin-visualizer.

Окей, пытаюсь добиться у него информации, которая должна по моему мнению быть показана в ответе (CLI команды), ChatGPT 5 выдаёт:
Пытаюсь узнать про "npx nuxi analyze", он ищет в интернете и долго думает и всё равно выдаёт:
Показать полностью...
+1
4

Nuxt продан: Vercel, который владеет Next.js, теперь владеет и главным SSR-фреймворком для Vue

27 дн. назад
Новость пришла откуда не ждали: монополизация во фронтенде - Vercel купил Накст. Они и так владели Некстом (главным SSR-фреймворков для Реакта), а теперь у них руки добрались и до вьюшной экосистемы.

Об этом сообщил создатель NuxtJS - Daniel Roe (ник danielroe на Гитхабе). Чисто теоретически Накст остаётся независимым, а Vercel купил только NuxtLabs, а также нанял себе ключевых разработчиков Накста. А практически - у них теперь Nuxt и они теперь будут задавать направление развития.

Не знаю, хорошо это и плохо, но монополизация - это точно плохо.
+2
32

How to use Quill Editor with Nuxt 3 and SSR (Vue)

недавно
If you try to use Quill Editor with Nuxt 3 when rendering a page in SSR you will get this error:
500 document is not defined.
That means NodeJS doesn't have the global variable 'document'. Because SSR rendering is executed in
a NodeJS environment, not a browser.

The sad fact: <client-only> won't help with this problem. The problem with quill's code is that during import, it assumes it's being executed in the browser. I hope you remember that the code imported from the module is not just imported, but executed, i.e. the authors of Quill wrote it so that the 'document' object is immediately accessed there. Very bad.

One solution is to disable SSR, but its an awful solution. But the second solution is to use dynamic JS imports.

My <script lang="ts" setup> in QuillEditor.vue in Nuxt 3 project:
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
// import Quill from 'quill'; // SSR problem with 'document', need to use dynamic import
import type Quill from 'quill';

const elemForQuillEditor = ref<HTMLDivElement|null>(null);

let editor: null|Quill = null; // Do not store in ref() - it causes bugs!

// ...

async function createQuillAndSetListeners() {
  const Quill = (await import('quill')).default; // This is most important thing - usage of JS dynamic import

  if (!elemForQuillEditor.value) return;
  editor = new Quill(elemForQuillEditor.value, {
    theme: 'snow',
    modules: {
      history: {
        delay: 2000,
        maxStack: 500,
        userOnly: true,
      },
      toolbar: {
        container: [
          ['bold', 'italic', 'underline', 'strike'],
          ['link'],
          [{ list: 'ordered' }, { list: 'bullet' }],
          [{ script: 'sub' }, { script: 'super' }],
          [{ header: [1, 2, 3, 4, 5, 6, false] }],
          [{ color: [] }, { background: [] }],
          ['clean'],
          ['undo', 'redo'],
        ],
        handlers: {
          undo() {
            editor?.history.undo();
          },
          redo() {
            editor?.history.redo();
          },
        },
      },
    },
    placeholder: props.placeholder,
  });
  
  editor.on('text-change', () => {
    if (!editor) return;
    // ... my other code
  });
}

// ...

onMounted(createQuillAndSetListeners);

Now your Quill editor will work in Nuxt 3 even during SSR!
Показать полностью...
+2
19

What technologies does Famabara use?

1 г. назад
Famabara website uses Nuxt 3 as frontend. I like VueJS very much, that's why Nuxt was chosen.

SSR approach allows to have normal HTML on first page load and fast page switch due to SPA mode.

In backend Famabara uses Postgresql, NodeJS, Redis, Go.
+2
68
1