profile
viewpoint
Luca Casonato lucacasonato @antipycorp Netherlands https://lcas.dev Programmer - love Go, Typescript & Flutter. Contributor to @denoland. 🚀🏳️‍🌈🇪🇺🌻💚

hayd/deno-lambda 414

A deno runtime for AWS Lambda. Deploy deno via SAM, serverless, or bundle it yourself.

hayd/deno-docker 323

Latest dockerfiles and images for deno - alpine, centos, debian, ubuntu

denoland/deno_registry2 27

The backend for the deno.land/x service

lucacasonato/deno_s3 6

Amazon S3 for Deno

lucacasonato/deno-fetchevent 2

FetchEvent based server compatible with browser.

lucacasonato/deno_sqs 2

Amazon SQS for Deno

lucacasonato/date_extensions 1

Extensions to the default dart DateTime class

lucacasonato/deno_website2 1

deno.land website

codelympicsdev/api 0

API for codelympics.dev

codelympicsdev/auth 0

Auth screen for codelympics.dev

issue commentdenoland/deno

Cargo build error

@rodude123 Please update to rust 1.45

ChaboCode

comment created time in 7 hours

issue commentdenoland/deno

Uncaught Error: Uncaught ReferenceError: Deno is not defined

@ShreyashSaitwal

The first issue: you are importing https://deno.land/x/std/fs/expand_glob.ts somewhere (maybe in a different module you import in the worker). std/fs requires the Deno global to be present. The first issue is thus correct.

The second issue: this error occurs because you are passing some directory into the expandGlob function that does not exist. If you pass in a valid (existing) directory it will work.

ShreyashSaitwal

comment created time in 7 hours

issue commentdenoland/deno

Rename --importmap to --import-map

Yes, I am depending on importmap aka import-map to close some holes that Deno leaves open as described by @nayeemrmn in #6294. Please don't remove this unless you provide an alternate way of achieving better sandboxing.

