Skip to content

Instantly share code, notes, and snippets.

@ifiokjr
ifiokjr / shared-artifacts-github-actions.md
Last active November 12, 2021 14:59
sharing artifacts across workflows

sharing artifacts across workflows

The official actions/download-artifact doesn't support sharing artifacts across workflows. For the changesets workflow there is a publish action which runs separately from the default ci action.

The ci action should handle tests and the creation of artifacts.

The publish action should be able to consume these artifacts and publish the repository when everything passes via workflow_run.

Thankfully someone has already built an action which does exactly what I need. Thank you open source and thank you Dawid! 🙏

The decline in solana nft prices

The solana ecosystem moves quickly. Very quickly.

Transactions are near instant.

Fees are super low.

Barriers to entry are lower than with any other chain.

@ifiokjr
ifiokjr / e2e-publish-tests-with-verdaccio.md
Last active November 12, 2021 07:35
e2e publish tests with verdaccio

e2e npm publish tests with verdaccio

While working on remirror I always intended to setup a local npm registry for testing the packages before being published.

In the end I didn't get to do this but I would like to implement something like this functionality as a builtin feature for monots.

So many things can go wrong while publishing a new package, and it's a great idea to make sure the CI system catches the errors before the end users do.

Here's a sample repo on how these e2e tests can be setup and run. And here's a video describing what is being done.

Initial thoughts on napi-rs

It's quite magical and enforces a structure that makes it quite hard to use in monorepos.

I've been building monots recently to make managing library code a lot easier.

Some things I've noticed that I'm not a fan of at the moment.

  • napi places the platform specific code in a sub directory. npm/darwin-x64 for example. I like all packages to be directly under the packages/ folder. I've looked at the napi code and there's currently no way to change the destination directory.
  • I would like the files to be placed in the packages/skribble.dev__css-darwin-x64 folder. So I'll need to create my own custom scripts for it.
@ifiokjr
ifiokjr / meta-programming-with-javascript-functions.md
Last active November 12, 2021 06:31
meta-programming-with-javascript-functions.md

Proxies for JavaScript functions

Today I learned you can proxy javascript functions using the apply handler of a proxy.

function sum(a, b) {
  return a + b;
}

const handler = {
@ifiokjr
ifiokjr / get-copilot-to-work-with-markdown-all-in-one-extension.md
Last active November 12, 2021 06:12
get copilot to work with markdown-all-in-one extension

How I got GitHub copilot to coexist with markdown all in one extension

Copilot has been great.

One problem.

Markdown.

When I hit tab nothing was happening.

@ifiokjr
ifiokjr / how-to-automate-yout-watch-tests-in-rust.md
Last active November 12, 2021 05:52
how to automate your watch tests

Watch your tests in rust

I'm on a journey to learn rust and want to have tests running automatically as I write and save code.

The test-runner plugin which I installed for rust is still in early stages and doesn't yet support watching.

However, there's a pretty good plugin for doing this

cargo install cargo-watch
@ifiokjr
ifiokjr / changes-in-padding-not-rerendering.md
Last active November 12, 2021 05:55
changes-in-padding-not-rerendering

Padding change not causing a rerender

I'm working on the @skribble.dev project and I want to make note of an issue I've bumped into. I'll refer back to it in the future.

When I update the padding during of the button component, there is a hot reload, but the annotation isn't updated to the new size of the component. Up until now, I've been refreshing when this happens.

It's likely that the resize observer only captures events that trigger an update externally, and internal events like padding changes are not captured.

@ifiokjr
ifiokjr / rounded-box-annotation-bug.md
Last active November 12, 2021 05:52
rounded-annotation-bug

RoundedBoxAnnotation

I've been working on yet to be released library which will be published under the npm scope @skribble.dev.

I encountered this bug while building out the functionality.

The box was rendering in the wrong position when the position of the target was not set to relative. This should not be the case since the position of the paths is generated from a rect which is relative the bounding box of the target.

  • First checked that the rect being calculated was correct. I had to turn on rulers to ensure that the x and y offset values were correct.
  • Then I tried using the BoxAnnotation. This positioned the svg paths correctly relative to the target element.
@ifiokjr
ifiokjr / bugs.md
Last active November 12, 2021 05:17
thoughts-as-i-code

Bugs

I tend to forget the bugs that I stumble across while writing code. Sometimes I'll fix a bug and a few minutes later come across a similar issue and not remember how I fixed the previous one.

I'll try documenting the bugs as I find them and hopefully fix them also.