Code - Anima Blog https://www.animaapp.com/blog/code/ Thu, 01 Aug 2024 13:28:54 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 Minimizing LLM latency in code generation https://www.animaapp.com/blog/frontier/minimizing-llm-latency-in-code-generation/ https://www.animaapp.com/blog/frontier/minimizing-llm-latency-in-code-generation/#respond Thu, 01 Aug 2024 09:05:33 +0000 https://www.animaapp.com/blog/?p=10119 Reading Time: 2 minutes Discover how Frontier optimizes front-end code generation with advanced LLM techniques. Explore our solutions for balancing speed and quality, handling code isolation, overcoming browser limitations, and implementing micro-caching for efficient performance.

The post Minimizing LLM latency in code generation appeared first on Anima Blog.

]]>
Reading Time: 2 minutes

Optimizing Frontier’s Code Generation for Speed and Quality

Introduction

Creating Frontier, our generative front-end coding assistant, posed a significant challenge. Developers demand both fast response times and high-quality code from AI code generators. This dual requirement necessitates using the “smartest” language models (LLMs), which are often slower. While GPT-4 turbo is faster than GPT-4, it doesn’t meet our specific needs for generating TypeScript and JavaScript code snippets.

Challenges

  1. Balancing Speed and Intelligence:

    • Developers expect rapid responses, but achieving high-quality code requires more advanced LLMs, typically slower in processing.
  2. Code Isolation and Assembly:

    • We need to generate numerous code snippets while keeping them isolated. This helps us identify each snippet’s purpose and manage their imports and integration.
  3. Browser Limitations:

    • Operating from a browser environment introduces challenges in parallelizing network requests, as Chromium browsers restrict the number of concurrent fetches.

Solutions

To address these challenges, we implemented a batching system and optimized LLM latency. Here’s how:

Batching System

  1. Request Collection:

    • We gather as many snippet requests as possible and batch them together.
  2. Microservice Architecture:

    • These batches are sent to a microservice that authenticates and isolates the front-end code from the LLM, ensuring secure and efficient processing.
  3. Parallel Request Handling:

    • The microservice disassembles the batch into individual requests, processes them through our regular Retrieval-Augmented Generation (RAG), multi-shot, and prompt template mechanisms, and issues them in parallel to the LLM.
  4. Validation and Retries:

    • Each response is analyzed and validated via a guardrail system. If a response is invalid or absent, the LLM is prompted again. Unsuccessful requests are retried, and valid snippets are eventually batched and returned to the front end.

Micro-Caching

We implemented micro-caching to enhance efficiency further. By hashing each request and storing responses, we can quickly reference and reuse previously generated snippets or batches. This reduces the load on the LLM and speeds up response times.

Conclusion

The impact of parallelization and micro-caching is substantial, allowing us to use a more intelligent LLM without sacrificing performance. Despite slower individual response times, the combination of smart batching and caching compensates for this, delivering high-quality, rapid code generation.

The post Minimizing LLM latency in code generation appeared first on Anima Blog.

]]>
https://www.animaapp.com/blog/frontier/minimizing-llm-latency-in-code-generation/feed/ 0
Joining a New Project? Code Smarter and Faster from Your First Day https://www.animaapp.com/blog/industry/joining-a-new-project-code-smarter-and-faster-from-your-first-day/ https://www.animaapp.com/blog/industry/joining-a-new-project-code-smarter-and-faster-from-your-first-day/#respond Tue, 04 Jun 2024 15:17:41 +0000 https://www.animaapp.com/blog/?p=9941 Reading Time: 2 minutes Frontier, our innovative coding assistant, is designed to seamlessly integrate newcomers into the development process, making the transition smooth and efficient.

The post Joining a New Project? Code Smarter and Faster from Your First Day appeared first on Anima Blog.

]]>
Reading Time: 2 minutes

Joining a new project can be as exciting as it is daunting, especially when you need to familiarize yourself quickly with the existing codebase and development practices. Frontier, our innovative coding assistant, is designed to seamlessly integrate newcomers into the development process, making the transition smooth and efficient.

