
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
@rest-hooks/img
Advanced tools
Suspenseful image component: <Img />.
In many cases, it would be useful to suspend loading of expensive items like images using suspense. This becomes especially powerful with the fetch as you render pattern in concurrent mode.
Here, we build an endpoint for images using Image
Here, Rest Hooks is simply used to track resource loading - only storing the src in its store.
import React, { ImgHTMLAttributes } from 'react';
import { useSuspense } from '@rest-hooks/react';
import { Img } from '@rest-hooks/img';
export default function Profile({ username }: { username: string }) {
const user = useSuspense(UseResource.detail(), { username });
return (
<div>
<Img
src={user.img}
alt="React Logo"
style={{ height: '32px', width: '32px' }}
/>
<h2>{user.fullName}</h2>
</div>
);
}
Note this will cascade the requests, waiting for user to resolve before the image request can start. If the image url is deterministic based on the same parameters, we can start that request at the same time as the user request:
import React, { ImgHTMLAttributes } from 'react';
import { useSuspense, useFetch } from '@rest-hooks/react';
import { Img, getImage } from '@rest-hooks/img';
export default function Profile({ username }: { username: string }) {
const imageSrc = `/profile_images/${username}}`;
useFetch(getImage, { src: imageSrc });
const user = useSuspense(UseResource.detail(), { username });
return (
<div>
<Img
src={imageSrc}
alt="React Logo"
style={{ height: '32px', width: '32px' }}
/>
<h2>{user.fullName}</h2>
</div>
);
}
When using the fetch as you render pattern in concurrent mode, useController().fetch with the getImage
Endpoint to preload the image.
FAQs
Suspenseful images
The npm package @rest-hooks/img receives a total of 65 weekly downloads. As such, @rest-hooks/img popularity was classified as not popular.
We found that @rest-hooks/img 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
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.