Git Product home page Git Product logo

colada's Introduction

Colada logo


license MIT npm package chrome web store typescript


What is Colada?

Time-travel debugging for Pinia🍍, Vue's official state management library


Colada offers a suite of tools for Vue developers working with the Pinia state management library:

  1. Chrome DevTool Extension
  2. NPM package that serves as a plugin for the Vue.js DevTools Chrome Extension
  3. Pinia🍍 plugin to directly access and mutate your app's store

Core Features

  • βœ… Minimal installation and automatic detection of Vue app in Vue.js DevTools
  • πŸ”„ Direct integration into Vue.js DevTools, so developers can use Colada without leaving their existing devtool configuration
    • πŸ•°οΈ Time travel debugging
    • πŸ”Ž Inspector panel for viewing Pinia state within your Vue app
  • πŸ’» A Chrome DevTool Extension providing enhanced features, including:
    • πŸ•°οΈ Time travel debugging
    • πŸ”Ž Inspector panel for viewing Pinia state within your Vue app

demo screenshot



Getting Started

Installation: Vue DevTools Plugin

  1. Ensure the Vue.js DevTools Chrome Extension is installed
  2. Install the Colada npm package in your app's root directory
npm install colada-plugin --save-dev
  1. Add Colada to your Vue app
// main.js

import { createApp } from 'vue';
import { createPinia } from 'pinia';
// import Colada Plugin
import Colada, { PiniaColadaPlugin } from 'colada-plugin';
import App from './App.vue';

const app = createApp(App);
const pinia = createPinia();

app.use(pinia);
pinia.use(PiniaColadaPlugin);
app.use(Colada);

app.mount('#app');

Installation: Chrome DevTools Extension

NOTE: Ensure the Vue.js DevTools Chrome Extension is installed before installing the Colada DevTool Chrome Extension


There are two ways to install the Colada Chrome Extension:

1. Install from the Chrome Web Store

  1. Navigate to Colada on the Chrome Web Store, and click "Add to Chrome"

demo screenshot

2. Install from source

  1. Clone this repository
  2. Run the following commands
cd colada-extension
npm install
npm run build
  1. This will create a new /dist directory in /colada-extension
  2. In Chrome, navigate to chrome://extensions.
  3. In the top right of the Extensions page, there is a toggle for "Developer Mode." Make sure this is toggled ON.
  4. On the top left of the page, select "Load Unpacked", and select the colada/colada-extension/dist directory.


How to Use Colada

Using the Colada Vue DevTools Plugin

  • Navigate to the Vue.js DevTools

Time Travel Debugging

  • Select the "Colada" timeline in the timeline view
  • Turn off screenshots

- Changes in your app's store and state will automatically be tracked on the timeline - Click on timeline events to travel through time and update your app's state

Inspector Panel - View Your App's Stores and State in Real Time

  • Select "Colada" in the component menu drop down
  • Click on your Pinia store to view state, actions, and getters updated in real time




Using the Colada Chrome DevTool Extension

  • Navigate to Colada DevTools in Chrome

  • Changes in your app's store and state will automatically be tracked on the timeline
  • Click on a timestamp or use the arrows to travel through time and update your app's state
  • View your app's state as you time travel in the inspector panel on the right



How to Give Colada a Test Run With Our Demo App

  1. Clone this repository
  2. Navigate to the demo-project directory
cd demo-project
  1. Install packages and run application
npm install
npm run dev
  1. Interact with the app to watch the app's state update in real-time!


Contributing and Issues

Interested in conributing to Colada? Reach out to our core team
Feature requests or issues/bugs to report? Let us know!


Release Notes

Contributors


0.1.1 | Initial release of Colada, more to come!

License

MIT

colada's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

colada's Issues

Can't run the plugin due to TypeError: Cannot convert undefined or null to object

Thank you for this tool, it's been sorely needed. πŸ™ I'm having trouble getting it to run though, maybe you could help?

I've implemented Colada in my Nuxt 3 app like this:

import Colada, { PiniaColadaPlugin } from 'colada-plugin'

export default defineNuxtPlugin((nuxtApp) => {
  useNuxtApp().$pinia.use(PiniaColadaPlugin)
  nuxtApp.vueApp.use(Colada)
})

Then with the browser extension installed I go into my app and switch to the Colada tab in Vue Dev Tools. It doesn't load at all and I get this set of errors at least twice:

An error occurred in hook 'getInspectorTree' registered by plugin 'colada-plugin' with payload:
TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at getCurrentStores (colada-plugin.esm-browser.js:2870:23)
    at addPiniaStoreLabels (colada-plugin.esm-browser.js:2877:27)
    at colada-plugin.esm-browser.js:3049:17
    at handler (backend.js:725:16)
    at DevtoolsHookable.callHandlers (backend.js:746:17)
    at DevtoolsApi.callHook (backend.js:230:26)
    at async DevtoolsApi.getInspectorTree (backend.js:433:21)
    at async sendInspectorTree (backend.js:2633:21)

Issue with composition api pinia pattern

Hello, first of all congrats, Colada is a fantastic tool.

I've found one issue regarding colada plugin, it throws an error RangeError: Maximum call stack size exceeded when I use composition api pattern.

1

You can check this issue here: https://gitlab.com/lukasz95/vite-pinia-counter

Navigate to the src/stores/counter.js file, here you can see I'm using composition api pattern and it seems it's not compatible with Colada.

2

Other than that tool works very well :)

Cheers

'Uncaught SyntaxError: Unexpected end of JSON input' upon installing Colada

Issue

After following the install instructions to add Colada to our project, running the web application results in two JSON parse errors, as shown below:

VM290:1 Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at colada-plugin.esm-browser.js:2985:1

VM292:1 Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at saveMessage (content-script.js:3:58)

Steps to reproduce

  1. Add Pinia to the project, and start setting up reactive stores.
  2. No issues so far.
  3. Follow instructions at https://colada.dev/#install to add Colada.
  4. Load the app in browser (Chrome 117.0.5938.62).
  5. Check Dev Console. Issues displayed as detailed above.

Steps tried so far:

At first, I thought it was linked to the Pinia store code, and maybe there was an issue there, but I went through the code and commented out all references and imports for the reactive stores. So now all that remains is the init code for Pinia and Colada (the app.use etc).

Versions:

vue: 3.3.4
pinia: 2.1.6
colada-plugin: 0.1.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.