Custom React libraries
Overview
Uncodie will allow the creation of React component libraries (and other frameworks later) through a GIT repository that is easily integrated into new advanced projects regardless of its backend.
Setup
When creating a project, the user chooses component libraries as the type of project
In Web Application within the configuration section of the project
When creating a project in the modal within the web app
In the Uncodie Plugin when creating a new project
Add the data from your git repository
When compiling, a storybook project is generated, dependencies are installed, built is done, your git repository is updated and a project in storybook development is hosted (this must be hosted only temporarily))
Features
Modularization
The components can be imported as modules in another project
Preview
You can preview the components in the "Code Inspector" section of the uncodie App
Usage
The components can be used in any React project as any other React component
Version Control
The library versions can be seen as any other project git in your repository or uncodie "Version Control" section in the app
Continuous Integration
The generated code can be used with CI without requiring additional modifications to the code generated by Uncodie or in your project
Clean code
The system will generate code as usable and readable as possible to comply with the readability standards of international equipment
Storybook
The system will generate folders for each component with their corresponding variants for better organization
Automatic shutdown
When compiling a component library project, the hosting must be automatically turned off 60 minutes after its last compilation
Component API
Components must expose all their IDE functionalities, such as properties, functions, events, states, variants, and styles, for easy use in projects
States and Local Context
To bind your Figma component props and values use data binding and local variables in the Uncodie Plugin, for more information see:
Once you have added some props and bindings in your component you can use react states:
You can use repeat componet to display dynamic data as arrays, for more information see:
Props
Any prop of the children can be modified, overwriting its value from the instance, for example:
You must list the properties of the component and publish them in an information document in the Code Inspector section.
Functions Access
Styles Access
You can delcare any additional style to your component using the "style" object in your component and component chidlren´s. Simply send a JSON conataining the key value props for any W3C CSS value and your component will handle the rest.
When changing the style property, you can change the style of the parent component or children´s using the same logic.
Variants Access and Settings
Variant name is the component variant in figma
You must be able to change the variant of the component through the variant attribute
Access to native events
You can access to any of the React and Javascript native events in your component or component children's
Access to external component events
In case the component is configured as an external component, you must be able to list and access the events of the same
Comonent children´s access
Use Cases
GIT Setup
The system will detect when the user does not have GIT and take him to the tutorial, explaining its relevance and the configuration section
Generate Component Library
Create a git library of my components in figma and uncodie and use them with continuous integration in my main code project
1. Compile figma file
As a git component library with a build of the library so that it can be used as a component
2. Library commit and push
Each time it is compiled, a new version of the components must be generated in git
3. Library preview
You must be able to access the hosted storybook of the project
Compile your project
Navigate to the domain of the project where the storybook of thecomponentes
Integrate components into a React project already in progress
Git Setup
Compile library in Figma
Integrate your git repository in your project as a new dependency
Import your components
Run your project
Visualize behaviors of components
Setup Library
Configure component by adding actions, etc..
Compile library
Navigate to the domain of the project where the storybook of the components will be displayed
Visualize APIs, modifying props, states, functions, seeing the responses generated by the component, etc..
Project Start/Stop
Navigate to your project
Click on turn off/on
Known Limitations
Gitlab
The CLI only works with gitalb at the moment
Considerations
Git Setup
A Gitlab account is required to export and import the generated library using your own account, Uncodie will provide a general git, the best practice is to setup your own.
Last updated
Was this helpful?