Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@fractal-web/next-ssr-hydration
Advanced tools
A template for creating npm packages using TypeScript and VSCode
[![npm package][npm-img]][npm-url] [![Build Status][build-img]][build-url] [![Downloads][downloads-img]][downloads-url] [![Issues][issues-img]][issues-url] [![Code Coverage][codecov-img]][codecov-url] [![Commitizen Friendly][commitizen-img]][commitizen-url] [![Semantic Release][semantic-release-img]][semantic-release-url]
An attempt to make lazy hydration with ssr-prerendering work in the modern Next.js 13/14.
Current versions of Next.js rely on build-time compilation/transformation of the source code so it's very important how you write and structure your code.
You have to not forget that use client
directive and split the components into files in the right way. Below is an example that works.
npm install @fractal-web/next-ssr-hydration
// ProductsShowcase.lazy.tsx
'use client'; // DONT FORGET
import dynamic from 'next/dynamic';
import {
passThroughLoading,
withHydrationOnDemand,
} from '@fractal-web/next-ssr-hydration';
// the use of `dynamic` instead of `lazy` is important
// that way Next.js' compiler loads the styles of the component eagerly
const ProductsShowcase = dynamic(() => import('./ProductsShowcase'), {
loading: passThroughLoading,
});
export const ProductsShowcaseLazy = withHydrationOnDemand({
id: 'ProductsShowcaseLazy', // in the current implementation should be unique per rendered component
on: ['visible'], // will load the js-bundle of the component and hydrate it when it gets visible in the viewport
})(ProductsShowcase);
FAQs
A template for creating npm packages using TypeScript and VSCode
We found that @fractal-web/next-ssr-hydration demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.