Here’s how Frontier can be a game-changer for developers new to a project

  1. Effortless Component Discovery:

    • Seamless Integration: Frontier eliminates the need to manually search for components. Its advanced matching algorithms automatically identify and suggest the right components from the existing codebase that correspond to elements in your Figma designs.
    • Accelerated Learning Curve: This feature not only speeds up the development process but also facilitates a deep understanding of the component architecture without the need to sift through documentation or seek extensive input from senior developers.
  2. Learn from the Best with Contributor Insights:

    • Follow Proven Practices: Frontier provides details about the last contributor and modification dates for each component usage, guiding you to follow coding patterns endorsed by top developers within your team.
    • Access to Mentorship: Highlighting contributors also helps identify potential mentors, offering insights into whom to approach for advanced learning and advice on adhering to the best practices.
      Frontier - code usage - last edited
  3. Streamlined Onboarding Process

    • Rapid Contribution: Frontier’s deep integration with your project’s existing structures allows you to start contributing meaningful code almost immediately, minimizing the usual learning and adjustment period.
    • Consistent Code Quality: Frontier respects and adapts to your project’s established coding conventions, ensuring all new code is consistent and harmonious with existing development standards.

Get Frontier

Here’s why Frontier can be a game-changer for Managers and Teams:

  1. Accelerate Developer Ramp-Up

    Drastically shorten the learning curve for new developers, enabling quicker and more impactful contributions.

  2. Ensure Coding Consistency:

    Maintain a high standard of code quality from day one, minimizing the need for later corrections and ensuring consistency across the project.

  3. Boost Team Collaboration:

    Create a supportive environment where new developers are well-informed about team coding responsibilities and patterns, fostering better communication and collaboration.

      

Frontier isn’t just a tool; it’s your partner in coding. By removing the common barriers new developers face, Frontier allows you to focus on what you do best: coding solutions that matter.

Start your journey with Frontier today and experience a smoother, more intuitive integration into your new project.

Get Access

The post Joining a New Project? Code Smarter and Faster from Your First Day appeared first on Anima Blog.

]]>
https://www.animaapp.com/blog/industry/joining-a-new-project-code-smarter-and-faster-from-your-first-day/feed/ 0
Anima’s VSCode extension: Figma to React is now in your favorite IDE https://www.animaapp.com/blog/code/animas-vscode-extension-figma-to-react-is-now-in-your-favorite-ide/ https://www.animaapp.com/blog/code/animas-vscode-extension-figma-to-react-is-now-in-your-favorite-ide/#respond Tue, 19 Mar 2024 15:07:29 +0000 https://www.animaapp.com/blog/?p=9642 Reading Time: 2 minutes A big step toward becoming developers’ sidekick is Anima’s new VSCode extension, now available in beta. With the first beta, you’ll be able to turn Figma into code right inside Visual Studio Code.

The post Anima’s VSCode extension: Figma to React is now in your favorite IDE appeared first on Anima Blog.

]]>
Reading Time: 2 minutes

Update: Frontier, Figma to code in VSCode, is now accessible to all!

With almost 1M installs on Figma’s platform, Anima is leading the design to code space. As the next phase, Anima is evolving into a front-end coding assistant. In this article, we will cover the challenges our customers are having and how we address more of them by taking a more active part in helping R&D teams deliver faster daily.

A big step toward becoming developers’ sidekick is Anima’s new VSCode extension, now available in beta. With the first beta, you’ll be able to turn Figma into code right inside Visual Studio Code.

Anima’s code is clean, runnable, and has high fidelity compared to the Figma design. All you need in order to start is a link to a Figma file, and the rest append in the IDE. Select any layer, turn it into code, extract visual assets, and deliver great UX at half the time.

 

 

Today’s new beta means that Anima will now be available in developers’ home court. We have a great roadmap around how to interact with existing code and integrate smoothly into your workflow.

How to Turn Figma to React in Visual Studio Code

Here is the gist:

  1. Install Frontier, Anima for VS Code
  2. Paste a Figma link into Anima
  3. Select any part of the design to generate React code
  4. Assets are available under “Asset Manager”

Generative AI and Front-end Code Automation

As generative AI is slowly maturing, companies are experiencing AI tools and discovering the pros and cons of providing such solutions to their teams. AI in places such as email and document creation, as well as data analysis, is becoming a no-brainer.

GenAI tools in software development are less straightforward. These are the early days, and we are starting to see a variety of solutions for developers, ranging from chat interfaces to interactive WYSIWYGs, to coding completion, such as GitHub’s Copilot, and all the way to an “AI Developer agent” that tackles bugs.

When it comes to Front-end automation, we believe that there’s a big gap between what’s possible and what’s out there. And with Anima’s capabilities and our understanding of the space, we can do much more. 

A Developer’s Sidekick – Evolving into a Front-end coding Assistant

Gradually, Anima will help developers run faster and faster as they build and maintain front-end code. Mixing Anima’s code-gen engine with GenAI in multiple ways opens new doors to what’s possible. From building new workflows on top of existing code, and all the way to maintaining and governing design systems and even older legacy code.