The more proper solution (also described in #6294) is to serve your files from a local webserver. This will prevent file:// imports.

nayeemrmn

comment created time in 7 hours

delete branch lucacasonato/deno

delete branch : add_missing_globals_to_diagnostics

delete time in 7 hours

delete branch lucacasonato/deno_website2

delete branch : file_search

delete time in 10 hours

push eventdenoland/deno_website2

Luca Casonato

commit sha d7b3a9150509a92fc752a5913845349e11e7409e

feat: add file finder (#1454)

view details

push time in 10 hours

PR merged denoland/deno_website2

feat: file search

You can now search an entire directory / module recursively for filenames. The shortcut to select the search bar is t. This is the same as on GitHub.

+243 -146

5 comments

2 changed files

lucacasonato

pr closed time in 10 hours

pull request commentdenoland/deno_website2

feat: file search

The slash on the search button says which one they expected to be used :D

Why not both?

The / is for the full repo search in the top left. t is for what GitHub calls the file finder

lucacasonato

comment created time in 10 hours

pull request commentdenoland/deno_website2

feat: file search

Why 't'?

It is the hotkey on GitHub so I thought people would be familiar with it. I can change it to / though.

lucacasonato

comment created time in 10 hours

issue closeddenoland/deno

Deno.compile doesn't rename imports

When using Deno.compile (v1.1.1), the output doesn't have the import paths with the correct ext

Compile config:

const [messages, result] = await Deno.compile(input, undefined, {
    target: 'es6',
    module: 'es6',
    lib: ['dom', 'esnext'],
  })

Source:

image

Output:

image

closed time in 10 hours

leonelv

issue commentdenoland/deno_registry2

Moderation filters

Unless I'm misunderstanding I'm not sure how this can possibly work. E.g. eslint and tslint, or any two dictionary words that happen to be a letter apart https://listography.com/spamtastic/words/that_are_one_letter_apart let alone 3.

I am not locked into the exact distance (if 1 gives desired results, we can do that). What we are trying to prevent is someone registering oak2 or oakk or 0ak. So that if you mistype or are not too familiar with Deno modules yet you do not accidentally install the wrong module (that might be malicious). I don't want someone to publish color and someone else to publish colour. Things like that are so confusing.

Yeah, this means that some module names are not available, but I think that cost is worth it.

What do npm or cargo do about this?

AFAIK npm does nothing about this (see https://www.npmjs.com/package/exxpress or https://www.npmjs.com/package/expres). For cargo I do not know.

lucacasonato

comment created time in 11 hours

issue commentdenoland/deno_registry2

Track download counts

@narwy We don't use CloudFront or Lambda @ Edge at the minute. (Also I quite dislike Lambda @ Edge because of the unreasonable pricing and runtime limitations - I don't want to use Node or Python). I want to stick to the CloudFlare Worker we have now.

I feel like we should setup a Terraform config to setup AWS also

We have a CloudFormation config. I don't see the point of moving it to Terraform. I have had enough trouble with CloudFormation (it finally works) and don't really fancy repeating that 'fun' at the minute :-). Maybe in a month or two

lucacasonato

comment created time in 11 hours

issue openeddenoland/deno_registry2

Moderation filters

We should automatically moderate the names of modules people are uploading. I think we can start with these three steps (ordered by priority):

  1. Add a list of reserved module names that can not be registered automatically. Easiest would be a json file with an array of disallowed names. (@lucacasonato)
  2. Check any new module name against a list of 'bad' words. We need to find a list to use (https://www.cs.cmu.edu/~biglou/resources/bad-words.txt is not good as it blocks words everyday words like color, queer, or africa). (up for grabs)
  3. Disallow any module names that have a levenshtein distance of less than 3 to any other existing module name, bad word, or reserved module name. (up for grabs)

created time in 14 hours

issue commentdenoland/deno_registry2

Track download counts

In this case we would be storing each event in MongoDB though right? That seems kinda bad because of the amount of events we receive on a daily basis. I think we should have a single MongoDB document per module, (or module version or file) that tracks the download count per day.

lucacasonato

comment created time in 14 hours

issue openeddenoland/deno_registry2

Track download counts

Goal

We want to have a graph of module download counts like crates.io has. This means that we should have a list of the download counts per module (or module version, or per file) per day.

How to implement

Through discussions with @wperron on Discord we came up with two relatively simple solutions:

  1. SQS + Lambda + MongoDB
    • Have the CloudFlare Worker that serves the raw files add an event to a SQS queue every time it serves a file.
    • Have a AWS Lambda take events out of this queue in batches of 500 and persist them into MongoDB.
    • Create an API endpoint that serves the download count per module (or per module version or per file).
  2. Kinesis Firehose + S3 + Lambda + MongoDB
    • Have the CloudFlare Worker that serves the raw files add an event to a Kinesis Firehose stream every time it serves a file.
    • Have Kinesis Firehose persist this data into S3 as batches
    • Have a cron triggered Lambda that takes batches out of S3 and persists them into MongoDB
    • Create an API endpoint that serves the download count per module (or per module version or per file).

I am personally more in favour of solution 1 because I feel it is relatively simple to set up (haven't used Kinesis Firehose before).

Decisions to make

  • [ ] Track download counts per module or per module version or per file?
  • [ ] SQS or Kinesis Firehose

created time in 15 hours

delete branch denoland/deno_registry2

delete branch : push-webhook

delete time in 15 hours

PR merged denoland/deno_registry2

feat: trigger on push webhook

TODO:

  • [x] Add integration tests
  • [x] Test that this works in my staging environment

Closes #34

+1257 -82

0 comment

10 changed files

lucacasonato

pr closed time in 15 hours

issue closeddenoland/deno_registry2

Webhooks should handle all event types

If the user selects "Send me everything." or "Just the push event." it should still work.

closed time in 15 hours

ry

issue closedmanyuanrong/deno_mongo

import mongo@v0.10.0 not found

I tried the getting started and I'm getting this error:

Download https://deno.land/x/mongo@v0.10.0/mod.ts
error: Import 'https://deno.land/x/mongo@v0.10.0/mod.ts' failed: 404 Not Found

I upgraded deno

$ deno --version
deno 1.2.3
v8 8.6.334
typescript 3.9.2

I tried with the 0.9.0 and it worked, so it has to do with the 0.10.0.

Any idea what might cause the problem ?

closed time in 16 hours

bidoubiwa

issue commentmanyuanrong/deno_mongo

import mongo@v0.10.0 not found

0.10.1 is published to deno.land/x now

bidoubiwa

comment created time in 16 hours

issue closedmanyuanrong/deno_mongo

Reconnect to deno.land/x

We recently made some changes to deno.land/x, which requires that you reconnect your module. You can do this at https://deno.land/x#add. More info: https://deno.land/posts/registry2

Because of this deno_mongo v0.10.0 is not available on deno.land/x yet.

closed time in 16 hours

lucacasonato

issue commentmanyuanrong/deno_mongo

Reconnect to deno.land/x

@manyuanrong Thanks :-)

lucacasonato

comment created time in 16 hours

PR opened denoland/deno_website2

feat: file search

You can now search an entire directory / module recursively for filenames. The shortcut to select the search bar is t. This is the same as on GitHub.

+243 -146

0 comment

2 changed files

pr created time in 19 hours

push eventdenoland/deno_website2

tokiedokie

commit sha 499b3658504e9d745943a995ff53af2edc6d8fa2

fix: move `deno info` and `deno fmt` into InlineCode tag (#1453)

view details

push time in 19 hours

PR merged denoland/deno_website2

add InlineCode tag fot `deno info`, `deno fmt` in top page

On top page's deno highlight, there is

  • Has built-in utilities like a dependency inspector (deno info) and a code formatter (deno fmt).

deno info and deno fmt are commands not just strings, so these should look like commands same as

To make it easier to consume third party modules Deno provides some built in tooling like deno info and deno doc. deno.land also provides a web UI for viewing module documentation. It is available at doc.deno.land.

in Third Party Modules section in the same page

+3 -2

0 comment

1 changed file

tokiedokie

pr closed time in 19 hours

create barnchlucacasonato/deno_website2

branch : file_search

created branch time in 19 hours

issue commentdenoland/deno_registry2

Projects with dot in the name

Why?

Because we try to minimize confusion when looking at modules, and having 3-4 modules with slightly different variants of the same name is very annoying (e.g foo foo.js foojs foo_js foo-js). The first step in that is to reduce the amount of different characters a module name can have (our set is _, a-z, and 0-9). The second step that we will implement soon is to disallow any module names which are within 1-2 changes away from any other module name (levenshtein distance).

lem0nify

comment created time in a day

issue commentdenoland/deno_registry2

Projects with dot in the name

🤷 - the module author seems to have published it there now? We knew a few packages were going to break because they were unversioned (and we are sorry for any inconvenience this may have caused), but we reserved all modules to their original repositores so the authors could publish a version right away. Our new naming guidelines do not permit . in names (but old packages with names that include . were grandfathered in), so I take it some module authors just published under a new name.

lem0nify

comment created time in a day

issue commentdenoland/deno_registry2

Module Search Does Not Reflect Value

Yeah I originally wanted to use Algolia, but ultimately we decided on MongoDB Atlas full text fuzzy search because it was simpler to integrate. I kinda wanna move to Algolia now because of the horrendous results we are getting from MongoDB Atlas. I'll add it to the roadmap

ebebbington

comment created time in 2 days

push eventdenoland/deno_registry2

Luca Casonato

commit sha 1d533c134d00e0d419d2f6976858f5c6d24812f6

add tests

view details

push time in 2 days

push eventdenoland/deno_registry2

Luca Casonato

commit sha 644500260157bea3ae196c599a2c7423dd4894ed

fix: less caching on module metadata (#48)

view details

Luca Casonato

commit sha 7c9bfaef5f5d3df19c2cad5cd0bbd3792dd99c1a

tests: first pass at integration tests (#44)

view details

Luca Casonato

commit sha 76a8bc3973ee66192b7cb41692caa024536bb684

tests: more integration tests (#49)

view details

Luca Casonato

commit sha 9bd2ca80965893004a4f98d87598288062e9622f

chore: remove import map (#50)

view details

Luca Casonato

commit sha 940c8dfc4ace3befcf4d78238969675117a7c9c3

fix: lowercase all repository (#52)

view details

William Perron

commit sha d94996c670d1104fa1f19b0f52835401019afaeb

feat: update webhook to accept x-www-form-urlencoded requests (#54)

view details

Luca Casonato

commit sha e199f18eacdd352e6cc1d4995700b07a4fe3fa52

tests: add even more integration tests (#51)

view details

Luca Casonato

commit sha 896dfdbaecca88d62e9d5cf14c317c6408f96e29

Merge remote-tracking branch 'origin/main' into push-webhook

view details

Luca Casonato

commit sha afe4b9529e2c1c28fd55dd5cf33e8ce95830db1e

lint

view details

push time in 2 days

delete branch lucacasonato/deno_registry2

delete branch : even_more_integration_test

delete time in 2 days

push eventdenoland/deno_registry2

Luca Casonato

commit sha e199f18eacdd352e6cc1d4995700b07a4fe3fa52

tests: add even more integration tests (#51)

view details

push time in 2 days

issue closeddenoland/deno_registry2

Integration tests

This project is not well tested at the moment. We need to get a integration test for:

TODO:

  • [x] ping event success
  • [x] ping event bad name
  • [x] ping event no name
  • [x] ping event too many modules per repo
  • [x] ping event registered to different repo
  • [x] create event success
  • [x] create event bad name
  • [x] create event no name
  • [x] create event too many modules per repo
  • [x] create event not a tag
  • [x] create event version prefix
  • [x] create event subdir success
  • [x] create event subdir invalid
  • [x] create event version already exists
  • [ ] trigger build success
  • [ ] /builds/:id success
  • [ ] /builds/:id no id
  • [ ] /builds/:id not found
  • [ ] /modules success
  • [ ] /modules limit & page out of bounds

These tests should be able to run on CI without needing to deploy to AWS. We can emulate S3 with minio, and SQS using ~localstack~ elasticmq. MongoDB can just be run locally.

closed time in 2 days

lucacasonato

push eventlucacasonato/deno_registry2

Luca Casonato

commit sha 598ebdfaeba078f3c67139402d6efeeaee330717

fmt

view details

Luca Casonato

commit sha 4e7f1a1fac398e026ca79275cee3d58259b8fc4e

inherit stdio

view details

push time in 2 days

delete branch lucacasonato/deno_website2

delete branch : description_under_search

delete time in 2 days

push eventdenoland/deno_website2

Luca Casonato

commit sha 868a5ebb6d988c4c9c5ea7cbbcf709289557e315

fix: move deno.land/x description under search (#1450)

view details

push time in 2 days

pull request commentdenoland/deno_website2

Move deno.land/x description under search

That's better... but there's still something off about this 2 column layout. I suppose it will be worked out over time tho.

LGTM

Yeah I wanna rework it - I'm not gonna close your issue yet. This is just a temporary fix because I got fed up with having to scroll down to search.

lucacasonato

comment created time in 2 days

push eventlucacasonato/deno_registry2

Luca Casonato

commit sha 940c8dfc4ace3befcf4d78238969675117a7c9c3

fix: lowercase all repository (#52)

view details

William Perron

commit sha d94996c670d1104fa1f19b0f52835401019afaeb

feat: update webhook to accept x-www-form-urlencoded requests (#54)

view details

Luca Casonato

commit sha 6bb8eec205c738f1a5294832712ddfbd32c9b084

Merge branch 'main' into even_more_integration_test

view details

push time in 2 days

push eventdenoland/deno_registry2

William Perron

commit sha d94996c670d1104fa1f19b0f52835401019afaeb

feat: update webhook to accept x-www-form-urlencoded requests (#54)

view details

push time in 2 days

PR merged denoland/deno_registry2

Update webhook to accept x-www-form-urlencoded requests

Refactor content-type verification to the main handler instead of in each integration. Add tests for form urlencoded cases. Add utils function to generate mock web-form APIGateway event.

Fixes #33

+197 -22

0 comment

10 changed files

wperron

pr closed time in 2 days

issue closeddenoland/deno_registry2

Webhooks should also support content-type application/x-www-form-encoded

Would just eliminate another gotcha. Should be relatively easy to do.

closed time in 2 days

ry

issue commentdenoland/deno_registry2

Projects with dot in the name

This has nothing to do with the dots in the name. It just happens to be that some people have not updated their modules since we released the registry update.

lem0nify

comment created time in 2 days

issue closeddenoland/deno_registry2

Repository name matching should be case insensitive

https://discordapp.com/channels/684898665143206084/684898665151594506/740556533770879048

closed time in 2 days

lucacasonato

issue commentdenoland/deno_registry2

Repository name matching should be case insensitive

Fixed in #52

lucacasonato

comment created time in 2 days

push eventlucacasonato/deno

Bert Belder

commit sha 694bd9092ce667dda9db50b2a353e838afc5d40e

upgrade: rust 1.45.2 (#6980)

view details

Bert Belder

commit sha 707bfbd5b5006a905fda04581795694425aea561

upgrade: rusty_v8 0.8.1 / V8 8.6.334 (#6980)

view details

Bert Belder

commit sha f22b7dc78319c2b922770d95a512c761d8158a15

fix(cli): show error on unrecognized V8 flag, exit on --help (#6980)

view details

Bert Belder

commit sha 9806933f57e9664f4f094dbc3e17511c8daefc1b

test(cli/inspector_port_collision): fail rather than hang (#6991)

view details

Bert Belder

commit sha f17eb634faa01c0d03cd2886e740357ab9cbb5a1

test(cli/inspector_port_collision): skip test on WSL (#6991)

view details

Bert Belder

commit sha febb972dd4068bbcdbd7c416068ec46b1775de16

test(cli/stat_test): older versions of Linux don't support `birthtime` (#6991)

view details

Bert Belder

commit sha 604d008190df5c37d510f43e90f4d33f517f6e64

test(cli/wasm_unreachable): don't assume git work dir is named 'deno' (#6991)

view details

Ryan Dahl

commit sha 92a173bca618cf6ef1e54c08deee61ba617491b9

v1.2.3

view details

Ryan Dahl

commit sha 732a43735290f7e996d6252b9820bcca5724f31c

Add README for deno_web (#6997)

view details

Luca Casonato

commit sha 8073d78d7f669aca78536325de08d728840fc498

Merge branch 'master' into add_missing_globals_to_diagnostics

view details

push time in 2 days

issue commentdenoland/deno_website2

Can I use those codes under the MIT license?

There is a header on all files specifying that the code is MIT licensed so feel free to fork / copy or do whatever you want with it. The licences for all of the artwork can be found at https://deno.land/artwork.

@ry We seem to be missing a LICENCE file in this repo.

tokiedokie

comment created time in 2 days

Pull request review commentdenoland/deno_registry2

Update webhook to accept x-www-form-urlencoded requests

 export function respondJSON(     },   }; }++export function parseRequestBody(+  event: APIGatewayProxyEventV2,+): APIGatewayProxyEventV2 {+  if (event.isBase64Encoded && event.body) {+    event.body = decodeqs(atob(event.body)).payload as string ?? undefined;+  }
  if (event.isBase64Encoded && event.body) {
    event.body = atob(event.body);
    event.isBase64Encoded = false;
  }
  
  const headers = new Headers(event.headers);
  if (
    headers.get("content-type") === "application/x-www-form-urlencoded" &&
    event.body
  ) {
    event.body = decodeqs(event.body).payload as string ?? undefined;
  }
wperron

comment created time in 2 days

issue commentdenoland/deno

cjs conflict with https://deno.land/std@0.63.0/hash/mod.ts

@aaronwlee It happens if any sibling of this cjs module is a TypeScript file, not just std/hash right? In that case it is a duplicate of #6176.

aaronwlee

comment created time in 2 days

Pull request review commentdenoland/deno

v1.2.3

 https://github.com/denoland/deno/releases We also have one-line install commands at https://github.com/denoland/deno_install +### 1.2.3 / 2020.08.08++Changes in the CLI:++- fix: Never type check in deno info (#6978)+- fix: add missing globals to unstable diagnostics (#6960)+- fix: add support for non-UTF8 source files (#6789)+- fix: hash file names in gen cache (#6911)+- refactor: Encode op errors as strings instead of numbers (#6977)+- refactor: Op crate for Web APIs (#6906)+- refactor: remove repeated code in main.rs (#6954)+- upgrade to rusty_v8 0.8.1 / V8 8.6.334 (#6980)+- upgrade: deno_lint v0.1.21 (#6985)+- upgrade: swc_ecmascript (#6943)+- feat(unstable): custom http client for fetch (#6918)++Changes in std version 0.65.0:
Changes in std version 0.64.0:
ry

comment created time in 2 days

startedxcatliu/pagic

started time in 2 days

issue openedxcatliu/pagic

can't install because x/types was removed

Describe the bug

When installing pagic I get this error:

error: Import 'https://deno.land/x/types/react/v16.13.1/react.d.ts' failed: 404 Not Found

This is because deno.land/x/types was removed from deno.land/x. You can import react.d.ts from https://denopkg.com/Soremwar/deno_types/react/v16.13.1/react.d.ts.

To Reproduce deno install --unstable --allow-read --allow-write --allow-net https://deno.land/x/pagic@v0.8.2/mod.ts

Expected behavior

pagic installs without errors.

Context

  • Pagic version: v0.8.2
  • Deno version: 1.2.2
  • OS version: macOS 1.16 dev beta 2

created time in 2 days

issue commentxcatliu/pagic

deno install 好像无法安装了

Sorry this was a bug on deno.land/x. It should be fixed now. Don't forget to relink the repository with deno.land/x if you have not done so after the recent update: https://deno.land/posts/registry2

keidarcy

comment created time in 2 days

create barnchlucacasonato/deno_website2

branch : description_under_search

created branch time in 2 days

push eventlucacasonato/deno

Luca Casonato

commit sha 9cc5ef39664245b5b46b915a261273cf4e9f4f10

fmt

view details

push time in 2 days

issue commentdenoland/deno

deno exiting silently

Is the project open source? If so could you:

  1. delete your entire ~/Library/Caches/deno again
  2. run the code again until the issue occurs
  3. zip up your DENO_DIR
  4. send the DENO_DIR zip + a zip or GH link of the project (source code) + the commands you are running?

It would make debugging a lot easier.

martunta

comment created time in 2 days

Pull request review commentdenoland/deno_registry2

Update webhook to accept x-www-form-urlencoded requests

 export function createJSONWebhookEvent(   }); } +export function createJSONWebhookWebFormEvent(+  event: string,+  path: string,+  payload: unknown,+  pathParameters: KV,+  queryStringParameters: KV,+): APIGatewayProxyEventV2 {+  return createAPIGatewayProxyEventV2("POST", path, {+    headers: {+      "Accept": "*/*",+      "Content-Type": "application/x-www-form-urlencoded",+      "User-Agent": "GitHub-Hookshot/f1aa6e4",+      "X-GitHub-Delivery": "01b06e5c-d65c-11ea-9409-7e8b4a054eac",+      "X-GitHub-Event": event,+    },+    data: btoa(JSON.stringify(payload)),

I generated the four events we have in the testdata dir as x-www-form-urlencoded: https://gist.github.com/lucacasonato/81d7b03ee92f9172957e215508eb70dc. Can you add these to the testdata directory and use these as the body for the x-www-form-urlencoded tests instead of manually encoding the JSON ones?

(just add all four even though you only make use of two in the tests - we might need them later)

wperron

comment created time in 2 days

Pull request review commentdenoland/deno_registry2

Update webhook to accept x-www-form-urlencoded requests

 export function respondJSON(     },   }; }++export function parseRequestBody(+  event: APIGatewayProxyEventV2,+): APIGatewayProxyEventV2 {+  const headers = new Headers(event.headers);+  if (+    headers.get("content-type") === "application/x-www-form-urlencoded" &&+    event.body+  ) {+    event.body = atob(event.body);
  1. I think this base64 decode should happen based on the isBase64Encoded property on the APIGatewayProxyEventV2, not based on content-type. This base64 comes from AWS, not because the content is x-www-form-urlencoded.

  2. GitHub doesn't just send JSON when using x-www-form-urlencoded. You need to strip the payload= from the start of the body, and run it thru decodeURIComponent to get the JSON body.

wperron

comment created time in 2 days

issue commentdenoland/deno

deno exiting silently

Could you give us the import + the contents of that file?

And as a sanity check can you remove your DENO_DIR manually and try again?

martunta

comment created time in 2 days

issue commentdenoland/deno

Error: Another accept task is ongoing :: JS Native classes making HTTP dispatcher fail.

@andreespirela Is this issue fixed?

andreespirela

comment created time in 3 days

PR opened denoland/deno

fix(unstable): add missing globals to diagnostics

Closes #6353

+110 -112

0 comment

1 changed file

pr created time in 3 days

create barnchlucacasonato/deno

branch : add_missing_globals_to_diagnostics

created branch time in 3 days

push eventbartlomieju/deno

Luca Casonato

commit sha f08725a18ddde75e65ff9252eff2e75236db75eb

add or_else

view details

push time in 3 days

Pull request review commentdenoland/deno

[WIP] handle imports in deno doc

 impl DocParser {     Ok(flattened_docs)   } +  fn get_doc_nodes_for_module_imports(+    &self,+    module_body: Vec<swc_ecmascript::ast::ModuleItem>,+    referrer: &str,+  ) -> Result<Vec<DocNode>, ErrBox> {+    let mut imports = vec![];++    for node in module_body.iter() {+      match node {+        swc_ecmascript::ast::ModuleItem::ModuleDecl(module_decl) => {+          match module_decl {+            ModuleDecl::Import(import_decl) => {+              let (js_doc, location) = self.details_for_span(import_decl.span);+              for specifier in &import_decl.specifiers {+                use swc_ecmascript::ast::ImportSpecifier::*;++                let (name, maybe_imported_name, src) = match specifier {+                  Named(named_specifier) => (+                    named_specifier.local.sym.to_string(),+                    named_specifier+                      .imported+                      .as_ref()+                      .map(|ident| ident.sym.to_string()),

Could you add a .or_then(|| Some(named_specifier.local.sym.to_string())) to this? There is no way to tell the difference between this and a namespace import otherwise :-)

bartlomieju

comment created time in 3 days

Pull request review commentdenoland/deno

[WIP] handle imports in deno doc

 pub struct ModuleDoc {   pub reexports: Vec<Reexport>, } +#[derive(Debug, Serialize, Clone)]+#[serde(rename_all = "camelCase")]+pub struct ImportDef {+  pub src: String,

Could you make this the resolved path, not a relative one?

bartlomieju

comment created time in 3 days

Pull request review commentdenoland/deno

[WIP] handle imports in deno doc

 pub struct ModuleDoc {   pub reexports: Vec<Reexport>, } +#[derive(Debug, Serialize, Clone)]+#[serde(rename_all = "camelCase")]+pub struct ImportDef {+  pub src: String,+  pub local: String,

Shouldn't this be in DocNode::name rather than an it being empty string? We could remove InterfaceDef::local then.

bartlomieju

comment created time in 3 days

Pull request review commentdenoland/deno

[WIP] handle imports in deno doc

 impl DocParser {     module_decl: &ModuleDecl,   ) -> Vec<DocNode> {     match module_decl {+      ModuleDecl::Import(import_decl) => {+        let mut imports = vec![];+        let (js_doc, location) = self.details_for_span(import_decl.span);+        for specifier in &import_decl.specifiers {+          use swc_ecmascript::ast::ImportSpecifier::*;++          let import_def = match specifier {+            Named(named_specifier) => ImportDef {+              src: import_decl.src.value.to_string(),+              local: named_specifier.local.sym.to_string(),+              imported: named_specifier+                .imported+                .as_ref()+                .map(|ident| ident.sym.to_string()),+            },+            Default(default_specifier) => ImportDef {+              src: import_decl.src.value.to_string(),+              local: default_specifier.local.sym.to_string(),+              imported: None,

I think this should be imported: Some("default".to_string()). There is no way to tell the difference between this and a namespace import otherwise.

bartlomieju

comment created time in 3 days

issue closeddenoland/deno

Resolution bug WRT to filename extensions

Example:

import { serve } from "http://evbogue.com:8989/blobs/get/&CNnGcLf0eX1KPtq1t4GjU7jR24Q1bwuD5FRXT2x8U7U=.sha256";
const s = serve("0.0.0.0:8000");

async function main() {
  for await (const req of s) {
    req.respond({ body: new TextEncoder().encode("Hello World\n") });
  }
}

main();

fails with the error:

Downloading http://evbogue.com:8989/blobs/get/&CNnGcLf0eX1KPtq1t4GjU7jR24Q1bwuD5FRXT2x8U7U=.sha256...thread 'tokio-runtime-worker-2' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:355:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Canceled', libcore/result.rs:1009:5

which I think is because the filename is .sha256 instead of .ts.

reported here

closed time in 3 days

ry

issue commentdenoland/deno

Potential hash collision by using v8::Module::GetIdentityHash()

@ry Is this still relevant?

ry

comment created time in 3 days

delete branch lucacasonato/deno_website2

delete branch : docs_s3

delete time in 3 days

push eventdenoland/deno_website2

Luca Casonato

commit sha b84ea897b42e0b218069e436d5b6efd1222dd5f4

fix: get docs content from S3 (#1448)

view details

push time in 3 days

PR merged denoland/deno_website2

Get docs content from S3

Fixes #1442

+22 -16

0 comment

2 changed files

lucacasonato

pr closed time in 3 days

issue closeddenoland/deno_website2

Use S3 backing for docs

Using commit hashes to view docs for a specific commit should still be possible. If we don't find the docs on S3, we should try raw.githubusercontent.com.

This should resolve issues with viewing the docs in China.

closed time in 3 days

lucacasonato

delete branch lucacasonato/deno_website2

delete branch : goto_latest_version

delete time in 3 days

push eventdenoland/deno_website2

Luca Casonato

commit sha b1502c77b8214a65b19d8bcef8b20e96ee655212

feat: go to latest version button (#1449)

view details

push time in 3 days

issue closeddenoland/deno_website2

Go to latest button

Next to (or under) the version selector on deno.land/x/foobar there should be a Go to latest version (v0.1.1) button if you are not on the latest version.

closed time in 3 days

lucacasonato

push eventlucacasonato/deno_website2

Luca Casonato

commit sha a23093529968f482b7b8daf2b2908ad9601a51e6

:facepalm:

view details

push time in 3 days

PR opened denoland/deno_website2

Go to latest version button

Closes #1447

+43 -29

0 comment

1 changed file

pr created time in 3 days

create barnchlucacasonato/deno_website2

branch : goto_latest_version

created branch time in 3 days

delete branch lucacasonato/deno_website2

delete branch : alt_readme

delete time in 3 days

push eventdenoland/deno_website2

Luca Casonato

commit sha a0195e5fc5676aae70eebb0cb045e5be4acac695

feat: allow alternative readme locations (#1445)

view details

push time in 3 days

issue closeddenoland/deno_website2

[Request]: Support alternative README locations on GitHub repositories.

GitHub supports the README.md file to be placed in the .github or docs folder and still be displayed on the repository landing page. It would be nice to support this on GitHub repos in deno.land/x/.

GitHub Help Article: About Readmes

closed time in 3 days

zorbyte

push eventdenoland/deno_website2

Luca Casonato

commit sha caea34de811b374afc46aff3de4958aca2500a65

Alternative line number references (#1446)

view details

push time in 3 days

issue closeddenoland/deno_website2

Support line numbers

Links such as this: https://deno.land/x/lib/kite.ts:204:73 should function in the browser. This is handy as that is the format used in error messages that throw in the terminal.

(on a seperate note, it would be nice to see a Deno option to display these errors resolved to their actual on-disk location so clicking on them will open in the editor)

closed time in 3 days

brandonkal

delete branch lucacasonato/deno_website2

delete branch : search_query_string

delete time in 3 days

push eventdenoland/deno_website2

Luca Casonato

commit sha 4aecdf6168a9d491c5f248171471201e0ec6b029

Improve module search (#1444)

view details

push time in 3 days

PR merged denoland/deno_website2

Improve module search

Fixes #1440

This also fixes the issue where sometimes characters of your search term were deleted because of a bad debounce.

+28 -30

0 comment

2 changed files

lucacasonato

pr closed time in 3 days

issue closeddenoland/deno_website2

Keep Prevously Typed Value in Search Bar

Primarily to improve UX, could the search bar value for module search stay consistent even after leaving the page? For example, what could happen:

  1. Enter https://deno.land/x/
  2. Type "framework" in search bar
  3. Scroll through the list, click any module
  4. Go back
  5. "framework" is still present in the search bar

closed time in 3 days

ebebbington

PR opened denoland/deno_website2

Get docs content from S3

Fixes #1442

+22 -16

0 comment

2 changed files

pr created time in 3 days

create barnchlucacasonato/deno_website2

branch : docs_s3

created branch time in 3 days

issue openeddenoland/deno_website2

Go to latest button

Next to (or under) the version selector on deno.land/x/foobar there should be a Go to latest version (v0.1.1) button if you are not on the latest version.

created time in 3 days

create barnchlucacasonato/deno_website2

branch : alt_linenumber

created branch time in 3 days

PR opened denoland/deno_website2

Alternative line number references

Fixes #210

+107 -8

0 comment

2 changed files

pr created time in 3 days

PR opened denoland/deno_website2

Allow alternative readme locations

Closes #696

+34 -2

0 comment

2 changed files

pr created time in 3 days

more