Aleph.js is a fullstack framework in Deno, inspired by Next.js.

Overview

Aleph.js: The Full-stack Framework in Deno.

Chat Twitter

Getting Started

Visit https://alephjs.org/docs/get-started to get started with Aleph.js.

Description

Aleph.js (or Aleph or א or 阿莱夫, ˈɑːlɛf) is a fullstack framework in Deno, inspired by Next.js.

The name is taken from the book The Aleph by Jorge Luis Borges.

Different with Next.js, Aleph.js doesn't need webpack or other bundler since it uses the ES Module syntax during development. Every module only needs to be compiled once, and then cached on the disk. When a module changes, Aleph.js just needs to re-compile that single module. There is no time wasted re-bundling everytime a change is made. This, along with Hot Module Replacement (HMR) and Fast Refresh, leads to instant updates in the browser.

Aleph.js uses modern tools to build your app. It transpiles code using swc in WASM with high performance, and bundles modules with esbuild at build time extremely fast.

Aleph.js works in Deno, a simple, modern and secure runtime for JavaScript and TypeScript. All dependencies are imported using URLs, and managed by Deno cache system. No package.json and node_modules directory needed.

import React from 'https://esm.sh/react'
import Logo from '../components/logo.tsx'

export default function Home() {
  return (
    <div>
      <Logo />
      <h1>Hello World!</h1>
    </div>
  )
}

Community

The Aleph.js community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.

To chat with other community members you can join the Aleph.js Discord.

Contributing

Please see our contributing.md.

License

MIT licensed.

