Hi HN,

My closest friend only uses email and over the years I have grown tired of writing a heading and a body every time to share something with him.

So I built this very simple link sharing board which generates boards with uuids and as long as you know the uuid, you can see the links on the page and add new links.

It is built with Imba (which was fantastic) and Supabase as the DB. Deployed on Netlify.

Sharing in case there is someone else who might find this useful.

nice!

are you willing to share the Imba code for us to learn from? and how was the debugging experience on Chrome? Was there a large barrier to go from compiled down JS code to Imba source?

There were a few places where the compiled down JS to Imba was a bit hard. But when it got tricky I could just compile that single file and see the results. Overall it was pretty straight forward but also my app is pretty simple.

And here is one of the components:

import supabase, { UNIQUE_VIOLATION_CODE } from '../constants' import normalizeUrl from 'normalize-url' import './links-list'

tag pad-page

  loading = false
  links
  err\string
  newUrl\string

  def routed
    fetchLinks!


  def fetchLinks
    loading = true

    let {data, error} = await supabase.rpc('select_links_from_pad', { pad_id_input: route.params.id })
      .order('created_at', {ascending: false})

    loading = false

    if error
      log error.message
      return

    links = data
    imba.commit!

  def addLink
    if newUrl
      const {data, error} = await supabase.rpc('insert_link_into_pad', {
        pad_id_input: route.params.id,
        url_input: normalizeUrl(newUrl, {defaultProtocol: 'https:'})
      })

      if error..code == UNIQUE_VIOLATION_CODE
        err = 'link already added'
        setTimeout(&, 3000) do
          err = ''
          imba.commit!
      elif error
        return

      newUrl = ''
      links.unshift(data)

  
    
'add a link' 'Add' if err

err

I hope this console error message will be helpful to you, as it wasn't really for me:

The resource from “https://shynet-lhkb.onrender.com/ingress/f29fe2d5-5f78-456e-... was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).

Also, console reports another issue:

SyntaxError: invalid regexp group client-SMJMSZTC.js:2:145487

FYI, the sudopad.com domain unfortunately displays nothing at all in my browser.

Oh that is actually shynet self hosted analytics which is privacy friendly. https://github.com/milesmcc/shynet

But I think I'll just remove it for now.

Update: removed