Stillat / meerkat-v1hub

Hub for Meerkat v1 bugs, issues; comments
0 stars 0 forks source link

Statamic 3 Migration #26

Closed JohnathonKoster closed 4 years ago

JohnathonKoster commented 4 years ago

Port of 1.5.80 Meerkat for Statamic 2 to Statamic v3 (task list WIP)

Host: Statamic 2, Statamic 3, etc. Pre-Host: Meerkat Core and other internal processes, should be capable of not relying on Host parsers

Addon Base

Control Panel

Note: Suricatta includes UI features not available in 1.5.80. These will be removed for the initial port.

Forms

Comment Submissions

Exporters

Translations - Control Panel and Error Messages

Integration

Caches

Antlers Tags

Note: Meerkat 2 for Statamic 3 has an automatic memory exhaustion protection.

Example of Recrusive

Templates should always check has_replies when recursively displaying comments:

{{ meerkat:responses as="comments" }}

    <ul>
    {{ comments }}
        <li>
            {{ id }} - {{ content_raw }}

            {{ if has_replies }}
            <ul>{{ *recursive comments* }}</ul>
            {{ /if }}
        </li>

    {{ /comments }}
    </ul>

{{ /meerkat:responses }}

Example of Flat List Rendering

{{ meerkat:responses include_unapproved="true" flat="true" }}

<ul class="list-none mx-auto mt-5 p-5">
    {{ comments }}
    <li class="relative flex w-full flow-root">
        <img src="https://picsum.photos/id/684/600/400" alt=""
             class="h-12 w-12 mt-1 border-gray-500 rounded-full border-4">

        <div class="relative">
            <p class="block font-bold p-3 lg:text-lg">{{ author.name }} says:</p>
            <p class="block static text-justify text-xs sm:text-sm lg:text-lg p-3">{{ content }}</p>

            <ul class="list-none p-3">
                <li><a href="#" data-meerkat-form="reply" data-meerkat-reply-to="{{ id }}">Reply</a></li>
            </ul>

        </div>
    </li>
    {{ /comments }}
</ul>

{{ /meerkat:responses }}

Example of Grouped Rendering

{{ meerkat:responses group_by_date="Y m, d" }}

{{ date_groups }}
<h2>Group: {{ date_group }}</h2>

<ul>
    {{ comments }}
    <li class="relative flex w-full flow-root">
        <img src="https://picsum.photos/id/684/600/400" alt=""
             class="h-12 w-12 mt-1 border-gray-500 rounded-full border-4">

        <div class="relative">
            <p class="block font-bold p-3 lg:text-lg">{{ author.name }} says:</p>
            <p class="block static text-justify text-xs sm:text-sm lg:text-lg p-3">{{ content }}</p>

            <ul class="list-none p-3">
                <li><a href="#" data-meerkat-form="reply" data-meerkat-reply-to="{{ id }}">Reply</a></li>
            </ul>
        </div>
    </li>
    {{ /comments }}
</ul>
{{ /date_groups }}

{{ /meerkat:responses }}

Example of Grouped Paginated Rendering

{{ meerkat:responses paginate="true" pageby="instance1" limit="2" group_by_date="Y m, d" }}

{{ date_groups }}
<h2>Group: {{ date_group }}</h2>

<ul>
    {{ comments }}
    <li class="relative flex w-full flow-root">
        <img src="https://picsum.photos/id/684/600/400" alt=""
             class="h-12 w-12 mt-1 border-gray-500 rounded-full border-4">

        <div class="relative">
            <p class="block font-bold p-3 lg:text-lg">{{ author.name }} says:</p>
            <p class="block static text-justify text-xs sm:text-sm lg:text-lg p-3">{{ content }}</p>

            <ul class="list-none p-3">
                <li><a href="#" data-meerkat-form="reply" data-meerkat-reply-to="{{ id }}">Reply</a></li>
            </ul>
        </div>
    </li>
    {{ /comments }}
</ul>
{{ /date_groups }}

{{ paginate.auto_links }}

{{ /meerkat:responses }}

However, the new recursive engine will now automatically wrap the <ul>{{ *recursive comments* }}</ul> template part in the appropriate if check if it is found to be missing.

Core

HTTP APIs

Meerkat Addon API

JohnathonKoster commented 4 years ago

Quick sneak peak of some of performance gains (still needs some work) and Artisan features coming in Meerkat for Statamic 3!

meerkat2_stats_sneakpeak

schmidtflo commented 4 years ago

Hey, I'm really looking forward using Meerkat in Statamic 3! Can you give a insight when it's basically ready for a first test? I'm currently moving all my posts from my old blog by hand into the new Statamic version, so I would need just the basic feature set at first :-)

JohnathonKoster commented 4 years ago

@schmidtflo Hoping to have early alpha builds out by the end of August. The main hold ups at the moment are some issues I'm running into with the ability to update comment data without issues, and a basic Control Panel integration.

I am planning on having the save issues and some other Core items completed by the end of this weekend to focus on an initial Control Panel view. After that open-alpha/developer previews will start and last as long as it's needed.

I am very excited about that stage; and here are some screenshots of it running in the Cool Writings starter kit:

threads_flat threads_grouped threads_grouped_paginated threads_nested threads_paginated

JohnathonKoster commented 4 years ago

@schmidtflo Things are now in beta! You can find more at https://statamic.com/addons/stillat/meerkat-statamic-3 or the new website https://meerkatcomments.com/