Comments
  • Dev & Production Server Not Working

    Dev & Production Server Not Working

    I created a basic project with aleph init and the development server is basically not working. If I go to localhost:8080 I just get 404 page not found. This is the same case for the production server. The only thing that is working for me is aleph build which seems to be building properly.

    ✘ bug 
    opened by shadowtime2000 26
  • New Compiler&Bundler

    New Compiler&Bundler

    • [x] swc via wasm-pack
    • [x] jsx
      • [x] add __sourceFile prop in dev mode
      • [x] resolve Link component href prop
      • [x] resolve a to Anchor
      • [x] resolve head to Head
      • [x] resolve link to Link
      • [x] resolve script to Script
      • [x] resolve style to Style
      • [x] ~~React new JSX transform~~(https://github.com/swc-project/swc/pull/1223)
    • [x] import/export resolve
    • [x] sign useDeno hook
    • [x] stable fast refresh plugin for the new compile
    • [x] inline-style
    • [x] bundle deps in production mode
    opened by ije 26
  • aleph dev startup fail on windows

    aleph dev startup fail on windows

    Hello, on the latest version of Aleph, after running aleph init, i.e. when I then want to run aleph dev I get uncaught DomException Error telling me that Aleph is unable to set the location.

    ✘ bug 
    opened by himbolion 24
  • Uncaught TypeError in Getting Started guide

    Uncaught TypeError in Getting Started guide

    Hello Aleph.js team 👋. I was recently updating my blog post about Aleph and found that I was getting an error when following along with the current Getting Started guide. All three aleph commands, dev, start, and build result in the same error.

    Commands entered:

    deno install --unstable -A -f -n aleph https://deno.land/x/[email protected]/cli.ts
    export PATH="/Users/ajcwebdev/.deno/bin:$PATH"
    aleph init hello
    cd hello
    aleph dev
    

    Error output:

    Check https://deno.land/x/[email protected]/cli/dev.ts
    
    error: Uncaught (in promise) TypeError: TS2345 [ERROR]: Argument of type 'TransformerFactory<SourceFile>' is not assignable to parameter of type 'TransformerFactory<SourceFile> | CustomTransformerFactory'.
      Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").TransformerFactory<import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").SourceFile>' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").TransformerFactory<import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").SourceFile>'.
        Types of parameters 'context' and 'context' are incompatible.
          Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").TransformationContext' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").TransformationContext'.
            The types of 'factory.createTypeParameterDeclaration(...).parent' are incompatible between these types.
              Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").DeclarationWithTypeParameterChildren | import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").InferTypeNode' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").DeclarationWithTypeParameterChildren | import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").InferTypeNode'.
                Type 'JSDocTemplateTag' is not assignable to type 'DeclarationWithTypeParameterChildren | InferTypeNode'.
                  Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDocTemplateTag' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDocTemplateTag'.
                    Types of property 'parent' are incompatible.
                      Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDoc | import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDocTypeLiteral' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDoc | import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDocTypeLiteral'.
                        Type 'JSDoc' is not assignable to type 'JSDoc | JSDocTypeLiteral'.
                          Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDoc' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").JSDoc'.
                            Types of property 'parent' are incompatible.
                              Type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").HasJSDoc' is not assignable to type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").HasJSDoc'.
                                Type 'ImportEqualsDeclaration' is not assignable to type 'HasJSDoc'.
                                  Property 'isTypeOnly' is missing in type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").ImportEqualsDeclaration' but required in type 'import("https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts").ImportEqualsDeclaration'.
        if (reactRefresh) transformers.before!.push(reactRefreshTS())
                                                    ~~~~~~~~~~~~~~~~
        at https://deno.land/x/[email protected]/tsc/compile.ts:28:49
    
        'isTypeOnly' is declared here.
                readonly isTypeOnly: boolean;
                         ~~~~~~~~~~
            at https://cdn.esm.sh/v41/[email protected]/lib/typescript.d.ts:1601:18
        const { default: cmd } = await import(`./cli/${command}.ts`)
                                 ^
        at async main (https://deno.land/x/[email protected]/cli.ts:163:30)
    

    Aleph version

    aleph.js v0.2.28
    

    Deno version

    deno 1.8.0
    

    deno info

    DENO_DIR location: "/Users/ajcwebdev/Library/Caches/deno"
    Remote modules cache: "/Users/ajcwebdev/Library/Caches/deno/deps"
    TypeScript compiler cache: "/Users/ajcwebdev/Library/Caches/deno/gen"
    

    My system info

    System Version: macOS 11.3 (20E232)
    Kernel Version: Darwin 20.4.0
    Boot Volume: Macintosh HD
    

    Hopefully that's helpful, let me know if you need other system info or anything like that.

    opened by ajcwebdev 23
  • This page cannot be accessed outside the docker container (http://0.0.0.0:8080/http://172.17.0.2:8080)

    This page cannot be accessed outside the docker container (http://0.0.0.0:8080/http://172.17.0.2:8080)

    Visiting 8080 in the docker container can output Hello World-Aleph.js but outside the container (http://0.0.0.0:8080/http://172.17.0.2:8080) this page cannot be accessed

    aleph start INFO Building... INFO - Bundling INFO {} deps • 159KB INFO {} shared • 398B INFO {} polyfill (ES5) • 8KB INFO Aleph server ready on http://localhost:8080

    ✘ bug 
    opened by jicvi 23
  • Please considering rename aleph.js

    Please considering rename aleph.js

    This is not a technical topic.

    The name aleph matches Cult(アレフ) in Japan. https://en.wikipedia.org/wiki/Aleph_(Japanese_cult)

    Japanese people are a bit afraid to talk about it. Concerns about the name have already erupted from the Japanese community. https://twitter.com/search?q=aleph.js%20lang%3Aja&src=typed_query&f=live

    ☼ user feedback wanted 
    opened by etcumvt 20
  • Issue using `useDeno` in 0.3.0

    Issue using `useDeno` in 0.3.0

    Throws:

    TypeError: Cannot read property 'value' of undefined
        at http://localhost:8080/_aleph/-/deno.land/x/[email protected]/framework/react/hooks.js:88:28
        at mountMemo (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/[email protected]/esnext/react-dom.development.js:12623:33)
        at Object.useMemo (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/[email protected]/esnext/react-dom.development.js:12930:36)
        at useMemo2 (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/[email protected]/esnext/react.development.js:1104:35)
        at useDeno (http://localhost:8080/_aleph/-/deno.land/x/[email protected]/framework/react/hooks.js:54:12)
        at App (http://localhost:8080/_aleph/app.a3093224d.js:21:5)
        at renderWithHooks (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/[email protected]/esnext/react-dom.development.js:12007:32)
        at mountIndeterminateComponent (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/[email protected]/esnext/react-dom.development.js:14188:29)
        at beginWork (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/[email protected]/esnext/react-dom.development.js:14987:36)
        at HTMLUnknownElement.callCallback2 (http://localhost:8080/_aleph/-/cdn.esm.sh/v15/[email protected]/esnext/react-dom.development.js:4265:34)
    

    Code to reproduce:

    import type { ComponentType } from 'https://esm.sh/[email protected]'
    import React from 'https://esm.sh/[email protected]'
    import { useDeno } from 'https://deno.land/x/[email protected]/mod.ts'
    
    export default function App({ Page, pageProps }: { Page: ComponentType<any>, pageProps: any }) {
      useDeno(() => {
        console.log('Hi')
      })
      return (
        <main>
          <Page {...pageProps} />
        </main>
      )
    }
    
    ✘ bug 
    opened by juanvillacortac 19
  • [0.3.0] module import issue from esm.sh

    [0.3.0] module import issue from esm.sh

    $ deno install -A -f --location=http://localhost -n aleph https://deno.land/x/[email protected]/cli.ts
    $ aleph dev
    Download https://deno.land/x/[email protected]/cli/dev.ts
    Download https://deno.land/x/[email protected]/server/mod.ts
    Download https://deno.land/x/[email protected]/server/server.ts
    Download https://deno.land/x/[email protected]/server/app.ts
    Download https://deno.land/x/[email protected]/framework/core/routing.ts
    Download https://deno.land/x/[email protected]/compiler/mod.ts
    Download https://deno.land/x/[email protected]/framework/core/events.ts
    Download https://deno.land/x/[email protected]/compiler/dist/wasm.js
    Download https://deno.land/x/[email protected]/compiler/dist/wasm-checksum.js
    Download https://deno.land/x/[email protected]/compiler/dist/wasm-pack.js
    Check https://deno.land/x/[email protected]/cli/dev.ts
    INFO Aleph server config loaded from aleph.config.js
    INFO Download https://deno.land/x/[email protected]/mod.ts
    INFO Force download from https://deno.land/x/[email protected]/mod.ts
    ERROR swc: Expected \';\', \'}\' or <eof> at https://deno.land/x/[email protected]/mod.ts:1:4
    

    Notice the missing v (for version) in the download link. This is added in in the force download causing it to access a 404.

    ✘ bug 
    opened by FallingSnow 19
  • Doesn't work with Microsoft's FluentUI

    Doesn't work with Microsoft's FluentUI

    Component:

    import React from 'https://esm.sh/react'
    import { PrimaryButton } from 'https://esm.sh/@fluentui/react';
    
    export default function Button({ width = 75 }: { width?: number }) {
        return (
            <PrimaryButton/>
        )
    }
    

    Console:

    ERROR TypeError: head.insertBefore is not a function
        at Stylesheet6._createStyleElement (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:254:22)
        at Stylesheet6._getStyleElement (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:226:39)
        at Stylesheet6.insertRule (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:181:67)
        at applyRegistration (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:695:29)
        at styleToClassName (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:708:9)
        at mergeCss (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:725:22)
        at mergeStyles (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:719:12)
        at file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:1520:31
    

    Browser:

    TypeError: Cannot read property 'deno' of null
        at Home (http://localhost:8080/_aleph/pages/index.4d9dac55d.js:48:21)
        at renderWithHooks (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:11639:32)
        at mountIndeterminateComponent (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:13826:29)
        at beginWork (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:14651:32)
        at HTMLUnknownElement.callCallback2 (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:4054:34)
        at Object.invokeGuardedCallbackDev (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:4080:34)
        at invokeGuardedCallback (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:4115:45)
        at beginWork$1 (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:17853:25)
        at performUnitOfWork (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:17055:28)
        at workLoopSync (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:17007:21)
    

    If you use "ssr": false, // SPA mode you still end up with the same browser error message. But no console error message.

    🅝 npm package 
    opened by FallingSnow 19
  • feat: add new method on Request class

    feat: add new method on Request class

    This is a starting point for the discussion to this method.

    In this way even if the JSON information is broken or it is a invalid will return null. What do you think?

    I can reduce the code the code to a single line or anything like that, but I think it's cleaner to see the intend in this way.

    What I can to to improve it?

    opened by shinspiegel 19
  • Deno 1.7.0 incompatibility

    Deno 1.7.0 incompatibility

    $ aleph dev 
    Check https://deno.land/x/[email protected]/cli.ts
    Check https://deno.land/x/[email protected]/cli/dev.ts
    error: Uncaught (in promise) NotSupportedError: Cannot set "location".
            throw new DOMException(`Cannot set "location".`, "NotSupportedError");
                  ^
        at set (deno:op_crates/web/12_location.js:340:15)
        at Function.assign (<anonymous>)
        at Project._init (project.ts:600:16)
        at async project.ts:106:13
        at async start (server.ts:12:5)
    
    $ deno --version
    deno 1.7.0 (release, x86_64-unknown-linux-gnu)
    v8 8.9.255.3
    typescript 4.1.3
    
    

    See https://github.com/denoland/deno/issues/4981#issuecomment-685205034

    ✘ bug 
    opened by FallingSnow 17
  • deno.lock is constantly growing

    deno.lock is constantly growing

    As the code is written, new entries appear in the demo.lock file

    {
      "version": "2",
      "remote": {
        "http://localhost:3000/components/Footer.tsx?ssr&v=lbyjfzey": "945b8312124fbccd53c21b0d3b56679a43ba1ced154060233ecce9395531058a",
        "http://localhost:3000/components/Footer.tsx?ssr&v=lbyjvrnt": "945b8312124fbccd53c21b0d3b56679a43ba1ced154060233ecce9395531058a",
        "http://localhost:3000/components/Footer.tsx?ssr&v=lbyjwo92": "945b8312124fbccd53c21b0d3b56679a43ba1ced154060233ecce9395531058a",
        "http://localhost:3000/components/Footer.tsx?ssr&v=lbyk7km7": "945b8312124fbccd53c21b0d3b56679a43ba1ced154060233ecce9395531058a",
        "http://localhost:3000/routes/_404.tsx?ssr&v=lbyjfzey": "a560cb660c5852592758a1b08ed4edb0e8adb902ef3f034534e5ba48a862849e",
        "http://localhost:3000/routes/_404.tsx?ssr&v=lbyjvrnt": "a560cb660c5852592758a1b08ed4edb0e8adb902ef3f034534e5ba48a862849e",
        "http://localhost:3000/routes/_app.tsx?ssr&v=lbyjfzey": "2739b7b060150ed8e04aae61913fac41fe1ce31859a2234a368f8079e1cc1de7",
        "http://localhost:3000/routes/_app.tsx?ssr&v=lbyjvrnt": "45053290e17eec63072084ef7836f7d74a01d4081522868e80bd75dcf257bfde",
        "http://localhost:3000/routes/_app.tsx?ssr&v=lbyjwo92": "e7fb9663b7e87449c9d30442622a12f28bf741da33e30fa103dcb589f42e5086",
        "http://localhost:3000/routes/_app.tsx?ssr&v=lbyjwo93": "e7fb9663b7e87449c9d30442622a12f28bf741da33e30fa103dcb589f42e5086",
        "http://localhost:3000/routes/_app.tsx?ssr&v=lbyk7km7": "24c5f8dce19c08d4465655663f4aee0239a698223e876405eb9d06e72c609238",
        "http://localhost:3000/routes/index.tsx?ssr&v=lbyjfzey": "a807b3a4595f3f5867b20df890941ea2259e8043d196841c8e20a5ec323b931a",
        "http://localhost:3000/routes/index.tsx?ssr&v=lbyjvrnt": "a807b3a4595f3f5867b20df890941ea2259e8043d196841c8e20a5ec323b931a",
        "http://localhost:3000/routes/index.tsx?ssr&v=lbyjwo92": "a807b3a4595f3f5867b20df890941ea2259e8043d196841c8e20a5ec323b931a",
        "http://localhost:3000/routes/index.tsx?ssr&v=lbyk7km7": "a807b3a4595f3f5867b20df890941ea2259e8043d196841c8e20a5ec323b931a",
    ...
      }
    }
    

    Is there a way to not add new or delete old entries?


    Deno 1.29.1 Aleph.js 1.0.0-beta.21

    opened by AlekseyMelikov 1
  • [docs] [bug] irregular `import` statement in prose on front page of docs

    [docs] [bug] irregular `import` statement in prose on front page of docs

    On the front page of the Aleph Documentation site, in the first section of prose, is this peculiar import statement right above the title text:

    Screen Shot 2022-10-09 at 4 13 57 PM

    Unfortunately I don't have time today to investigate what's causing this (but I'm imagining it might be a parsing error with MDX...maybe?)

    PS. the site also appears to be lacking a <title> tag, as it's just showing the page's URL for the tab I have open in Chrome.

    opened by nberlette 1
  • Prefix All URLs With Root URL

    Prefix All URLs With Root URL

    See https://maximorlov.com/deploying-to-github-pages-dont-forget-to-fix-your-links/#prefix-all-links for more context, what is the equivalent solution in Aleph.js?

    opened by MarioIshac 1
  • Is it possible to ignore css module expression like `import

    Is it possible to ignore css module expression like `import "//cdn.com/external.css"` for SSR?

    What I mean is that, is it possible to skip this import "cdn/external.css" expression at hydrate server side?

    Since this expression can only be used at browser side.

    image
    opened by ahuigo 2
  • aleph 1.0.0-alpha.78 cannot build

    aleph 1.0.0-alpha.78 cannot build

    My Deno version: 1.23.1

    Project created by deno run -A https://deno.land/x/[email protected]/cli.ts init --template react

    While execute deno task build, error occurs:

    Warning deno task is unstable and may drastically change in the future
    Task build deno run -A https://deno.land/x/[email protected]/cli.ts build
    Download https://deno.land/x/[email protected]/cli.ts
    Download https://deno.land/x/[email protected]/lib/serve.ts
    Download https://deno.land/[email protected]/io/mod.ts
    Download https://deno.land/[email protected]/io/streams.ts
    Download https://deno.land/[email protected]/io/util.ts
    Download https://deno.land/[email protected]/io/writers.ts
    Download https://deno.land/[email protected]/io/files.ts
    Download https://deno.land/x/[email protected]/commands/build.ts
    Download https://deno.land/x/[email protected]/server/build.ts
    Download https://deno.land/x/[email protected]/server/proxy_modules.ts
    INFO Proxy modules on http://localhost:6060
    error: Uncaught (in promise) TypeError: Import 'http://localhost:6060/server.tsx?t=181bf03e20b' failed: 503 Service Unavailable
        await import(
        ^
        at async https://deno.land/x/[email protected]/commands/build.ts:36:5
    
    opened by oyzhen 1
Releases(1.0.0-alpha.47)
  • 1.0.0-alpha.47(May 19, 2022)

    🚀🚀🚀 A fresh Yew SSR application in Rust example added, both the CSR And SSR are using WebAssembly with great performance in modern browsers and serverless platform at edge.

    Preview: https://aleph-yew.deno.dev/ Source Code: https://github.com/alephjs/aleph.js/tree/main/examples/yew-app

    Screen Shot 2022-05-19 at 20 54 39

    Other Changes

    • BREAKING move unocss config in build section
    • feat: added eager property for middleware (eager middleware allow you to handle the static file/code transpile requests)
    • feat(framework/vue): support _app.vue and _404.vue #466
    • feat(HMR): updated client routes by HMR #472
    • refactor: rewrote applyUnoCSS function
    • fix: avoid setting userAgent when it's already set #473
    • fix: propagate SIGINT to child process #474

    ❤️ Huge thanks to @linbingquan @pipiduck @kt3k

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-alpha.42(May 11, 2022)

    🎉🎉🎉 We just experimental provided Vue.js framework support with FS routing and data fetching!!!

    Preview: https://aleph-vue.deno.dev/ Source Code: https://github.com/alephjs/aleph.js/tree/main/examples/vue-app

    ❤️ Huge thanks to @linbingquan

    Screen Shot 2022-05-11 at 09 00 11

    Other Changes

    • Added typings for route Data, and now you don't need to return Response object in date getter/actions. return new Response(JSON.string({}), { headers: [["content-type": "application/json"]] }) is so painful, we like web standards, but sometimes it is so formalism.

    https://user-images.githubusercontent.com/2883484/167751094-77a61ca2-34e4-48a8-9931-bab19259732c.mov

    • Added server error handling api
      serve({
        ...
        onError: (error, cause) => {
          if (cause.by === "ssr" && error instanceof ApiErrorn && error.code === "NotFound") {
            return Response.redirect("/", 302);
          }
        },
      });
      
    • Improved the error UI Screen Shot 2022-05-11 at 09 21 22
    • Improved HTTP cache (add Cache-Control or Etag header for requests automatically)
    • Refactored UnoCSS work mode and style loader (build 10x faster when ssr and use CSSStyleSheet to manage module CSS rules)
    • Moved compiler to https://github.com/alephjs/aleph-compiler to make this repo test faster
    • And some other bugfixs/performance improvement/dependencies upgrade
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-alpha.28(Apr 30, 2022)

    🎉 We implemented the ESM bundling for build mode

    👎 1.0.0-alpha.27: https://aleph-hello-zay950jqmpy0.deno.dev/ (25 JS files loaded in 65.6kb without polyfill) 👍 1.0.0-alpha.28: https://aleph-hello.deno.dev/ (5 JS files loaded in 57.2kb with compat polyfill)

    Screen Shot 2022-05-01 at 03 30 26 Source code(tar.gz)
    Source code(zip)
  • 1.0.0-alpha.26(Apr 29, 2022)

    breaking change: renamed atomicCSS to unocss of server config, we are looking for supporting aleph.js server config in unocss official vscode extension: https://github.com/unocss/unocss/pull/903

    serve({
      config: {
        unocss: {
          presets: [ ... ],
        },
      }, 
    });
    
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-alpha.20(Apr 24, 2022)

    Hi, long time! We finally got some progress on the new architecture rewrite! Please have a look at the demo apps deployed to Deno Deploy with the new architecture (1.0.0-alpha.20):

    • React Hello-world: https://aleph-hello.deno.dev/
    • Vue Hello-world: https://aleph-vue.deno.dev/
    • React 18 Suspense SSR: https://aleph-suspense-ssr.deno.dev/
    • UnoCSS(tailwind): https://aleph-unocss.deno.dev/
    • Monaco Editor: https://aleph-monaco-editor.deno.dev/

    You can find the source code here: https://github.com/alephjs/aleph.js/tree/main/examples

    Currently, we are working on the new architecture docs https://github.com/alephjs/alephjs.org/pull/58, will publish a draft very soon, see you then!

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-alpha.1(Apr 20, 2022)

    • Deno Deploy first
    • better data fetching:
      import { useData } from "aleph/react";
      import "../style/index.css";
      
      let count = 0;
      
      export const data = {
        get: (req: Request) => {
          return new Response(JSON.stringify({ count }));
        },
        post: async (req: Request) => {
          const { action } = await req.json();
          if (action === "increase") {
            count++;
          } else if (action === "decrease") {
            count--;
          }
          return new Response(JSON.stringify({ count }));
        },
      };
      
      export default function Index() {
        const { data, isLoading, isMutating, mutation } = useData<{ count: number }>();
        return (
           <div className="counter">
            <span>Counter:</span>
            {isLoading && <em>...</em>}
            {!isLoading && <strong>{data?.count}</strong>}
            <button
              disabled={Boolean(isMutating)}
              onClick={() => mutation.post({ action: "decrease" }, "replace")}
            >-</button>
            <button
              disabled={Boolean(isMutating)}
              onClick={() => mutation.post({ action: "increase" }, "replace")}
            >+</button>
          </div>
        );
      }
      
    • highly customizable server:
      // server.tsx
      import { renderToString } from "react-dom/server";
      import { Router } from "aleph/react";
      import { serve } from "aleph/server";
      
      serve({
        config: {
          routeFiles: "./routes/**/*.tsx",
          atomicCSS: {
            presets: [presetWindi()]
          }
        },
        middlewares: [
          new Session({ cookieName: "session" }),
          new GithubAuth({ accessToken: "xxx" })
        ],
        fetch: (req, ctx) => {
          ctx.session.get("username");
        },
        ssr: (ctx) => {
          return renderToString(<Router ssrContext={ctx} />);
        },
      });
      
    • use index.html as the client entry
    • transpile jsx/ts/ts for browsers on-demand
    • hmr (built-in react fast refresh)
    • use parcel css
    • builtin atomic CSS (unocss)
    • support any UI libarary and ssr
    • file system routing
    • html rewriter
    • and more...
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-beta.19(Sep 26, 2021)

    • Add deno.json after init command with types that works in Deno and the browser (fix #405)
      {
        "compilerOptions": {
          "target": "esnext",
          "lib": [
            "dom",
            "dom.iterable",
            "dom.asynciterable",
            "deno.ns",
            "deno.unstable"
          ]
        }
      }
      
    • Use fastTransform in prod mode (fix https://github.com/alephjs/esm.sh/issues/181)
    • Fix exit code of build subprocess
    • Don't render '/favicon.ico'
    • Upgrade swc deps
    • Upgrade esbuild to 0.13.2
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-beta.18(Sep 24, 2021)

    • Allow useDeno and ssr.props to access Request (close #22, #364, #401)
      export default function Page() {
        const isLogined = useDeno(req => {
          return req.headers.get('Auth') === 'XXX'
        }, { revalidate: true })
      
        return (
          <p>isLogined: {isLogined}</p>
        )
      }
      

      with ssr.props options:

      export const ssr: SSROptions = {
        props: req => {
          return {
             $revalidate: true,
             username: req.params.username,
             logined: req.headers.get('Auth') === 'XXX'
          }
        }
      }
      
    • Add code highlight for the markdown plugin (optional)
      export default <Config> {
        plugins: [
          markdown({
            highlight: {
              provider: 'highlight.js',
              theme: 'github'
            }
          }),
        ]
      }
      
    • Update css.cache config to true by default
    • More useful Error in import onerror (#403) @TjeuKayim
    • Add Props generic to SSROptions (#402) @tatemz
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-beta.17(Sep 20, 2021)

    • Improve module rebuild strategy when the config/plugins/import maps updated
    • Fix import remote CSS on production build (#388)
    • Fix esbuild resolver doesn't support file://path/mod.ts?foo=bar#tag
    • Fix the lang attribute of the <html> tag generated by SSG (#399) @calmery
    • Fix i18n routing (#397) @calmery
    • Add i18n and remote css examples

    Credits

    Huge thanks to @calmery

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-beta.15(Sep 18, 2021)

    • Add json-loader offical plugin
    • Fix SSR data passing (#383) @Nkzn
    • Fix invalid jsFile on windows (#389)
    • Await renderListener callback (#393) @TjeuKayim
    • Fix existsFile usage (#394) @getspooky
    • Migrate from denolib/setup-deno to denoland/setup-deno (#387) @uki00a
    • Upgrade esbuild to 0.12.28
    • Upgrade swc deps
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-beta.12(Sep 5, 2021)

    • Add a fastTransform function using esbuild to transpile remote non-jsx modules instead of swc
    • Improve framework setup perfermance (2x faster)
    • Add --no-check flag in install script
    • Fix css @import is not working
    • Upgrade esbuild to 0.12.25
    • Upgrade swc deps
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-beta.10(Sep 2, 2021)

  • v0.3.0-beta.9(Sep 1, 2021)

  • v0.3.0-beta.8(Aug 29, 2021)

  • v0.3.0-beta.7(Aug 29, 2021)

  • v0.3.0-beta.6(Aug 27, 2021)

    • Support Vercel Functions
      • Runtime: https://github.com/alephjs/vercel-aleph
      • Optional to create vercel.json in init command
    • Remove postcss types check to get better ci speed
    • Fix upgrade command
    • Fix useDeno rendering unstable
    • Upgrade swc deps
    • Upgrade esbuild to 0.12.24
    • Upgrade std to 0.106.0
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-beta.3(Aug 25, 2021)

    • Rename plugin API onSSR -> onRender that allows you to change the HTML even in SPA mode · breaking
    • Fix cache NOT update in production mode
    • Improve ssr data fetching
    • Improve init command (#343)

    Credits

    Huge thanks to @getspooky

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-beta.2(Aug 25, 2021)

  • v0.3.0-beta.1(Aug 23, 2021)

    • Rewrite Plugin system
    • Use Deno native http instead of std http
    • Support API middleware
    • Strip SSR code in browser
    • Add ssr options for pages
      import type { SSROptions, Router } = 'aleph/types.ts'
      
      export const ssr: SSROptions = {
        props: async (router: Router) => ({ ... }),
        paths: async () => [ ... ], // static paths for dynamic route
      }
      
      export default function Index(ssrProps) {
        return (
          <div>ssr props: {ssrProps}</div>
        )
      }
      
    • CSS Modules Magic
      import React from "https://esm.sh/react";
      
      export default function App() {
        return (
          <>
            <link rel="stylesheet"  href="../style/app.module.css" />
            <h1 className="$title $bold">Hi :)</h1>
            <p className="$intro">Welcome!</p>
          </>
        );
      }
      
    • Improve dev bootstrap time for large app (compile on demand)
    • Improve HMR (refresh page when useDeno was updated)
    • Support import maps in aleph.config.ts (fix #323)
    • Don't resolve remote deps in API modules
    • Don't process .css files in ./public folder (fix #304)
    • Update docs: https://alephjs.org/docs
    • Bugfixs #320 #341
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.33(May 15, 2021)

    • Imporove HMR preformance (store compiled code in memory for speed up)
    • Minify polyfills (200kb -> 4kb)
    • Update minDenoVersion to 1.10.1
    • Add Fallback component for dynamic hoc
    • Add key option for useDeno
    • Remove withDeno hoc · breaking
    • React version respects import maps (#223)
    • Upgrade std to 0.96
    • Upgrade esbuild to 0.11.22
    • Fix import maps when has srcDir configured
    • Fix dead loop when compile modules (fix #294)
    • Fix semantic version comparison (fix #312)
    • Support ident callback argument in useDeno (fix #301)
    • Fix the condition of meta.className (#303)

    Credits

    Huge thanks to @noverby @kamchy @hyakt

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.32(Apr 25, 2021)

    • Stable loader plugin API
      type LoaderPlugin = {
        /** `name` gives the plugin a name. */
        name: string
        /** `type` specifies the plugin type. */
        type: 'loader'
        /** `test` matches the import url. */
        test: RegExp
        /** `acceptHMR` enables the HMR. */
        acceptHMR?: boolean
        /** allowPage` allows to load the module as a page. */
        allowPage?: boolean
        /** `resove` resolves the module url. */
        resolve?(url: string): ResolveResult
        /** `load` loads the source content. */
        load?(input: { url: string, data?: any }, app: ServerApplication): LoaderOutput | Promise<LoaderOutput>
      }
      
    • Move CSS processor as a builtin loader
    • Add CSS extractSize and remoteExternal config option
    • Add toString method fo RouterURL
    • Add Land PERMISSIONS
      land aleph -v
      
    • Add framework/core/events testing (#292)
    • Use pathname + querystring as SSR key (#286)
    • Fix dead loop when self-import (#285)
    • Fix Markdown-Loader (#289)
    • Upgrade std modules to 0.94.0
    • Upgrade esbuild to 0.11.14

    Credits

    Huge thanks to @stereosteve @cdoremus @hyakt @KotlinIsland

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.31(Apr 19, 2021)

    • Enhance compilation Before this updates, we transpile modules in a synchronized queue, but some IO events speed a lot of time to get resoure, for example download the remote content, the next compilation task needs to wait the previous task done. so basically the first bootstrap time is vary slow. This update imporved this to allow alephjs to compile modules asynchronously that should gives a better bootstrap time.
    • Fix createHtml function breaks script src (#271)
    • Fix oak middleware (#284)
    • Add router state to handle pre-redirects (#283)
    • Added tests to helper_test.ts to improve coverage (#282)
    • Upgrade esbuild to 0.11.12

    Credits

    Huge Thanks to @cdoremus

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.30(Apr 17, 2021)

    • Use esbuild bundler instead of deno(swc) bundler
    • Use esbuild to minify css instead of cleanCSS
    • Add browserslist config option
    • Add es2016-es2021 polyfills for production mode
    • Add oak middleware
    • Add signal option for std server
    • Add hostname for APIRequest (#267)
    • Add tests for redirect.ts (#268)
    • Show prompt when the import_map is incorrect
    • Fix Anchor tag respects modifiers (#275)
    • Fix bundler loop compilation (#278)
    • Fix export * from "..." statement in bundle mode (#280)
    • Upgrade std to 0.93

    Credits

    Huge thanks to @cdoremus @getspooky @stereosteve

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.29(Apr 13, 2021)

    • Add hostname field for APIRequest (#267)
    • Add redirect method for APIRequest (#266)
    • Add compress option for Config
    • Rename baseURL to basePath of Config · Breaking
    • Improve useDeno rendering
    • Fix HMR connection with baseUrl option (#257)
    • Fix build command don't respect the outputDir option (#263)
    • Fix useDeno hook deps
    • Fix markdown loader plugin

    Credits

    Huge thanks to @getspooky @chibat

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.28(Apr 10, 2021)

  • v0.3.0-alpha.26(Apr 10, 2021)

    • Support CSS modules
    • Fix stylesheet mismatch pages in SSR (#230)
    • Improve API request compression
    • Fix unescaped regex (#259 @KotlinIsland)
    • Added tests for module.ts (#261 @cdoremus)
    • Upgrade std deps to 0.92
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.25(Apr 4, 2021)

    • Remove sass and wasm plugin · Breaking
    • Allow the revalidate of useDeno hook to 0
    • Fix jsFile is invalid on windows port (#201)
    • Add fs module testing (#248 @cdoremus )
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.24(Apr 1, 2021)

    • feat: re-add the postcss option for Config type
    • breaking: update runtime env
    • fix: fix src dir detection (#226)
    • fix: fix anchor component redirect (#227)
    • fix: rebuild when postcss plugins changed
    • fix: fix dynamic hoc typing
    • fix(plugins): fix sass importing
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.23(Apr 1, 2021)

    • feat: update react to 17.0.2
    • breaking: remove the staticPaths option of ssr
    • breaking(plugin): rename laoderoption asPage -> allowPage
    • refactor(compiler): add fixedReactEsmShBuildVersion transform option (#232)
    • refactor: minify bundler runtime code
    • fix: fix Anchor component (#227)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-alpha.22(Mar 28, 2021)

Owner
Aleph.js
Build Modern Web Apps in Deno.
Aleph.js
Next-generation DOM manipulation

Ractive.js - Next-generation DOM manipulation Have any questions or just want to chat? Join us on GitHub Discussions! What is Ractive.js? It's a JavaS

Ractive.js 5.9k Jan 4, 2023
The worlds smallest fully-responsive css framework

FLUIDITY A fully responsive css framework that is impossibly small HTML is almost 100% responsive out of the box. This stylesheet patches the remainin

murmurs 1.1k Sep 24, 2022
An HTML5/CSS3 framework used at SAPO for fast and efficient website design and prototyping

Welcome to Ink Ink is an interface kit for quick development of web interfaces, simple to use and expand on. It uses a combination of HTML, CSS and Ja

SAPO 1.9k Dec 15, 2022
🌟 DataFormsJS 🌟 A minimal JavaScript Framework and standalone React and Web Components for rapid development of high quality websites and single page applications.

?? Welcome to DataFormsJS! Thanks for visiting! ?? ?? ?? ?? ?? ?? 中文 (简体) 欢迎来到 DataFormsJS Español Bienvenido a DataFormsJS Português (do Brasil) Bem

DataFormsJS 156 Dec 8, 2022
HTML Framework that allows you not to write JavaScript code.

EHTML (or Extended HTML) can be described as a set of custom elements that you can put on HTML page for different purposes and use cases. The main ide

Guseyn Ismayylov 171 Dec 29, 2022
One framework. Mobile & desktop.

Angular - One framework. Mobile & desktop. Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScr

Angular 85.7k Jan 4, 2023
Ember.js - A JavaScript framework for creating ambitious web applications

Ember.js is a JavaScript framework that greatly reduces the time, effort and resources needed to build any web application. It is focused on making yo

Ember.js 22.4k Jan 8, 2023
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Supporting Vue.js Vue.js is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome ba

vuejs 201.7k Jan 8, 2023
The tiny framework for building hypertext applications.

Hyperapp The tiny framework for building hypertext applications. Do more with less—We have minimized the concepts you need to learn to get stuff done.

Jorge Bucaran 18.9k Jan 4, 2023
A framework for building native apps with React.

React Native Learn once, write anywhere: Build mobile apps with React. Getting Started · Learn the Basics · Showcase · Contribute · Community · Suppor

Facebook 106.8k Jan 3, 2023
The Backbone Framework

Marionette.js The Backbone Framework Marionette v5 Marionette is dropping its dependency on Backbone. That library is available here: https://github.c

Marionette.js 7.1k Jan 5, 2023
MVC framework making it easy to write realtime, collaborative applications that run in both Node.js and browsers

Derby The Derby MVC framework makes it easy to write realtime, collaborative applications that run in both Node.js and browsers. Derby includes a powe

DerbyJS 4.7k Dec 31, 2022
A JavaScript Framework for Building Brilliant Applications

mithril.js What is Mithril? Installation Documentation Getting Help Contributing What is Mithril? A modern client-side JavaScript framework for buildi

null 13.5k Dec 26, 2022
Better MV-ish Framework

❗ I started working on this project in 2012. React didn't exist, Angular didn't have a stable 1.0 release, Internet Explorer 7, 8, 9 was used by 35% o

Antonio Stoilkov 2.8k Jan 1, 2023
A framework for real-time applications and REST APIs with JavaScript and TypeScript

A framework for real-time applications and REST APIs with JavaScript and TypeScript Feathers is a lightweight web-framework for creating real-time app

Feathers 14.2k Dec 28, 2022
A rugged, minimal framework for composing JavaScript behavior in your markup.

Alpine.js Alpine.js offers you the reactive and declarative nature of big frameworks like Vue or React at a much lower cost. You get to keep your DOM,

Alpine.js 22.5k Dec 30, 2022
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Bootstrap Sleek, intuitive, and powerful front-end framework for faster and easier web development. Explore Bootstrap docs » Report bug · Request feat

Bootstrap 161.1k Jan 4, 2023
Semantic is a UI component framework based around useful principles from natural language.

Semantic UI Semantic is a UI framework designed for theming. Key Features 50+ UI elements 3000 + CSS variables 3 Levels of variable inheritance (simil

Semantic Org 50.3k Jan 3, 2023