[BUG]: Get Snippets not working #1197

Closed
opened 2024-12-14 20:28:45 +00:00 by mwweb · 2 comments

What Happened?

Attempting to import new snippets, and JCB just sits doing nothing, saying Getting available libraries
loading.....

Steps to reproduce the Bug

Go to JCB Dashboard, click on Snippets, then click on the Get Snippets button in the upper right corner.

Which Joomla version are you compiling in?

5.2.2

Which PHP version are you compiling in?

8.2.21

Which Joomla versions are you targeting?

5.x

Which PHP version are you targeting?

8.1+

Which Web server is JCB running on?

Apache/2.4.59 (Debian)

Which Relational Database is JCB running on?

11.4.2-MariaDB-ubu2404

Which OS is JCB running on?

Ubuntu 22.04.1 LTS

Which JCB version are you using?

v5.0.3

Where in JCB did this issue occur?

Snippet(admin_view), Snippets(admin_views)

On which browsers did you encounter the issue?

Firefox

Additional Comments

I'm unsure if this supposed to work in the current version, or whether it is still a work in progress.

Looking at developer tools in FireFox, under console there is the following error:

Uncaught TypeError: jQuery.get(...).success is not a function getLibraries http://{site]/administrator/components/com_componentbuilder/assets/js/get_snippets.js?50e431:81 <anonymous> http://[site]/administrator/components/com_componentbuilder/assets/js/get_snippets.js?50e431:16 jQuery 13 mightThrow process setTimeout handler*Deferred/then/resolve/< fire fireWith fire fire fireWith ready completed EventListener.handleEvent* <anonymous> <anonymous>

### What Happened? Attempting to import new snippets, and JCB just sits doing nothing, saying **_Getting available libraries loading....._** ### Steps to reproduce the Bug Go to JCB Dashboard, click on Snippets, then click on the Get Snippets button in the upper right corner. ### Which Joomla version are you compiling in? 5.2.2 ### Which PHP version are you compiling in? 8.2.21 ### Which Joomla versions are you targeting? 5.x ### Which PHP version are you targeting? 8.1+ ### Which Web server is JCB running on? Apache/2.4.59 (Debian) ### Which Relational Database is JCB running on? 11.4.2-MariaDB-ubu2404 ### Which OS is JCB running on? Ubuntu 22.04.1 LTS ### Which JCB version are you using? v5.0.3 ### Where in JCB did this issue occur? Snippet(admin_view), Snippets(admin_views) ### On which browsers did you encounter the issue? Firefox ### Additional Comments I'm unsure if this supposed to work in the current version, or whether it is still a work in progress. Looking at developer tools in FireFox, under console there is the following error: `Uncaught TypeError: jQuery.get(...).success is not a function getLibraries http://{site]/administrator/components/com_componentbuilder/assets/js/get_snippets.js?50e431:81 <anonymous> http://[site]/administrator/components/com_componentbuilder/assets/js/get_snippets.js?50e431:16 jQuery 13 mightThrow process setTimeout handler*Deferred/then/resolve/< fire fireWith fire fire fireWith ready completed EventListener.handleEvent* <anonymous> <anonymous>`
mwweb added the
Bug
label 2024-12-14 20:28:45 +00:00
Owner

Thank you for bringing this up. I want to share an update on the current progress and the new direction we're taking with JCB regarding content distribution, including Snippets.

The New SuperPower Implementation

jcb-future.jpeg

