Code Monkey home page Code Monkey logo

deno-embedder's People

Contributors

7flash avatar nfnitloop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

galaxydo 7flash

deno-embedder's Issues

Feature: Add ETag support

This is a feature I requested and used in rust-embed: pyrossh/rust-embed#140

Would be nice to have it here too.

  • Update the generator to save LastModified
  • Update the generator (or just ad a lazy method) to provide a sha-256 hash of the bytes.
  • Update the oak helpers to properly serve requests w.r.t. Tag/Last-Modified

Support async `import()`s

The current implementation of Deno Embedder creates a dir.ts file which imports all files for an embed directory.

This means that if you have a large set of embeds, you pay the cost of loading all of those embeds every time you start your application, even if you're not going to use them all.

It would be great if we could create a files list like:

const files = {
  "Smiley.svg": () => import("./Smiley.svg_.ts"),
  "index.html": () => import("./index.html_.ts"),
} as const

That way, we'd only need to import one of the embedded files if it's requested.

Blockers

I thought this new feature would allow using dynamic imports:
https://deno.com/blog/v1.32#deno-compile-support-for-web-workers-and-dynamic-import

However, the current implementation seems limited to binaries built with deno compile.

  • deno compile has access to all dynamic imports without requiring additional permissions.
  • deno install does not install dynamic imports, and they must be imported from network/disk, by granting extra permissions to do so.
  • deno run also requires extra permissions to load dynamic imports. (This impacts "dev mode".)

My goal for Deno Embedder is for it to "just work" for all these cases, so I'm not going to bother supporting dynamic imports until Deno supports the above cases.

Upstream tracking issues:

non-dev mode for (re)generating files.

As part of a build, it would be nice to be able to re-generate embedded files to make sure they're the most up-to-date versions. (that is: without starting up "dev mode" and then having to kill that server.)

Preferably, there would be an option to also just check that the generated files and return an error if they're not up-to-date.

"Getting Started" docs

Right now I just point to the sample repo.

While it does have a lot of comments to help guide users, a proper README guiding through setup would be better. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.