If you wish to become a design partner and help us shape the future of Front-end, contact us.

Who is This For?

Any dev team building Front-end, starting with those building with React.

Anima’s front-end coding assistant does not compete with Github Copilot, Tabnine, or Amazon’s CodeWhisperer—it complements and expands the amount of coding you can automate.

With this first release, we start by bringing the same offering of today’s Anima to VSCode—Figma to React—runnable, pixel-perfect UI code. Next comes design-system integration and front-end code base maintenance and monitoring.

We’d love to hear your feedback, join the beta, and give it a spin 🙏

The post Anima’s VSCode extension: Figma to React is now in your favorite IDE appeared first on Anima Blog.

]]>
https://www.animaapp.com/blog/code/animas-vscode-extension-figma-to-react-is-now-in-your-favorite-ide/feed/ 0
Automatic AI-Driven Icon Naming https://www.animaapp.com/blog/code/automatic-ai-driven-icon-naming/ https://www.animaapp.com/blog/code/automatic-ai-driven-icon-naming/#respond Mon, 25 Apr 2022 16:30:37 +0000 https://www.animaapp.com/blog/?p=7382 Reading Time: 2 minutes Anima’s AI can now analyze an icon's visual characteristics and accurately name its class.

The post Automatic AI-Driven Icon Naming appeared first on Anima Blog.

]]>
Reading Time: 2 minutes
 
TL;DR – Distinguishing icons in code is difficult if they don’t have meaningful names. Using AI image recognition, Anima can now automatically identify the types of icon in your design and name their classes accordingly.
 

 
At Anima, we focus on automatically converting design into developer-friendly code. As Martin Fowler once said – There are only two hard things in Computer Science: cache invalidation and naming things. In Anima’s new feature we tacked the naming challenge.
 
Developers want high-quality code with meaningful naming. They can spot machine-generated code in poor CSS class names (i.e. “vector-383”). These names do not help identify what they’re referring to. That’s why we’ve added an ML solution to improve layer naming.
 
Using AI image recognition Anima can now automatically identify the types of icons in your design and name their classes accordingly.

 


The problem: design files include non-descriptive icon naming

 
Designers use icons across their designs frequently. These Icons may have their own custom styling depending on their usage. Developers manage these elements but they can be difficult to identify if they are not named well.
 
For example, it is difficult to identify what icon may be represented by the class name ‘icon-1’, but if it were named ‘cart-icon’ it would be instantly identifiable.
Icons

The solution: automatically identify icons and name them accordingly

Using Machine Learning, Anima automatically scans your design’s images and identifies what types of icon you have used. It then names the elements according to the icon type.
 
This means that when you export to code, the class names match to the type of icon used.

Benefits

  • For Designers: You no longer need to worry about adding icon image class names
  • For Developers: You’ll be able to quickly and easily identify the icon type from its name

Coming up: AI-Driven Automation

At Anima, we’re continuously looking to improve the designer and developer experience. To do so we’re investigating areas in the design-to-code process where automation can make a big difference. 
 
If you have an idea for a step in this process that would be improved by automation, whether it’s something you have to spend time on regularly, or could simply be made easier, please let us know.

The post Automatic AI-Driven Icon Naming appeared first on Anima Blog.

]]>
https://www.animaapp.com/blog/code/automatic-ai-driven-icon-naming/feed/ 0
Experience React from Anima in CodeSandbox https://www.animaapp.com/blog/code/experience-react-from-anima-in-codesandbox/ https://www.animaapp.com/blog/code/experience-react-from-anima-in-codesandbox/#respond Wed, 03 Mar 2021 10:47:52 +0000 https://www.animaapp.com/blog/?p=4954 Reading Time: 2 minutes Access React code in CodeSandbox and navigate better

The post Experience React from Anima in CodeSandbox appeared first on Anima Blog.

]]>
Reading Time: 2 minutes

Anima is a design-to-development tool that allows designers to create high-fidelity prototypes from inside Sketch, Adobe XD, and Figma, and export HTML & CSS in a single click.

Here at Anima, we are constantly working behind the scenes to improve your user experience. From today, you can access your React code using CodeSandbox, making it easier than ever to navigate the code and see it up and running!

What is CodeSandbox ?

CodeSandbox is a platform that allows you to edit code online, speeding up web development. This platform is popular for creating full-stack web apps, static sites, or components on any device with a web browser.

Why does it matter?

