![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@geeks.solutions/vue-sections
Advanced tools
A VueJS client to interface with Sections Serverless Page Building and rendering engine
Sections is an efficient serverless app relying on modern technologies to increase page render speed and facilitate the work of frontend developers. This package provide a VueJS Component to use right off the bat to interface with Sections' server
In order to benefit from this service you should register for free on the following link
Is a vue.js 2 wrapper for sections. It doesn't work yet on a vue3 project and for now it requires installation of vue-i18n to properly work. You can use vue-i18n on your project as usual, in case you don't need to use vue-i18n, then this library will display its strings in English without the need to set a specific configuration for vue-i18n on your project.
It has also been tested on a nuxtJS project and it's working when used as plugin that is installed with NO SSR.
Make sure to have your projectID, then install the library on your project
npm install @geeks-solutions/vue-sections
Configure the library, the possible configurations are as follow:
projectId
: The ID of you project, you get it from your project interface after your register to sectionsenvironment
: to use only for development purposes set it to "testing" if you want your requests to be directed to sections test serverprojectUrl
: to use only if you intend to run sections in SSR set it to the project url you defined in your project interface on sections back office.queryStringSupport
: to use only if you intend to use query strings on your project set it to enabled
. Enabling it on a project that does not have access to query strings will return errors when getting pages.Vue:
import Sections from '@geeks-solutions/vue-sections'
...
Vue.use(Sections, {projectId: "60352afc1ad7f0006327a38"})
Nuxt SSR:
> Inside nuxt.config.js:
plugins: [
{ src: '~/plugins/sections.js', ssr: false}
],
........................
> Inside plugins/sections.js:
import Vue from "vue";
import Sections from "@geeks-solutions/vue-sections";
export default function() {
Vue.use(Sections, {
projectId: "60352afc1ad7f0006327a38",
projectUrl: "http://localhost:3000",
environment: "testing"
});
}
cookie-universal-nuxt
& nuxt-i18n
must be installed on the host project.nuxt-i18n
, add the following configuration inside nuxt.config.js:modules: [
... ,
[
"nuxt-i18n",
{
lazy: true,
locales: [
{
name: "English",
code: "en",
iso: "en",
file: "en-EN.js"
},
{
name: "French",
code: "fr",
iso: "fr-FR",
file: "fr-FR.js"
}
],
loadLanguagesAsync: true,
langDir: "lang/",
defaultLocale: "en"
}
],
],
Then add the sections component on the page(s) of your choice
<template>
<div id="app">
<Sections
:admin="admin"
:pageName="pageName"
:variations="[]"
@finishLoad="sectionsLoaded"
/>
</div>
</template>
<script>
export default {
name: "App",
data() {
return {
admin: false,
pageName: "home"
};
},
methods: {
sectionsLoaded() {
this.admin = !!this.$cookies.get("sections-auth-token");
}
}
};
</script>
Here we load props from data on the page, the admin prop is used to indicate if the edit interface for the page should display or not. Sections uses a cookie named sections-auth-token
to store a user token to secure communications for page editing actions, if the cookie is found it assumes the edit button should show. In case you want to know whether the sections are loaded, You can use @finishLoad in your Sections component with a method name. Don't forget to add the method in the methods object.
To get the UserToken and have it stored in the above cookie, simply set sections on a page of your website, then head to your Sections project page (where you have your projectID) and set the login redirect url properly, then hit connect sections to my app. This library will receive and process the request to generate the UserToken and store it in the cookie for further use. for more information check the docs
If you now want to move on and start providing local and static sections for your website editor, or customize the display of dynamic or configurable ones, read below.
Sections server comes with a Wysiwyg and any public sections out of the box. The Wysiwg can be added to any page and will display of the box thanks to internal components, yet if you wish to override anything (the view, the icon or the form) you can do so be redeclaring any (or all) component(s) in your project.
You can also define your own local and static section types and you have the ability to control the way any section will display on your website.
You do this by creating custom VueJS components and placing them in the right configurations folder.
For now this is not configurable and you should have a @/sections
folder where to put your components (@ pointing to any folder declaration you have defined in your project, i.e @ -> /src
on a vueJs project. @ -> /
on a NuxtJs project etc..).
The configurations folder follows the following structure:
@/sections
|_ views
|_ {your-component}_{section-type}.vue
|_ type-icons
|_ {your-component}.vue
|_ forms
|_ {your-component}.vue
views
folder will contain the design of your component that will be displayed on the page to your visitors (and during preview)type-icons
folder will contain the icons that will illustrate your section in the add a new section box for content editors.forms
is the folder where you create the form that will help you fill the data while adding or editing your-component
to your page. This is only for static section types, local and dynamic ones persist no data and configurable ones have their data entry form automatically built by the library as this comes from the third party developer providing this section.In case you are trying to use a section that you haven't properly declared on your project, a warning will display in the console indicating where sections is epxecting the component to be located according to your configuration.
addNewStaticType(sectionTypeName)
a helper function that takes a string of sectionTypeName that help to declare ready to use section types###Example on how to use the function:
import {addNewStaticType} from "@geeks-solutions/vue-sections";
async addStaticType(sectionTypeName) { // where sectionTypeName is the name of the sectionType to be added of type String, example: const sectionTypeName = "newSection"
await addNewStaticType(sectionTypeName).then((res) => {
// res is {status: 'success'} on successful request
// res is {status: 'error', message: errorMessage} on failed request
})
},
globalFileUpload
A function that uses media to upload images replacing the base64 format and removing old media.import {globalFileUpload} from "@geeks-solutions/vue-sections";
It is an async function that returns an object of the function result. ###Example on how to use the function:
async onFileSelected(e) {
this.file = this.$refs.imagePick.files[0] //your uploaded file
await globalFileUpload(this.file, oldMediaID).then(
(result) => {
this.settings.url = result.data.files[0].url //assign the result url to the settings object to be able to read that value in $section.settings in you static component
}
)
},
deleteMedia
A function helper to remove media.import {deleteMedia} from "@geeks-solutions/vue-sections";
It is an async function that returns an object of the function result. ###Example on how to use the function:
async removeImage() {
const id = this.settings.image.id
await deleteMedia(id).then(
(result) => {
console.log(result)
}
)
},
Add "bootstrap-vue": "^2.21.2" to the package json dependencies
Add 'bootstrap-vue/nuxt', to nuxt.config.js in modules
modules: [
'bootstrap-vue/nuxt',
]
If you wish to contribute to this project, head to this wiki and follow the instructions there.
FAQs
A VueJS client to interface with Sections Serverless Page Building and rendering engine
The npm package @geeks.solutions/vue-sections receives a total of 1 weekly downloads. As such, @geeks.solutions/vue-sections popularity was classified as not popular.
We found that @geeks.solutions/vue-sections demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.