npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@leanjs/vue-router

v0.7.8

Published

Lean micro-apps for Vue Router

Downloads

85

Readme

@leanjs/vue-router

Installation

If your Vue Router app is in a monorepo (recommended) execute the following command at the root of your repository:

yarn add -W @leanjs/vue-router @leanjs/core vue-router@4 vue@3

then in the package.json of your Vue Router app add the following peerDependencies:

"peerDependencies": {
  "@leanjs/core": "*",
  "@leanjs/vue-router": "*",
  "vue-router": "*",
  "vue": "*"
}

If your Vue Router app is not in a monorepo, then run the following command instead of the above:

yarn add @leanjs/vue-router @leanjs/core vue-router@4 vue@3

Composable app

Create small Vue Router apps that can be composed with other apps.

createApp

Arguments:

  • App: Component - required
  • options: { appName: string } - required. You have to specify the name of your composable app.

Create a file called index.ts|js in the src directory where your composable app is.

my-monorepo/
├─ apps/
├─ composable-apps/
│  ├─ vue-router-app-1/
│  │  ├─ package.json
│  │  ├─ src/
│  │  │  ├─ VueRouterApp1.vue
│  │  │  ├─ index.ts 👈
├─ package.json

:::info

Read the recommended setup in our getting started page if you want to create a similar monorepo structure

:::

Call createApp with the root component of your Vue Router app:

import { createApp } from "@leanjs/vue-router";

import VueRouterApp1 from "./VueRouterApp1.vue";

// 👇  you have to `export default createApp(`
export default createApp(VueApp, {
  appName: "VueRouterApp1",
});

Hello world example of the VueRouterApp1 imported above

<!-- my-monorepo/composable-apps/vue-router-app-1/src/VueRouterApp1.tsx -->

<template>
  <h1>Hello composable Vue Router app</h1>
</template>

Create a file called selfHosted.ts|js in the src directory where your composable app is, for example:

my-monorepo/
├─ apps/
├─ composable-apps/
│  ├─ vue-router-app-1/
│  │  ├─ package.json
│  │  ├─ src/
│  │  │  ├─ VueRouterApp1.vue
│  │  │  ├─ index.ts
│  │  │  ├─ selfHosted.ts 👈
├─ package.json

Export a createRuntime function from the selfHosted.ts|js file. This is the runtime that will be used when the app runs in isolation, meaning without a host.

// my-monorepo/composable-apps/vue-router-app-1/src/selfHosted.ts

export { createRuntime } from "@my-org/runtime-react";

:::info

Read @leanjs/core if you have not already created your own createRuntime function

:::