We are moving away from the current Snippets implementation to align it with the recently introduced SuperPower architecture. This approach significantly improves stability, scalability, and maintainability. Here's a high-level overview of how the new system functions:

  1. FieldTypes as a Model:

    • In the new system, areas like FieldTypes already utilize this approach.
    • Each FieldType now has three key actions:
      • Init: Pulls all FieldTypes from the global repository and initializes them locally.
      • Reset: Updates a specific FieldType by pulling its latest version from the global repository.
      • Push: Allows users to push their local changes to the global repository, facilitating collaboration.
  2. Repositories and Content Types:

    • A new Repositories feature enables users to create and manage repositories.
    • Supported content types include:
      • SuperPower
      • JoomlaPower
      • JoomlaFieldTypes
    • Depending on the selected content type, users can set up repositories that allow for pushing and pulling changes.
  3. Community-Driven Repositories:

    • Users can create their own repositories (e.g., for FieldTypes, SuperPowers, or JoomlaPowers), clone the global repositories, and maintain them independently.
    • This decoupled approach promotes collaboration, enabling community members to contribute back to the global repositories.

Snippets Migration

We plan to migrate Snippets to the SuperPower system to benefit from this new architecture. This migration will include the following features:

  • Snippets will be repository-based, similar to FieldTypes.
  • Users will be able to push their Snippets to a global repository after proper discussions and approvals.
  • A system of permissions will ensure contributors can collaborate effectively while maintaining quality control.
  • Tutorials will follow to guide users through the process of setting up repositories, managing content, and contributing to global repositories.

Advantages of the New System

  1. Stability and Scalability:

    • Decoupling content distribution from the database makes the system more robust.
    • By using repositories, users can better manage their data and updates.
  2. Flexibility:

    • Users can maintain their own versions of repositories and push updates to global repositories when needed.
    • Future areas such as fields, layouts, templates, site views, admin views, and even complete components will adopt this repository-based architecture.
  3. Decentralization:

Next Steps

We are finalizing the API implementation and integrating it into the architecture. Once stable, we will:

  1. Finalize individual areas in JCB (Snippets, fields, layouts, etc.).
  2. Create detailed tutorials to help users understand and use this new architecture.
  3. Announce the new features widely to the community.

This new repository-based content distribution system represents a significant step forward for JCB, providing Git-like functionality for managing and sharing component data.

Conclusion

The GetSnippets feature is part of a broader reimplementation effort to align with the new SuperPower architecture. While the existing system has limitations, the new approach will introduce enhanced stability, flexibility, and collaboration opportunities. We appreciate your patience as we continue to refine and deploy this new system.

If you have any further questions or suggestions, please feel free to reach out.

Thank you for bringing this up. I want to share an update on the current progress and the new direction we're taking with JCB regarding content distribution, including Snippets. #### **The New SuperPower Implementation** ![jcb-future.jpeg](https://git.vdm.dev/attachments/1832402f-f0d7-4cb0-b05c-6173d9a055c8) We are moving away from the current Snippets implementation to align it with the recently introduced **SuperPower** architecture. This approach significantly improves stability, scalability, and maintainability. Here's a high-level overview of how the new system functions: 1. **FieldTypes as a Model**: - In the new system, areas like **FieldTypes** already utilize this approach. - Each FieldType now has **three key actions**: - **Init**: Pulls all FieldTypes from the global repository and initializes them locally. - **Reset**: Updates a specific FieldType by pulling its latest version from the global repository. - **Push**: Allows users to push their local changes to the global repository, facilitating collaboration. 2. **Repositories and Content Types**: - A new **Repositories** feature enables users to create and manage repositories. - Supported content types include: - **SuperPower** - **JoomlaPower** - **JoomlaFieldTypes** - Depending on the selected content type, users can set up repositories that allow for **pushing** and **pulling** changes. 3. **Community-Driven Repositories**: - Users can create their own repositories (e.g., for FieldTypes, SuperPowers, or JoomlaPowers), clone the global repositories, and maintain them independently. - This decoupled approach promotes collaboration, enabling community members to contribute back to the global repositories. #### **Snippets Migration** We plan to migrate **Snippets** to the SuperPower system to benefit from this new architecture. This migration will include the following features: - Snippets will be **repository-based**, similar to FieldTypes. - Users will be able to **push** their Snippets to a global repository after proper discussions and approvals. - A system of permissions will ensure contributors can collaborate effectively while maintaining quality control. - Tutorials will follow to guide users through the process of setting up repositories, managing content, and contributing to global repositories. #### **Advantages of the New System** 1. **Stability and Scalability**: - Decoupling content distribution from the database makes the system more robust. - By using repositories, users can better manage their data and updates. 2. **Flexibility**: - Users can maintain their own versions of repositories and push updates to global repositories when needed. - Future areas such as fields, layouts, templates, site views, admin views, and even complete components will adopt this repository-based architecture. 3. **Decentralization**: - Decentralization for JCB is becoming a reality! - **Network Status**: [https://status.vdm.dev/status/jcb](https://status.vdm.dev/status/jcb) - **API Endpoint**: [https://api.joomlacomponentbuilder.com/v1/network/community/jcb](https://api.joomlacomponentbuilder.com/v1/network/community/jcb) - By decentralizing the system, we prevent a single point of failure. Multiple clones of the same dataset ensure availability and reliability. - Soon, this will be fully integrated into JCB, effectively achieving decentralization. [Huge calibration!] #### **Next Steps** We are finalizing the API implementation and integrating it into the architecture. Once stable, we will: 1. Finalize individual areas in JCB (Snippets, fields, layouts, etc.). 2. Create detailed tutorials to help users understand and use this new architecture. 3. Announce the new features widely to the community. This new repository-based content distribution system represents a significant step forward for JCB, providing Git-like functionality for managing and sharing component data. #### **Conclusion** The GetSnippets feature is part of a broader reimplementation effort to align with the new SuperPower architecture. While the existing system has limitations, the new approach will introduce enhanced stability, flexibility, and collaboration opportunities. We appreciate your patience as we continue to refine and deploy this new system. If you have any further questions or suggestions, please feel free to reach out.
Owner

