VOOZH about

URL: https://thenewstack.io/svelte-adds-asynchronous-sync-inside-components/

⇱ Svelte Adds Asynchronous Sync Inside Components - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2025-05-10 07:00:57
Svelte Adds Asynchronous Sync Inside Components
AI / Frontend Development / JavaScript / Software Development

Svelte Adds Asynchronous Sync Inside Components

In other developer news this week, Anthropic adds web search to Claude Code and two APIs, and Rack users need to update Ruby asap.
May 10th, 2025 7:00am by Loraine Lawson
👁 Featued image for: Svelte Adds Asynchronous Sync Inside Components

This week, Svelte published a roundup of new feature upgrades and bug fixes. The big news is that Asynchronous Svelte is now available in Svelte’s full-stack web application framework, SvelteKit.

In its GitHub repository, the project explained that this is actually an old idea reborn in a more efficient manner.

“In olden times, we did asynchronous work like fetching data inside onMount or an {#await ...} block. This works, but it’s quite verbose and offers no coordination — if two components are both fetching stuff, then they will likely have independently managed error/loading states, often resulting in a janky UI with multiple spinners,” Rich Harris, creator of Svelte, wrote.

Many frameworks opt to forego this function and perform asynchronous work outside the component in load functions, as one example. That leads to a better user experience but creates other problems, such as “prop-drilling, type shenanigans, coarse-grained invalidation, and logic that’s hard to delete because it’s often not obvious whether something in your load function is even being used,” he said.

This has lead to a third option in recent years, which is to put the asynchronous work back inside components — hey, everything old is new again — but in a coordinated way.

React has a number of primitives that support async updates, such as startTransition, useTransition, use and React Server Components, Harris pointed out. Solid and Vue have similar functionalities.

“We believe Svelte’s compiler-centric nature offers us a way to have component-level async work with significantly better ergonomics and fewer drawbacks than existing approaches,” he wrote.

He explained how this works; but in brief, it uses the await keyword, which can be placed:

  • At the top level of a component script
  • Inside $derived expressions
  • In a template expression (i.e. in a component’s markup)

But be forewarned — this is not production-ready and developers will find bugs.

Use cases for this include:

  • Load data;
  • Demo preloading images to avoid jank;
  • Demo lazily importing modules and components as needed;
  • Demo moving expensive computation to a web worker;
  • Avoid waterfalls.

The explanation is quite long — Harris advises you to grab a cup of tea before you start reading it — but it’s detailed and worth the time. Plus, he included demos.

While that was the team’s main focus last month, Svelte also worked on a few other issues. For instance, the Svelte CLI (sv) now offers an --install  flag to specify which package manager to use when running. They also merged two separate CloudFlare adapters into one: adapter-cloudflare. Also, the adapter-vercel will now create symlink functions for each route, for better observability.

One of my favorite things about Svelte’s recent post, though, is that they’ve moved beyond listing framework updates to add resources that showcase the community and help developers learn more about using the framework. Astro also does this. You’ll now find a showcase of apps and sites built with Svelte, a list of new libraries, tools and components, as well as links to learning resources created by Svelte contributors and ambassadors.

Web Search Added to Claude Code and Anthropic, Messages APIs

Anthropic made web search available on its Anthropic API this week. This will give Claude access to current information from the web.

It also made web search available when making requests to the Messages API and available to developers in the Claude Code.

“When Claude receives a request that would benefit from up-to-date information or specialized knowledge, it uses its reasoning capabilities to determine whether the web search tool would help provide a more accurate response,” the post explained. “If searching the web would be beneficial, Claude generates a targeted search query, retrieves relevant results, analyzes them for key information, and provides a comprehensive answer with citations back to the source material.”

It’s quite robust: Claude can perform multiple progressive searches with earlier results informing subsequent searches.

Developers can control it by adjusting the max_uses parameter. Claude may refine the query to create a more accurate response, the post added.

You can probably extrapolate your own use cases, but Anthropic lists a few ideas, including that developers could enable Claude to reference the latest API documentation, GitHub releases and technology updates.

The search results include citations to the source material, which has become a best practice for LLMs. There are also additional control features that developers can access with admin settings, including an allow list and a block list.

Web search is available on the Anthropic API for Claude 3.7 Sonnet, the upgraded Claude 3.5 Sonnet, and Claude 3.5 Haiku at $10 per 1,000 searches plus standard token costs. Here’s the documentation.

OPSWAT: Rack Ruby and a Major Security Flaw

OPSWAT’s Red Team security identified multiple vulnerabilities in Rack Ruby in late April.

Rack is a modular interface that connects web servers to Ruby-based web applications. It’s used by many web frameworks and libraries, including Ruby on Rails and Sinatra. It’s available as a Ruby Gem. Its reach is extensive, with more than one billion downloads globally, the team noted.

“Due to this extensive integration, vulnerabilities discovered within Rack present substantial security implications, potentially affecting numerous applications and systems worldwide,” the team stated.

Researchers Thai Do and Minh Pham found three problems:

  1. Attackers can use a vulnerability to perform log injection via CRLF (Carriage Return Line Feed) characters, potentially manipulating log entries.
  2. A security flaw allows attackers to inject and manipulate log content through malicious header values.
  3. A Path Traversal vulnerability could allow attackers to gain unauthorized access to files located outside the designated static file directory, posing a significant security threat. This is a particularly bad problem, since it allows unauthenticated attackers to access sensitive information, including configuration files, credentials and confidential data, which can lead to data breaches, they noted.

Ruby fixed the bugs in the newest versions of their software, so if you’re using Rack, be sure to update. OPSWAT also recommended developers:

  • Audit your Web frameworks. To do this, scan the Software Bill of Materials (SBOM) — a list of all the tools and code used — to make sure nothing else contains any bugs.
  • Protect your data. “Regularly scanning web frameworks for changes or vulnerabilities helps maintain security and tools such as sandboxing and file scanning are effective in identifying suspicious activities,” the team wrote.
TRENDING STORIES
Loraine Lawson is a veteran technology reporter who has covered technology issues from data integration to security for 25 years. Before joining The New Stack, she served as the editor of the banking technology site Bank Automation News. She has...
Read more from Loraine Lawson
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Anthropic.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.