nhttp

An Simple web-framework for Deno and Friends.

MIT License

Downloads
4.4K
Stars
88
Committers
7

Bot releases are visible (Hide)

nhttp - 2.0.2 Latest Release

Published by herudi 4 months ago

Feat

  • feat(lib/jsx): support custom charset in options.
  • feat(lib/jsx): support custom viewport in options.
  • feat(ext/tailwind): custom handler to minify css.
  • feat(ext/tailwind): share path in handler middleware.

Fix

  • fix(ext/tailwind): requires content in types.
nhttp - 2.0.1

Published by herudi 4 months ago

nhttp - 2.0.0

Published by herudi 4 months ago

News

in version 2, NHttp has been published to jsr.io.
Here's how to install it :

// Deno
deno add @nhttp/nhttp

// npm
npx jsr add @nhttp/nhttp

// Yarn
yarn dlx jsr add @nhttp/nhttp

// pnpm
pnpm dlx jsr add @nhttp/nhttp

// Bun
bunx jsr add @nhttp/nhttp

Breaking Changes

nhttp - 1.3.26

Published by herudi 6 months ago

fix(node): multiple set-cookie at once #89 from issue #88

nhttp - 1.3.25

Published by herudi 8 months ago

  • feat(lib/controller): View decorator now support async by @hironichu.
  • feat(lib/jsx): useScript support raw string by @herudi.
  • up(test): update tools.
  • up(ci): update deno version (1.41.1).
nhttp - 1.3.24

Published by herudi 9 months ago

  • perf(lib/etag): Optimize hash.
nhttp - 1.3.23

Published by herudi 9 months ago

  • perf(requestEvent): Optimize rev.route.
  • feat(lib/jsx): support non px in style object like zIndex.
nhttp - 1.3.22

Published by herudi 9 months ago

  • perf(node): Optimize clone Response when stream.
nhttp - 1.3.21

Published by herudi 9 months ago

Fix

  • fix(node): fix clone after next when streaming.

Feat

  • feat(libs): export all type Options for all libs.
  • feat(lib/etag): support jsx.
nhttp - 1.3.20

Published by herudi 9 months ago

Feature

  • feat(router): add method router.add alias to router.on.
  • feat(requestEvent): add rev.undefined(). force undefined in return directly.
  • feat(types): respect global namespace NHTTP (RequestEvent, HttpResponse).
  • feat(lib/jsx): add useInternalHook for better manage hook internally.

Fix

  • fix(lib/jsx): fix stream resource closed.
nhttp - 1.3.19

Published by herudi 10 months ago

  • feat(lib/jsx): add small func. to support alpine/vue e.g. at-click to @click
const Home = () => <button at-click="click()">click</button>;

// render to string => <button @click="click()">click</button>

cause in JSX, not support @ or : in attr-key.

~~~ Happy New Year 2024 ~~~

nhttp - 1.3.18

Published by herudi 10 months ago

New Feature

  • feat(lib/jsx): support for htmx
import nhttp from "https://deno.land/x/[email protected]/mod.ts";
import { htmx, renderToHtml } from "https://deno.land/x/[email protected]/lib/jsx.ts";

const app = nhttp();

app.engine(renderToHtml);

app.use(htmx());

app.get("/", () => {
  return (
    <button hx-post="/clicked" hx-swap="outerHTML">
      Click Me
    </button>
  );
});

app.post("/clicked", () => {
  return <span>It's Me</span>;
});

app.listen(8000);
nhttp - 1.3.17

Published by herudi 10 months ago

new features

  • feat(lib/jsx): fast check isValidElement
nhttp - 1.3.16

Published by herudi 10 months ago

New Features

  • feat(lib/controller): add charset to @Type decorators.
  • feat(lib/jsx): add hook useParams, useQuery, useBody, useRequestEvent... etc.
  • feat(lib/jsx): add new render engines. renderToReadableStream.
  • feat(lib/jsx): now, support AsyncComponent.
nhttp - 1.3.15

Published by herudi 11 months ago

Features

  • feat(lib/jsx): support for jsx transform precompile.

Deno has claimed 7 ~ 20x faster. ref => fastest jsx transform.

config deno.json

{
  "compilerOptions": {
    "jsx": "precompile",
    "jsxImportSource": "nhttp-jsx"
  },
  "imports": {
    "nhttp-jsx/jsx-runtime": "https://deno.land/x/[email protected]/lib/jsx/jsx-runtime.ts"
  }
}
nhttp - 1.3.14

Published by herudi 11 months ago

Security Update

  • fix(lib/jsx): prevent XSS exploitation by @izeau.
  • add(lib/csrf): csrf protected middleware by @herudi.

New Change

  • feat(lib/jsx): rewrite better jsx and Helmet by @izeau.
  • feat(http_response): add charset options to rev.response.type by @herudi.
nhttp - 1.3.13

Published by herudi 11 months ago

feat(lib/logger): color INFO and ERROR message in term for Node/Bun.

nhttp - 1.3.12

Published by herudi about 1 year ago

  • fix(lib/controller): add rev to method-decorators #47
nhttp - 1.3.11

Published by herudi about 1 year ago

Features

  • feat(node): support fetch in Node directly #46
nhttp - 1.3.10

Published by herudi about 1 year ago

  • fix pin esm.sh #41 by @zingmane to solve #40 .
  • feat(jsx/helmet): add default helmet.render by @herudi