1.0.0 • Published 7 months ago

@slashid/jump-page v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

/id - SDK Jump page

WIP jump page implementation for the SDK. SSG + client side rendering.

Running the app via CLI

This package comes with CLI support so you can run it locally:

npm install -g @slashid/jump-page

CLI docs

Usage: sid-jump-cli serve [options]

Start the development server

Options:
  -p, --port <number>   Port to use for the development server (default: 4321)
  -a, --api-url <char>  SlashID API URL (default: "https://api.slashid.com")
  -s, --sdk-url <char>  SlashID SDK URL (default: "https://cdn.slashid.com/sdk.html")
  -h, --help            display help for command

Astro gotchas

React hydration

Astro renders a static site by default, meaning the even when using React components they won't hydrate out of the box - it is required to explicitly tell Astro which components should be hydrated by creating an island.

Another gotcha is that when rendering multiple React components from an Astro component, it is not enough to create an island for the parent component, but for each of the children as well. Example:

// Page.astro
---
import { Parent, Child } from './components';
---

<Parent client:load>
    <Child client:load />
</Parent>

Notice how the Child component also needs the client:load attribute. Otherwise it would only be rendered when generating the site.

To prevent issues like these, encapsulate the whole client side app in a single parent component and create an island for it.

// app.tsx
import { Parent, Child } from "./components";

export function App() {
  return (
    <Parent>
      <Child client:load />
    </Parent>
  );
}

// Page.astro
---
import { App } from './app';
---

<App client:load />
1.0.0

7 months ago

0.0.27-package.0

7 months ago

0.0.26

8 months ago

0.0.24

8 months ago

0.0.25

8 months ago

0.0.16-next.0

11 months ago

0.0.14-next.0

12 months ago

0.0.12-next.1

12 months ago

0.0.12-next.2

12 months ago

0.0.12-deps-fix.0

12 months ago

0.0.20

9 months ago

0.0.21

9 months ago

0.0.12-next.0

12 months ago

0.0.22

9 months ago

0.0.23

8 months ago

0.0.12-next.3

12 months ago

0.0.12-next.4

12 months ago

0.0.23-self-host.1

8 months ago

0.0.15

11 months ago

0.0.23-self-host.2

8 months ago

0.0.16

11 months ago

0.0.17

11 months ago

0.0.18

10 months ago

0.0.19

9 months ago

0.0.23-self-host.0

8 months ago

0.0.13

12 months ago

0.0.14

11 months ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8-package.4

1 year ago

0.0.8-package.3

1 year ago

0.0.8-package.2

1 year ago

0.0.8-package.1

1 year ago

0.0.8-package.8

1 year ago

0.0.8-package.6

1 year ago

0.0.8-package.5

1 year ago

0.0.8-package.0

1 year ago

0.0.7-beta.5

1 year ago

0.0.8-package.9

1 year ago

0.0.8

1 year ago

0.0.7-beta.4

1 year ago

0.0.7-beta.3

1 year ago

0.0.7-beta.2

1 year ago

0.0.7-beta.1

1 year ago

0.0.7-beta.0

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago