Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 01:41
    hayd commented #3711
  • 01:38

    denobot on gh-pages

    Update benchmarks (compare)

  • 01:35
    crookse edited #3768
  • 01:33
    crookse edited #3768
  • 01:33
    crookse edited #3768
  • 01:32
    crookse opened #3768
  • 01:31
    serverhiccups edited #3667
  • 01:31
    serverhiccups opened #3767
  • 01:22

    ry on master

    Upgrade rusty_v8 to 0.2.0 (#376… (compare)

  • 01:22
    ry closed #3764
  • 01:18
    serverhiccups review_requested #3667
  • 01:18
    serverhiccups commented #3667
  • 01:10
    serverhiccups edited #3667
  • 01:09
    serverhiccups synchronize #3667
  • 00:32
    serverhiccups commented #3667
  • 00:31

    piscisaureus on upgrade_rusty_v8

    Upgrade rusty_v8 to 0.2.0 fix (compare)

  • 00:29
    serverhiccups synchronize #3667
  • 00:14
    piscisaureus synchronize #3764
  • Jan 23 23:54
    kevinkassimo commented #1421
  • Jan 23 23:51
    kevinkassimo commented #1421
Nikos
@QuantumInformation
image.png
Eric Crooks
@crookse
@base698 , i haven't tried uploading a file myself, but maybe something like this will work:
async function getBody(request) {
  const decoder = new TextDecoder();
  return decoder.decode(await Deno.readAll(request.body));
}
@QuantumInformation , are you getting the 500 error because you're not running file_server without --allow-read flag?
Nikos
@QuantumInformation
ah yes
@crookse this doesnt work either
deno run --allow-net --allow-env deno_overrides/file_server.ts --allow-read
Eric Crooks
@crookse
deno run --allow-net --allow-env --allow-read deno_overrides/file_server.ts
Nikos
@QuantumInformation
works
I'll add this file to github somewhere now
Eric Crooks
@crookse
:)
glad it works!
Nikos
@QuantumInformation
cool, next thing, how do i get modules to import?
image.png
will fail with
image.png
Elijah
@sudo97
Hi, I wanna have experience with deno and such projects, but I only work as Javascript developer. So where do I start? And which topics should I know well to contribute?
Nikos
@QuantumInformation
ill make some youtube vids on it soon
Think that will work
Eric Crooks
@crookse
@base698 , oh wow. i didn't even know that existed. cool! going to look into that more today.
Justin Thomas
@base698
To use that you need to know the boundary of the multiparty, which is in the header content type, it seems like there would be a way to do it off the req
Eric Crooks
@crookse
@QuantumInformation , in that case you would need to pass requests properly to your /src directory. in your file_server.ts, you'll need to parse mime types so that any file you request is properly rendered by your browser. to do this, add the following towards the top of your file_server.ts file:
import { contentType } from "https://deno.land/x/std/media_types/mod.ts";
and below the line where you set text/html as the content type, you'll want to do something like this:
  if (req.url.includes("/src")) {
    let fileParts = req.url.split(".");
    const extension = fileParts.pop();
    const mimeType = contentType(extension);
    headers.set("Content-Type", mimeType);
  }
granted, this hardcodes requests being filtered to /src, but you get the point. also, your import statement on your front-end should inlclude the .js extension so that the code i've written above can parse the extension and pass it to the media_types module for mime type parsing
Nikos
@QuantumInformation
@crookse wow many thx, are imports realtive to the html file or the server?
im getting not found
image.png
for
import api from '../src/api'
and
import api from '/src/api'
Eric Crooks
@crookse
import api from "/src/api.js";
it's relative to the html file, but you can change that by getting fancy with how you parse requests
for example, you could reference /src/api.js on your front-end, but on your filesystem it could be in /path/to/your/project/modules/something/idk/keep-going/src/api.js
i know directory traversal is a concern in some node projects, but i haven't been able to traverse in my deno projects (at least not yet) if that's a concern you have with relative imports.
Luca Casonato
@lucacasonato
@Tallestthomas there are multiple hashing algorithms available on deno.land/x: https://deno.land/x/sha256/README.md
generative99
@generative99
Sorry to ask again but is anyone debugging in VSCode? All of the extensions seem to assume debugging an .exe. Just wondering how to configure lldb to work with vscode, thanks
Nikos
@QuantumInformation
ah the .js, i should have known that since I made this issue lol microsoft/TypeScript#16577
Eric Crooks
@crookse
just guessing here, but you might need to import this way import * as api from "/src/api.js"; since your api.js file doesn't have export default
Nikos
@QuantumInformation
It was my mistake, empty method
its annoying how all imports are relative from index
eg how i have to import the api from logger
image.png
breaks all ide support
Eric Crooks
@crookse
yea i don't have anything to help you there :/ sorry
Nikos
@QuantumInformation
im just gonna flatten them to root dir)
nicksofn
@nicksofn
Hi all this may not be the right place to post this but I submitted a request to IBM to help deploy Deno to the IBM i through IBM i's curated repository. Any votes for this would be appreciated.
http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=139651
Nikos
@QuantumInformation
@crookse @bartlomieju was so happy to show this proof of concept today and then tell me friends there's none of the node modules
Eric Crooks
@crookse
:)
Tom Scott
@tubbo
hey folks, i just saw some of the talks on Deno and i'm excited for what this has to offer :)
in one of those talks, ry mentioned something about a pathway from going JavaScript -> TypeScript -> Rust, e.g. prototyping something in JS, then "graduating" to TS when you add types, and if you need better performance, a way to interoperate between Rust and JS
is this something you can do when building a Deno program? or do you have to build a Rust "wrapper" program around Deno and embed the crate to get this kind of functionality?
Nayeem Rahman
@nayeemrmn
@tubbo You'd gradually move work over to plugins