Add js web stuff to landing page + documentation

This commit is contained in:
2026-07-14 10:33:12 -04:00
parent fec8ef4a3e
commit 02a6dc6c48
435 changed files with 69567 additions and 1522 deletions

View File

@@ -0,0 +1,12 @@
'use strict';
var node_async_hooks = require('node:async_hooks');
var web = require('solid-js/web');
function provideRequestEvent(init, cb) {
if (!web.isServer) throw new Error("Attempting to use server context in non-server build");
const ctx = globalThis[web.RequestContext] = globalThis[web.RequestContext] || new node_async_hooks.AsyncLocalStorage();
return ctx.run(init, cb);
}
exports.provideRequestEvent = provideRequestEvent;

View File

@@ -0,0 +1,10 @@
import { AsyncLocalStorage } from 'node:async_hooks';
import { isServer, RequestContext } from 'solid-js/web';
function provideRequestEvent(init, cb) {
if (!isServer) throw new Error("Attempting to use server context in non-server build");
const ctx = globalThis[RequestContext] = globalThis[RequestContext] || new AsyncLocalStorage();
return ctx.run(init, cb);
}
export { provideRequestEvent };