custom-features
ما الذي تفعله
توضح هذه المهارة كيف تبني ميزة قابلة لإعادة الاستخدام، أو إضافة، تضيف حالة أو سلوكًا جديدًا إلى TanStack Table. وهي موجهة للمطورين المتقدمين الذين لا تغطي احتياجاتهم الميزات المدمجة.
متى تستخدمها
- ✓عندما تحتاج إلى حالة أو سلوك قابل لإعادة الاستخدام يجب إضافته إلى كائنات الجدول.
- ✓عندما لا تكفي الخيارات المدمجة وmeta المكتوبة لإعدادات المُعرِض أو التطبيق.
- ✓عندما تكتب إضافة يجب أن تسجل خطافات دورة الحياة ودوال الجدول بشكل صحيح.
رابط المهارة
https://github.com/TanStack/table/blob/main/packages/table-core/skills/custom-features/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“الميزات المدمجة في TanStack Table لا تغطي ما أحتاجه. كيف أكتب إضافتي الخاصة؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تمر على تعريف الميزة، والحفاظ على حالة المستخدم، وإضافة دوال للجدول وللكائنات أثناء خطافات دورة الحياة، ثم تسجيل الإضافة بكائن ميزة ثابت.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Author a custom feature
Read core and feature architecture first. Use a plugin for reusable state or behavior that must augment Table objects. Built-in options and typed tableMeta/columnMeta are usually enough for renderer callbacks and application configuration.
Implementation workflow
- Identify the state, options, and object methods the behavior owns. If it only passes callbacks or renderer data, read scoped meta typing and use meta instead.
- Before declaring plugin types or writing lifecycle hooks, read the complete plugin example. It enumerates all 10 public FeatureMaps, the API assignment helpers, lifecycle ordering, and the advanced row-model maps.
- Declare the feature key in
Plugins. Merge only FeatureMaps with matching runtime implementations; declarations alone install no behavior. - Preserve user state after defaults in
getInitialState; connect state updaters in default options. Install table methods withassignTableAPIsand object methods withassignPrototypeAPIsinside the corresponding lifecycle hooks. - Keep the feature object and
tableFeatures({ customFeature })result stable. Register the plugin throughtableFeaturesso inference and composition include it. - Verify the advertised state, options, methods, and resets on a constructed table. Each declared API must exist at runtime; reset behavior must respect the state owner.
Lifecycle boundaries
Use initTableInstanceData for mutable data owned by one table and resetTableInstanceData for clearing its transient contents. All feature initialization finishes before any constructTableAPIs hook. Keep method installation separate from data allocation.
Prototype methods are shared across the table's rows, columns, cells, or headers. Read per-object values through the method's current instance, and use the supported instance-data hooks for mutable fields. Read the example's installation rules before adding memoized methods or advanced row-model/cache wiring.
Common failures
- Types without matching runtime hooks advertise APIs that do not exist.
- Ad hoc mutation of constructed instances bypasses feature registration and inferred composition.
- Treating the density example as the only extension pattern misses column definitions and the other public FeatureMaps. Choose the maps required by the behavior; advanced row-model declarations also require runtime pipeline/cache wiring.
Installed API discovery
Inspect node_modules/@tanstack/table-core/dist/types/TableFeatures.d.ts, the exported *_FeatureMap interfaces in dist/types/, and assignTableAPIs/assignPrototypeAPIs in dist/utils.d.ts. Follow declarations under dist/features/ for comparable stock lifecycle signatures.
الأسئلة الشائعة
متى لا يجب أن أكتب ميزة مخصصة؟
تقول المهارة إنه إذا كان السلوك يمرر دوال الاستدعاء أو بيانات المُعرِض فقط، فاستخدم meta المكتوبة بدلًا منها.
هل يثبّت تعريف النوع السلوك نفسه؟
لا. تقول المهارة إن التعريفات وحدها لا تثبّت شيئًا، لذلك يجب أن تطابق التنفيذات وقت التشغيل الأنواع المعلنة.
أين أسجل الإضافة؟
عبر استدعاء tableFeatures، حتى يشملها استنتاج الأنواع والتركيب.
التفاصيل
الوصف الأصلي من المؤلف
Implement a Table v9 plugin when built-ins and typed meta are insufficient. Covers FeatureMaps, runtime lifecycle hooks, prototypes, and a complete checked example.
repo: TanStack/table
الشعبية
- نجوم GitHub
- 29k
- الترتيب
- #9835
- الترخيص
- MIT
- آخر تحديث
- 21/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
getting-started
29kيعلّم وكيلك كيف يبني جدول بيانات ويعرضه باستخدام TanStack Table في Alpine.js، ويشمل الإعداد والبيانات التفاعلية وعرض الصفوف.
table-state
29kيعلّم وكيلك كيف يقرأ حالة الجدول ويتحكم بها في Alpine.js، مثل الصفحة الحالية، حتى تتحدث الشاشة عند تغيّر هذه الحالة.
devtools
29kيعلّم وكيلك كيف يسجّل جداول Angular في لوحة TanStack Devtools، ليتمكن المطورون من فحص كل جدول أثناء بناء التطبيق.
getting-started
29kيعلّم وكيلك كيف ينشئ جدول TanStack في Angular ويعرضه، ويشمل إعداد injectTable وعرض القالب وتحديث بيانات الصفوف.
مهارات مشابهة
angular-developer
280kيساعد وكيلك على كتابة شيفرة Angular وتقديم نصائح لبنية المشروع، ويفيد في بدء المشاريع الجديدة وإنشاء المكونات وتحسين الأداء وإمكانية الوصول.
frontend-a11y
280kيساعد وكيلك على جعل واجهات الويب متاحة للجميع، فيضمن أن المواقع والتطبيقات تعمل جيدًا مع قارئات الشاشة والتنقل بلوحة المفاتيح.
frontend-patterns
280kيطبّق وكيلك أنماط تطوير الواجهات الحديثة، فيحسّن الأداء ويدير الحالة ويتبع أفضل الممارسات في React وNext.js.