
Dil 🇹🇷 Türkçe
Dokümantasyon
Başlarken
Kullanım
Yapılandırma
Add Comments to Your SolidJS App
Bu, FastComments için resmi SolidJS Kütüphanesidir.
SolidJS uygulamanıza canlı yorum, sohbet ve inceleme widget'larını yerleştirin.
Depo
Canlı Demo 
Her widget'i canlı olarak https://fastcomments.com/commenting-system-for-solidjs adresinde deneyin.
Kullanım 
import { FastCommentsCommentWidget } from 'fastcomments-solidjs';
export default function App() {
return <FastCommentsCommentWidget tenantId="demo" urlId="some-page-id" />;
}
Yapılandırma değişikliklerine tepki (imperatif işleyici) 
Solid rastgele nesnelerde derin değişiklikleri otomatik olarak takip etmez, bu nedenle
ilk render'dan sonra yapılandırma değişiklikleri açıkça gönderilmelidir. Her widget
bir handle döndüren bir apiRef kabul eder; reaktiviteyi tetiklemek için bir
createEffect içinde handle.update(partial) çağırın:
import { createEffect, createSignal } from 'solid-js';
import { FastCommentsCommentWidget, type FastCommentsCommentWidgetHandle } from 'fastcomments-solidjs';
export default function Paginated() {
const [page, setPage] = createSignal(0);
let handle: FastCommentsCommentWidgetHandle | undefined;
createEffect(() => handle?.update({ urlId: `product-${page()}` }));
return (
<>
<button onClick={() => setPage(page() + 1)}>next</button>
<FastCommentsCommentWidget
apiRef={(h) => (handle = h)}
tenantId="demo"
urlId={`product-${page()}`}
/>
</>
);
}
update() her zaman güvenle çağrılabilir:
- Script yüklenmeden önce: partial saklanır ve init sırasında uygulanır.
- Asenkron bir init sırasında (reviews-summary, user-activity-feed): partial kuyruğa alınır ve callback çözüldüğünde uygulanır.
- Init'ten sonra: canlı widget'ın
.update()metoduna doğrudan iletilir.
İmperatif handle API
interface WidgetHandle<Config> {
getInstance: () => WidgetInstance | null; // en son canlı örnek (veya mount öncesi null)
onInstance: (cb: (instance: WidgetInstance) => void) => void; // örnek hazır olduğunda bir kez tetiklenir
update: (partial: Partial<Config>) => void; // yapılandırmayı birleştir ve gönder
}
.update() tarafından kapsanmayan imperatif işlemler için getInstance() kullanın, örn. openProfile:
const openProfile = () =>
(handle?.getInstance() as { openProfile?: (o: { userId: string }) => void } | null)
?.openProfile?.({ userId: 'demo' });
Bileşenler 
Her fastcomments-react içindeki her widget aynı isimle kullanılabilir:
| Component | Handle type | Embed loaded |
|---|---|---|
FastCommentsCommentWidget |
FastCommentsCommentWidgetHandle |
Amiral gemisi canlı yorum widget'ı |
FastCommentsCommentCountWidget |
FastCommentsCommentCountWidgetHandle |
Satır içi yorum sayısı rozeti |
FastCommentsLiveChatWidget |
FastCommentsLiveChatWidgetHandle |
Akışlı canlı sohbet widget'ı |
FastCommentsCollabChatWidget |
FastCommentsCollabChatWidgetHandle |
Metne dayalı işbirlikçi sohbet |
FastCommentsImageChatWidget |
FastCommentsImageChatWidgetHandle |
Bölge tabanlı resim yorumları |
FastCommentsRecentCommentsWidget |
FastCommentsRecentCommentsWidgetHandle |
Son yorumlar beslemesi |
FastCommentsRecentDiscussionsWidget |
FastCommentsRecentDiscussionsWidgetHandle |
Son tartışmalar beslemesi |
FastCommentsReviewsSummaryWidget |
FastCommentsReviewsSummaryWidgetHandle |
Yıldız değerlendirme özeti |
FastCommentsTopPagesWidget |
FastCommentsTopPagesWidgetHandle |
En çok yorumlanan sayfalar lider tablosu |
FastCommentsUserActivityFeedWidget |
FastCommentsUserActivityFeedWidgetHandle |
Kullanıcı bazlı etkinlik zaman çizelgesi |
Mevcut bir öğeye eklenen widget'lar
FastCommentsCollabChatWidget ve FastCommentsImageChatWidget, çağıran tarafından sağlanan bir
öğeye monte olur. Monte edildikten sonra öğeyi döndüren bir targetRef erişici sağlayın:
import { FastCommentsImageChatWidget } from 'fastcomments-solidjs';
export default function ImageChat() {
let img: HTMLImageElement | undefined;
return (
<>
<img ref={img} src="/screenshot.png" alt="" />
<FastCommentsImageChatWidget
tenantId="demo"
urlId="my-image"
targetRef={() => img}
/>
</>
);
}
Bölgeler
Widget trafiğini AB kümesi üzerinden yönlendirmek için region="eu" verin.
Yardıma mı ihtiyacınız var?
SolidJS Kütüphanesi ile ilgili herhangi bir sorunla karşılaşırsanız veya sorularınız varsa, lütfen:
Katkıda Bulunma
Katkılar memnuniyetle karşılanır! Katkı yönergeleri için lütfen GitHub deposunu ziyaret edin.