Usually, to run a React code, you need to set an environment, install node packages, etc. Now with Anima, you can open the generated code in CodeSandbox. After syncing a design to Anima, with a click of a button, you can now see the generated React code running in a pre-configured environment in CodeSandbox.

👉 How to open code from Anima in CodeSandbox

To use this feature, simply go to “code mode” on the Anima platform, select “open code in CodeSandbox” and it will load in CodeSandbox. It’s as easy as that!

GIF showing how to run code mode in Anima

In “code mode”, select “Open code in CodeSandbox”

This allows you to see the code before integrating it into your project. In other words, you get to see the code running before downloading it from Anima, and applying it to your own code repository.

GIF showing how to navigate different components and get code

Navigate different components and get code

New to Anima?

Anima is a platform that allows designers to create fully responsive prototypes that act just like the finished product, whilst using their own design tools (SketchAdobe XD, or Figma).

Developers, on the other hand, can export these designs as developer-friendly HTML & CSS, or React code, in a matter of a few clicks. Anima gives you component-based, clean code that we know developers love to use!

Ready to start?

Button to get Anima

As always, we’re excited to hear your feedback!

Join the discussion or show off your designs on FacebookTwitterSlackInstagramOr, vote for new features at UserVoice.

Stay creative!
❤ Anima team

The post Experience React from Anima in CodeSandbox appeared first on Anima Blog.

]]>
https://www.animaapp.com/blog/code/experience-react-from-anima-in-codesandbox/feed/ 0
Import a Sketch design file to Anima https://www.animaapp.com/blog/code/import-a-sketch-design-file-to-anima/ https://www.animaapp.com/blog/code/import-a-sketch-design-file-to-anima/#respond Tue, 09 Mar 2021 09:33:46 +0000 https://www.animaapp.com/blog/?p=4913 Reading Time: 3 minutes Developers, now you can quickly import Sketch designs directly to Anima and get code instantly — without ever installing Sketch

The post Import a Sketch design file to Anima appeared first on Anima Blog.

]]>
Reading Time: 3 minutes

Overview 😎

Anima is here to help Front-end engineers deliver faster by automating the grunt work. Teams can convert Sketch, Adobe XD, or Figma into React code and save precious time.
Developers often do not have access to design tools such as Sketch. From now on, you can import Sketch designs to Anima, and get component-based, clean code for the design. All you need is the Sketch file and nothing more.
In this article, we go through the simple steps to import a Sketch design file to Anima and get the code.

What is Sketch?

Sketch is a design tool for Mac that designers use for UI, mobile app, web-app, and icon designs.

How does this help me get code?

From today, you no longer need a Mac to import a Sketch file into Anima, or work directly on the design tool as a matter of fact. Now you can simply upload the design file from the web, and with a few clicks get the React/HTML code for this design.

Follow these 3 simple steps:

✔ Step 1: Import file

On Anima’s platform, open a new project and click import file. You can select one of two ways to import a file:

Image showing the upload file button on Anima to get code for a Sketch file

Option 1 — Click on the “import file” button and select the Sketch file

Image showing how to upload a Sketch file to Anima to get code for Sketch designs

 Click on the “quick import” button and select the Sketch file

✔ Step 2: Upload a Sketch file

Select the Sketch file you want to import into Anima’s platform.

Image showing how to import designs from Sketch to Anima and get code

Select the Sketch file you want to work with

✔ Step 3: Select artboards

Select the artboards you want and select import.
Note: You can choose to select either all artboards or manually select specific artboards.

GIF showing how to get code Sketch designs without Sketch

Select artboard you want to import

Get HTML and React code from Sketch

Once your files have imported, you can see the design. Click on the screen you want to get code for, and there you have it, the code is all there!

Gif showing how to get HTML & React code for Sketch files

Get HTML & React code for Sketch files

Get HTML & React code for Sketch files

Oh, and you can also add Sketch artboards into an existing project. Just click on the “Import from Sketch” button on the top right corner.

GIF showing how to add artboards to an existing project in Anima

Add artboards to an existing project

Next steps

Anima’s code quality is our top priority. We’re constantly working on improving Anima. We have more code frameworks in the pipeline, such as Vue.js, Angular, SwiftUI, and Flutter, so stay tuned!

Wanna try it out?

Download Anima plugin for Sketch, Anima plugin for Adobe XD, or Anima plugin for Figma
Visit Anima 101 page.

button to get Anima

The post Import a Sketch design file to Anima appeared first on Anima Blog.

]]>
https://www.animaapp.com/blog/code/import-a-sketch-design-file-to-anima/feed/ 0