🎉 Update on Snippets: New Contribution Workflow via JCB's Built-In Push Engine

We’re excited to announce that the Snippet system in JCB has been completely rebuilt with a modern Git-based workflow that’s tightly integrated into the builder itself — and this will be part of the next stable release (not yet included in the current beta).

Previously, exporting and sharing snippets was manual and error-prone, involving ZIP files and external tools. That’s now a thing of the past.


🧩 The New Snippet Repository

All official snippets are now maintained here:
👉 https://github.com/joomengine/snippets

This repository is a GitHub mirror of our source repository:
👉 https://git.vdm.dev/joomla/snippets

We encourage everyone to use GitHub for contributions, but both repositories accept pull requests and are kept in sync.


🚀 How to Contribute Snippets (Using JCB’s Native Push Engine)

Contributing snippets is now done entirely from within JCB, using its built-in Git integration. Here's how it works:

Step 1: Fork the Official Snippets Repository

  1. Go to: https://github.com/joomengine/snippets
  2. Click “Fork” to create your own copy under your GitHub account.
  3. This fork will act as your working space for contributions.

Note: This can also be done with a compatible Gitea-based instance if you prefer self-hosting.


Step 2: Configure the Fork in JCB

  1. Open the Repositories area in JCB.

  2. Add a new repository entry with your forked details.

  3. Set the Content Type to Snippets.

  4. Provide the following:

    • The clone details of your fork (GitHub or Gitea) like [org]/[repo].
    • The branch you want to write to (e.g., main or develop).
    • A valid access token or authentication credentials that allow JCB to push directly to that repository.

Step 3: Push Snippets from JCB

  1. Go to the Snippets section in JCB.
  2. Select one or multiple snippets from the list view and click “Push”,
    or open an individual snippet and use the “Push” button inside the form.
  3. JCB will push the snippet(s) directly to the branch and repository you've configured.

You can now go to GitHub and open a Pull Request (PR) from your fork to the upstream repository.

Once your PR is reviewed and merged, your snippets will become part of the official collection and be available to all users.


💡 Why This Is a Game-Changer

  • 🛠️ No ZIP files — fully Git-native workflow.
  • Snippets are versioned, trackable, and portable.
  • 🔒 Secure via token-authenticated pushes.
  • 🔁 Real-time integration into your forked repository.
  • 🔄 Unified process for GitHub or Gitea-based hosting.

