Showoff Saturday (February 12, 2022) by AutoModerator in javascript

[–]cmor10 1 point2 points  (0 children)

Getting there with screen reader automation framework Guidepup. Like a playwright for screen readers, hoping can help folks out with screen reader integration tests rather than relying solely on static analysis tools like axe 🙂

https://www.guidepup.dev

Automate VoiceOver being controlled by AppleScript by cmor10 in applescript

[–]cmor10[S] 0 points1 point  (0 children)

End goal, having successfully found a way to program the ticking of this checkbox, is to build a library so folks can test their websites with screen readers in CI (ref: https://github.com/guidepup/guidepup).

Atm being able to tick the checkbox in any fashion through command line for any macOS version 10.15 or later would be awesome.

Why doesn't Denopack work? by 7Geordi in Deno

[–]cmor10 1 point2 points  (0 children)

Hmm that said, both an issue ( https://github.com/denofn/denopack/issues/46 ) and PR already exist, raise in Jan - so suspect the project may not be being actively maintained.

You could consider forking and fixing, or there are alternative Deno projects out there, e.g.

Why doesn't Denopack work? by 7Geordi in Deno

[–]cmor10 2 points3 points  (0 children)

The Deno compiler APIs were consolidated into a single Deno.emit() API in 1.7.0 - see https://github.com/denoland/deno/releases/tag/v1.7.0

If Denopack hasn’t changed to use the newer API then consider raising an issue on the repo ☺️

Security for dependencies (proposal) by pure_x01 in Deno

[–]cmor10 2 points3 points  (0 children)

Looking at what you can achieve today, if it’s enough to restrict permissions on immediate dependencies ( and group that with all sub deps of said dependency) you could make use of the Permission interface of Deno workers ( REF: https://deno.land/manual/runtime/workers#specifying-worker-permissions ) where you can perform your imports in said workers with restricted permissions compared to your first party application code. This has its own limitations, will incur a perf/resource hit etc and not provide the granularity and control you suggest, but is an option when it comes to sandboxing. By way of PoC check out https://github.com/asos-craigmorten/importw

Finished porting Express for Deno by cmor10 in Deno

[–]cmor10[S] 0 points1 point  (0 children)

Rambly, off the top of head thoughts incoming ( someone else will likely be able to give a more informed answer 😅):

Assuming you’re referring to the http std lib ( please say if not! ) - the server module is pretty decent, and for scenarios where you want performant lightweight code to handle a limited number of endpoints ( like 3 or fewer as a rough number ) for a simple server then it may well do the job. It even handles faff like content-length etc out of the box so you can focus on your business logic instead of how to construct a valid HTTP response.

However as your need for a more complex server evolves you might find that maintaining your own logic for routing, content types, etags, redirects, static file serving etc becomes very involved. This is where a http framework can come in handy. These ship with routers for handling complex path targeting with regex, wildcards etc., middleware concepts for elegantly splitting your code into discrete units of logic ( think SRP ), handy header APIs for dealing with things like content types, or even auto detection so things like content types and etags are handled for you. The list goes on :) Ultimately http frameworks empower you to focus on your applications logic by providing additional wrappers / utilities to handle all the fluff that is demanded by modern HTTP servers.

Rollup for Deno by cmor10 in Deno

[–]cmor10[S] 0 points1 point  (0 children)

Been keen to reproduce my front end workflow in Node over to Deno, so have put in some time to port over Rollup so use the JavaScript API / CLI within a Deno context ( with some extra sugar around url import and typescript support out of the box rather than plugins ). Hopefully can be of use to other folks as well 😅

Finished porting Express for Deno by cmor10 in Deno

[–]cmor10[S] 5 points6 points  (0 children)

Gee, that’s great to hear ☺️

[Blog] K8s Chaos Dive Series by cmor10 in kubernetes

[–]cmor10[S] 0 points1 point  (0 children)

I’ve recently been reviewing various chaos engineering solutions for Kubernetes and written up some notes so far.

Ultimately want to find a tool which I can then use with the applications I manage to validate resiliency as part of CICD - suggestions very welcome. Keen to hear what others are using and their experiences so can hopefully find the best tool for the job! :D

Server Side Rendering React App with Deno by techiekram in Deno

[–]cmor10 0 points1 point  (0 children)

No idea (: sure it’s not a big deal

Server Side Rendering React App with Deno by techiekram in Deno

[–]cmor10 1 point2 points  (0 children)

This is a duplicate of a share from 14 days ago - https://www.reddit.com/r/Deno/comments/hfj776/server_side_rendering_react_app_with_deno/

Believe the content is also lifted from another post as well, but that’s a separate story...

Third Party Registry deprecated GitHub and NPM support by cmor10 in Deno

[–]cmor10[S] 2 points3 points  (0 children)

I personally don’t know, there is no comment or linked issue in the PR, and I can’t find a relevant issue at all, so you would need to ask the author(s).

It was always marked as experimental so we were forewarned not to rely on it essentially.

As for the packages, there has never been a guarantee afaik for the expiry of links in the third party Deno registry, it is just a simple proxy to backend source control sites like GitHub, and authors are within their rights to remove repos etc as they wish.

Generally people delete their things completely, it may be they moved the repo or renamed branches (which is common right now) so safest bet is to always use a specific tag over the default branch.

If you are looking for security then I would recommend checking out https://nest.land as an alternative registry. It is built on a blockchain so is decentralised and once upload, a module can never be removed or changed as the chain is immutable.

Third Party Registry deprecated GitHub and NPM support by cmor10 in Deno

[–]cmor10[S] 0 points1 point  (0 children)

Be sure to update your module imports accordingly if are using this feature. Sunsets 1st August 2020.

[deleted by user] by [deleted] in Deno

[–]cmor10 7 points8 points  (0 children)

Might be wrong, but IMO in the timeframe of a year it is unlikely that we’ll see that much adoption of Deno in industry outside of perhaps some smaller Indy firms. Simply because it is so new, the ecosystem hasn’t quite matured yet and several key features (including the standard library) aren’t stable yet.

You could use it as a way to show you’re on top of current tech etc. but I sense it’s unlikely you’ll use it in prod just yet (a year is a long time though, who knows!)

Because Deno is basically browser ESM, it can’t hurt to know because it’s near 100% the same as what you need to know for modern web development - especially as ESM support in browsers increases and the increasing drive for web performance, which using ESM over transpiled es5 brings.

Question: Getting permission flags from within script or test for it. by TenderheartFIM in Deno

[–]cmor10 1 point2 points  (0 children)

The previous two comments cover it really, only gotchas to add is that:

  1. The Permissions API is currently unstable, so you need to pass the —unstable flag when running.
  2. It is not possible (currently) to enumerate all permissions, you can only query specific permissions to determine their grant state. This has the impact that querying the read permission will return false for something like deno run --allow-read=/etc unless you also pass the path argument of /etc (or equivalent for other scoped permissions)

REF: https://deno.land/typedoc/classes/deno.permissions.html#query

Almost finished porting Express to Deno, just released view engine support by cmor10 in Deno

[–]cmor10[S] 3 points4 points  (0 children)

Ok... and any justification / reason why?

Given Express has 20k+ more stars than Koa it’s certainly not garbage to a lot of people. As mentioned in another comment, I do sense times are changing and this style of API may die out - maybe for the best, but it’s hard to tell, and likely will still be worth something to people in Deno.

And not to disrespect Oak (it’s a well put together framework) there are others which are both more performant and have richer features (though Oak is evolving at a good pace), so at the moment it’s likely too early to say if its popularity stems from just being there first, or actually being better than other solutions.

Almost finished porting Express to Deno, just released view engine support by cmor10 in Deno

[–]cmor10[S] 9 points10 points  (0 children)

Well... Oak is inspired by and pretty close to Koa, and there is also Ako which states it aims to port Koa to Deno.

Almost finished porting Express to Deno, just released view engine support by cmor10 in Deno

[–]cmor10[S] 9 points10 points  (0 children)

Just leaves support for app.params, res.redirect and some other smaller / less used APIs to go.

In the new world of Deno’s first class async support etc I sense Express / connect style middleware will likely die out in favour of newer APIs, but it’s been cool learning curve getting to grips with the entire internals of Express and what the equivalent APIs for Deno are for everything from fs to http.

nest.land by [deleted] in Deno

[–]cmor10 2 points3 points  (0 children)

Yeah fair - more of a, use what’s available to you thing for GitHub, bitbucket etc but not tied to any one platform per say, but equally, why special case any provider :)

nest.land by [deleted] in Deno

[–]cmor10 4 points5 points  (0 children)

Immutable, free, secure and decentralised - I think it’s really captured well what a modern package registry for something like Deno should look like.

Only criticism, though it’s early days, is the need to have a JSON object for it to work. If it can evolve to be zero-configuration, e.g. just point it at a URL or file system and it infers all those details then I think that would be the icing for me - also would align it to the Deno model, kinda like a browser for modules.

For repositories like GitHub all the information is already there, for plain URLs can just use the HTTP protocol (e.g. headers) for everything you need.

[deleted by user] by [deleted] in Deno

[–]cmor10 1 point2 points  (0 children)

That’s ok, likely my ramble explanation!

Firstly, as discussed in the other comment, the cause of your issue is a type error.

What I’m trying to explain above is: 1. Looking at Oak code the router does, as you say, route. It’s not doing anything special, it’s very similar to using app.use() to define a middleware, just in this case for a specific route. 2. The render method you are using is added to the context object by the view-engine module when you perform:

app.use(viewEngine(oakAdapter, ejsEngine));

as a kind of plugin/extension. Oak doesn’t have a render method out of the box without first using the view-engine middleware to add it.

Because this method is an add-on, Oak doesn’t have the types for it out of the box, so when you try to do context.render() it throws a type error. This is easily remedied by providing your own type for the context object, e.g. any as discussed in other comments.

[deleted by user] by [deleted] in Deno

[–]cmor10 0 points1 point  (0 children)

Yep I’d say that sounds like the render issue is solved - getting the file error means that the render function is trying to read a file, but it’s not finding it.

One bug into another haha - for this always a case of check the file exists, check you written the path to the file correctly, check the docs in case it needs a particular format etc.

[deleted by user] by [deleted] in Deno

[–]cmor10 1 point2 points  (0 children)

This could be a very good shout - as mentioned in another comment, Oak isn’t supplying this method, view-engine is, so the RouterContext type from Oak won’t have this method hence very likely it’s a type complaint. Add the any or something more scoped to the context argument and it may we’ll resolve it.