ContactCareerAboutBlogProjectsHome
IT Infrastructure

Partytown - Managing Third-Party Scripts for Faster Sites

Managing Third-Party Scripts: Partytown relocates third-party scripts to a web worker, freeing up the main thread for critical web app execution. Optimizing for Faster Sites: The goal is to mitigate the performance impact of third-party scripts on site speed, addressing issues like layout thrashing and resource contention. Enhancing Website Performance: By sandboxing scripts and managing their access to main thread APIs, Partytown improves overall site performance and responsiveness.
Client:
LUSINI International GmbH
Release Date:
December 2022
See Live Project

Link:

https://www.lusini.com

Description:

In the pursuit of maintaining high coding standards, our team developed the AST-Based Error Compiler for Code Compliance within Visual Studio Code (VSC). This tool leverages Abstract Syntax Trees (ASTs) to automate the detection of coding guideline violations, ensuring adherence to the comprehensive Lusin Coding Guidelines.

Project Background and Motivation:
Adhering to coding guidelines is crucial for achieving consistent and high-quality code, especially in collaborative settings. Manual code reviews are traditionally employed to enforce these guidelines but can be laborious and susceptible to oversight. To address this challenge, we embarked on creating an automated solution that reduces the need for manual intervention and enforces coding standards from the moment code is written.

Our starting point was the Lusin Coding Guidelines, known for their rigorous standards on formatting, naming conventions, and code structure. We aimed to transform these guidelines into actionable rules that could be enforced programmatically, thus providing developers with instant feedback on their code quality.

Development Journey:
The journey began with a deep dive into ASTs, which represent the hierarchical structure of source code. Understanding how to traverse and analyze ASTs was key to developing our compiler. We translated the Lusin Coding Guidelines into a robust set of rules that could be checked against the AST of the code. This involved defining rules for formatting (like indentation and spacing), naming conventions, and optimal code structures.

With our rules defined, we integrated these into a compiler built in Visual Studio Code. This compiler includes an AST parser to generate the tree representation of the code, a rule engine to apply the guidelines, and an error reporting mechanism to highlight deviations directly in the code editor.

Features and Functionality:
The AST-Based Error Compiler seamlessly integrates into the Visual Studio Code environment, offering real-time analysis and feedback as developers code. It features:

  • Real-Time Error Detection: Instantly highlights deviations from coding standards with inline annotations, providing clear and immediate feedback.
  • Automated Corrections: Suggests and applies fixes for common guideline violations, streamlining the process of maintaining code quality.
  • Configurable Rules: Allows customization of the enforced rules to match specific coding standards or project needs.
  • Detailed Reports: Generates comprehensive reports summarizing detected violations, helping developers identify and correct recurring issues.

Challenges and Learnings:
Building the compiler presented several challenges, such as handling complex and deeply nested code structures, optimizing performance for large codebases, and ensuring compatibility across various coding styles. Addressing these challenges:

  • We developed sophisticated strategies to manage complex code within the AST framework.
  • Implemented performance optimizations to keep the compiler efficient and non-intrusive.
  • Designed the system to be flexible and easily extendable, accommodating future expansions and updates.

Impact and Future Directions:
This project has had a significant impact on code quality by automating guideline compliance, reducing the need for manual code reviews, and promoting consistent coding practices across projects. It enhances maintainability and helps mitigate technical debt from the outset of code development.

Looking forward, we plan to expand the compiler’s capabilities by incorporating additional coding guidelines, supporting more programming languages, and enhancing user experience with improved interfaces and feedback mechanisms. Integration into CI/CD pipelines is also on the horizon, which will allow for continuous enforcement of coding standards throughout the development lifecycle.

Disclaimer

However, given the Disclosure Agreement, i cant share any source code or present the utilization.

.

About LUSINI:
LUSINI, a leading omnichannel provider based in Wertingen, Bavaria, specializes in supplying the hospitality and catering industry across Europe. Founded in 1987, LUSINI has grown significantly, offering a wide range of premium brands and over 50,000 products through its online marketplace. With a strong commitment to innovation, design, quality, and customer satisfaction, LUSINI continues to set industry standards.

Challenges in Web Performance:
‍
Despite LUSINI’s commitment to excellence, integrating third-party scripts like analytics, advertising, and tracking services posed challenges. These scripts often impacted site performance, affecting load times and user experience, undermining the high standards set by LUSINI.

Introduction to Partytown:‍

Partytown, developed by Builder.io, is a cutting-edge solution designed to relocate resource-intensive third-party scripts into a web worker. By freeing up the main thread for essential web app execution, Partytown aims to significantly enhance site speed and responsiveness.

Key Features and Goals of Partytown:

  • Optimizing Main Thread Resources: Dedicated to core web app functionalities.
  • Sandboxing and Security: Controls third-party script access to main thread APIs.
  • Enhanced Performance: Executes long-running tasks within the web worker, reducing layout thrashing.
  • Throttling and Efficiency: Manages third-party scripts’ main thread access to prevent performance bottlenecks.
  • Preserving Script Integrity: Ensures third-party scripts function as intended without alterations.

Integration at LUSINI:Implementing Partytown at LUSINI aligns with the company’s dedication to superior web performance and user experience. By mitigating the negative impact of third-party scripts, LUSINI ensures seamless navigation and faster load times for customers accessing its extensive product range and services.

Use-Cases and Benefits:Partytown is particularly effective for non-critical scripts like analytics and advertising, optimizing site performance without compromising functionality. This approach supports LUSINI’s goal of delivering exceptional online service and enhancing customer satisfaction.

Ready to Party: Plugins and Libraries:LUSINI actively supports and integrates popular plugins and libraries compatible with Partytown. This collaborative effort enhances compatibility and functionality, ensuring a seamless user experience across all digital touchpoints.

‍

Portfolio

More Case Studies

View Case Study
Time & Thoughts - (My Blog)
Journalism & Geopolitics
View Case Study
Fin2Gether - IT Lead Developer & Sales Manager
IT Infrastructure
View Case Study
Abstract Syntax Tree-Based Error Compiler for Code Compliance with Coding Guidelines
IT Infrastructure
About Me

As a nerd and documentarian, I strive to merge technical know-how with a journalist's insight that blends into new insigths and perspectives

Navigations
ProjectsBlogCareerAboutContact
Contacts
I’m based in Germany
sobczak.sk@protonmail.ch
+49 172 8384061
Send Message
Links
Carefully crafted by Me   |   Licensing
Copyright © 2026