🐞 Found a Bug?

If you encounter a problem or something doesn't work as expected, please open an issue here:
👉 https://git.vdm.dev/joomla/Component-Builder/issues

💬 Want to Suggest a New Feature or Library?

Join the conversation in our Discussions area:
👉 https://github.com/orgs/joomengine/discussions


By streamlining snippet contributions into JCB itself, we’ve made it faster, safer, and easier than ever to collaborate. This isn't just a fix — it’s a complete reinvention of how JCB users build and share powerful snippets.

Let us know how it works for you! 🚀

🎉 **Update on Snippets: New Contribution Workflow via JCB's Built-In Push Engine** We’re excited to announce that the Snippet system in JCB has been **completely rebuilt** with a modern Git-based workflow that’s tightly integrated into the builder itself — and this will be part of the **next stable release** (not yet included in the current beta). Previously, exporting and sharing snippets was manual and error-prone, involving ZIP files and external tools. That’s now a thing of the past. --- ### 🧩 The New Snippet Repository All official snippets are now maintained here: 👉 **[https://github.com/joomengine/snippets](https://github.com/joomengine/snippets)** This repository is a **GitHub mirror** of our source repository: 👉 **[https://git.vdm.dev/joomla/snippets](https://git.vdm.dev/joomla/snippets)** We encourage everyone to use **GitHub for contributions**, but both repositories accept pull requests and are kept in sync. --- ### 🚀 How to Contribute Snippets (Using JCB’s Native Push Engine) Contributing snippets is now **done entirely from within JCB**, using its built-in Git integration. Here's how it works: #### ✅ Step 1: Fork the Official Snippets Repository 1. Go to: [https://github.com/joomengine/snippets](https://github.com/joomengine/snippets) 2. Click **“Fork”** to create your own copy under your GitHub account. 3. This fork will act as your working space for contributions. > Note: This can also be done with a compatible Gitea-based instance if you prefer self-hosting. --- #### ✅ Step 2: Configure the Fork in JCB 1. Open the **Repositories** area in JCB. 2. Add a new repository entry with your forked details. 3. Set the **Content Type** to `Snippets`. 4. Provide the following: * The **clone** details of your fork (GitHub or Gitea) like [org]/[repo]. * The **branch** you want to write to (e.g., `main` or `develop`). * A **valid access token** or authentication credentials that allow JCB to push directly to that repository. --- #### ✅ Step 3: Push Snippets from JCB 1. Go to the **Snippets** section in JCB. 2. Select one or multiple snippets from the list view and click **“Push”**, *or* open an individual snippet and use the **“Push”** button inside the form. 3. JCB will push the snippet(s) directly to the branch and repository you've configured. You can now go to GitHub and open a **Pull Request (PR)** from your fork to the upstream repository. Once your PR is reviewed and merged, your snippets will become part of the official collection and be available to all users. --- ### 💡 Why This Is a Game-Changer * 🛠️ **No ZIP files** — fully Git-native workflow. * ✨ **Snippets are versioned**, trackable, and portable. * 🔒 **Secure via token-authenticated pushes**. * 🔁 **Real-time integration** into your forked repository. * 🔄 **Unified process** for GitHub or Gitea-based hosting. --- ### 🐞 Found a Bug? If you encounter a problem or something doesn't work as expected, please open an issue here: 👉 [https://git.vdm.dev/joomla/Component-Builder/issues](https://git.vdm.dev/joomla/Component-Builder/issues) ### 💬 Want to Suggest a New Feature or Library? Join the conversation in our Discussions area: 👉 [https://github.com/orgs/joomengine/discussions](https://github.com/orgs/joomengine/discussions) --- By streamlining snippet contributions into JCB itself, we’ve made it faster, safer, and easier than ever to collaborate. This isn't just a fix — it’s a complete reinvention of how JCB users build and share powerful snippets. Let us know how it works for you! 🚀
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1197
No description provided.