New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@anansi/core

Package Overview
Dependencies
Maintainers
0
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anansi/core

React 19 Framework

  • 0.20.20
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
96
increased by11.63%
Maintainers
0
Weekly downloads
 
Created
Source

@anansi/core

npm downloads bundle size npm version PRs Welcome

The itsy bitsy spider crawled up the water spout. Down came the rain, and washed the spider out. Out came the sun, and dried up all the rain, and the itsy bitsy spider went up the spout again

Entry

yarn start-anansi./src/index.tsx

This script uses two entry points for client/server.

index.server.tsx
import { useController } from '@data-client/react';
import {
  laySpouts,
  documentSpout,
  dataClientSpout,
  prefetchSpout,
  routerSpout,
  JSONSpout,
  appSpout,
} from '@anansi/core/server';

import app from 'app';

import { createRouter } from './routing';

const spouts = prefetchSpout('controller')(
  documentSpout({ title: 'anansi' })(
    JSONSpout()(
      dataClientSpout()(
        routerSpout({ useResolveWith: useController, createRouter })(
          appSpout(app),
        ),
      ),
    ),
  ),
);

export default laySpouts(spouts);
index.tsx
import { useController } from '@data-client/react';
import {
  floodSpouts,
  documentSpout,
  dataClientSpout,
  routerSpout,
  JSONSpout,
  appSpout,
} from '@anansi/core';

import app from 'app';

import { createRouter } from './routing';

const appSpout = () => Promise.resolve({ app });

const spouts = documentSpout({ title: 'anansi' })(
  JSONSpout()(
    dataClientSpout()(
      routerSpout({ useResolveWith: useController, createRouter })(
        appSpout(app),
      ),
    ),
  ),
);

floodSpouts(spouts);

Anansi can quickly traverse spouts setup by a user.

The server lays the spouts for anansi to travel in. Once delivered to the client, the spouts can be flooded (hydration).

In both cases, we need the route and application data.

Scripts

serve(entry, options?)

import { serve } from '@anansi/core/scripts';

serve('./dist-server/App.js');
serveAssets: boolean

Serves static assets. This is typically useful when validating server builds locally; but you typically want to use a dedicated HTTP server for static assets in production.

serveProxy: boolean

Proxy requested based on webpack config devConfig. Useful for validating server builds locally. In production it is much more performant to use a separate reverse proxy.

Keywords

FAQs

Package last updated on 16 Feb 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc