0.1.76 • Published 3 years ago

@fyn-software/rekindled v0.1.76

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Rekindled

Beautiful errors for Remix, both in browser and console.

This project is inspired by php's ignition. I am personally in love with the idea of solutions. In many occasions during development you run in to errors that are not always obvious as to what might be the cause. However, from a library author's perspective it might be. But with today's mechanisms you probably end up googling the error message, maybe prefixed by the libraries name. You then often end up on stack overflow, a github issue, or maybe an FAQ.

Solutions try to resolve this. Where you propose a solution -if applicable- at the same time you throw the error.

Freatures:

  • Works without JS (uses JS solely for progressively enhancing the experience)
  • development environment only, in production the children passed into Rekindled are rendered
  • Solutions (is a to-do)
  • Pretty and interactive console and terminal experiences (as a to-do)

Installation

npm i @fyn-software/rekindled

Usage

Setting up Rekindled is as easy as:

1. Wrap your error boundary's element.

/app/routes/root.tsx

import { Rekindled } from '@fyn-software/rekindled';

export function ErrorBoundary({ error }: { error: Error })
{
    return <Rekindled traceEndpoint="/error" error={error}>
        <h1>Whoops!</h1>
        <h2>We ran into an error: {error.message}</h2>
        <p>{error.stack}</p>
    </Rekindled>
}

2. Set up an endpoint for getting detailed information

/app/routes/error.tsx

import { LoaderFunction } from 'remix';
import { rekindle } from '@fyn-software/rekindled/api.server.js';

export const loader: LoaderFunction = async ({ request }) => {
    const error = JSON.parse(decodeURIComponent(new URL(request.url).searchParams.get('error')!));

    return rekindle(error);
};

3. Use the error page!

preview

Options

optiontypedefault valueDescription
traceEndpointstringnone, field is requiredRoute to the endpoint where you have loader that returns rekindle
errorErrornone, field is requiredThe error to be handled by Rekindled
shownbooleanfalseThis option handles if the Rekindled dialog should be shown by default

TODO

  • Create/Fix intial component for Remix
  • Add feature: Terminal "rendering" for nicer errors
  • Add feature: Dark theme
  • Add feature: Implement container queries so that Rekindled can run wel as a nested element somewhere on a page
  • Add feature: Implement Solution
0.1.76

3 years ago

0.1.75

3 years ago

0.1.58

3 years ago

0.1.59

3 years ago

0.1.74

3 years ago

0.1.70

3 years ago

0.1.71

3 years ago

0.1.72

3 years ago

0.1.73

3 years ago

0.1.63

3 years ago

0.1.64

3 years ago

0.1.65

3 years ago

0.1.66

3 years ago

0.1.67

3 years ago

0.1.68

3 years ago

0.1.69

3 years ago

0.1.60

3 years ago

0.1.61

3 years ago

0.1.62

3 years ago

0.1.52

3 years ago

0.1.53

3 years ago

0.1.54

3 years ago

0.1.55

3 years ago

0.1.56

3 years ago

0.1.57

3 years ago

0.1.51

3 years ago

0.1.50

3 years ago

0.1.49

3 years ago

0.1.46

3 years ago

0.1.47

3 years ago

0.1.48

3 years ago

0.1.41

3 years ago

0.1.42

3 years ago

0.1.43

3 years ago

0.1.44

3 years ago

0.1.45

3 years ago

0.1.40

3 years ago

0.1.38

3 years ago

0.1.39

3 years ago

0.1.30

3 years ago

0.1.31

3 years ago

0.1.32

3 years ago

0.1.33

3 years ago

0.1.34

3 years ago

0.1.35

3 years ago

0.1.36

3 years ago

0.1.37

3 years ago

0.1.27

3 years ago

0.1.28

3 years ago

0.1.29

3 years ago

0.1.25

3 years ago

0.1.26

3 years ago

0.1.12

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.20

3 years ago

0.1.21

3 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.24

3 years ago

0.1.16

3 years ago

0.1.17

3 years ago

0.1.18

3 years ago

0.1.19

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago