Skip to content

Add petite-vue plugins support - #167

Open
ws-rush wants to merge 106 commits into
vuejs:mainfrom
ws-rush:main
Open

Add petite-vue plugins support#167
ws-rush wants to merge 106 commits into
vuejs:mainfrom
ws-rush:main

Conversation

@ws-rush

@ws-rush ws-rush commented Jul 16, 2022

Copy link
Copy Markdown

I am so excited, this is my first pull request on github, I dont know typescript, and I wish this pull request accepted

I did this commit to distribute custom directives as packages then use them with petite-vue, I also added example use in README file, thats it:

Use Plugins

You can write custome directive then distrbute it as a pacage, then add it to create vue, like:

<div v-scope="{counter: 0}" v-log="inside petite-vue scope">
  <button @click="counter++">increase</button>
</div>

<script type="module">
  import log from './log'
  import { createApp } from 'peteite-vue'
  createApp().use(log).mount()
</script>

A plugin code similar to vue plugins code:

// inside log.js plugin file
export default {
  install: (app, options) => {
    app.directive('log', ({exp}) => {
      console.log(exp)
    })
  }
}

wusaby-rush and others added 10 commits August 29, 2022 03:03
Some times like in dialogs we need access to root component from child nodes, also it is a way to access root element from `v-scope` . the next snippet from another PR to expose `$el` to scope, but this PR can solve the same problem also

```html
<textarea
  v-scope="{width: $root.offsetWidth, height: $root.offsetHeight}"
  @click="width = $el.offsetWidth; height = $el.offsetHeight;"
>
{{ width }} &times; {{ height }}
</textarea>
```
@sqllyw

sqllyw commented Jul 11, 2023

Copy link
Copy Markdown

what is the advantage of use() over directive() ? example:

createApp().directive('log',log).mount() vs 
createApp().use(log).mount()

lucafabbian and others added 15 commits November 8, 2023 15:07
   - Replace deprecated vuejs/vue-next with microsoft/vscode repository
   - Fix branch names from wildcards to specific release branches
fix: update commits example to use working API endpoint
  - Add complete Vitest configuration with Happy DOM environment
  - Create 119 tests covering all core modules and directives
  - Achieve 82.84% test coverage across the entire codebase
  - Add tests for app creation, mounting, and lifecycle
  - Test all built-in directives (v-bind, v-on, v-model, v-show, v-text, v-html, v-effect)
  - Include comprehensive reactivity and async testing patterns
  - Add error handling and edge case coverage
  - Create integration tests for component-like behavior
  - Add tests for utilities, scheduler, and DOM walking functionality
  - Write comprehensive testing guide with best practices
  - Document common testing patterns and examples
  - Add ES module support with type: module
  - Upgrade Vue dependencies from 3.2.45 to 3.5.21
  - Update dev dependencies to latest stable versions
chore: update dependencies and build configuration to modern standards
ws-rush and others added 30 commits February 22, 2026 17:48
…nd refine internal types and directive imports.
…pressions

Code changes:
- src/eval.ts: pass $el to evaluate() generated functions so $el is
  available in all directive expressions (v-on, v-bind, v-model, etc.)
  not just v-effect. Added eval caching for performance.

Docs changes:
- Remove ref() and computed() from reactivity docs (not exported)
- Fix $el and $data docs to reflect availability in all directives
- Fix v-model true-value/false-value to use :binding syntax
- Remove non-existent provide/inject from scope-context docs
- Fix version pin from 1.2.0 to 0.0.4 in installation docs
- Fix broken this.$effect/onMounted in state-management guide
- Clarify mounted() is not an automatic hook in components docs
- Document built-in expression validation in security docs
- Add .exact modifier, system modifiers, v-on="obj" limitation
- Document key-based diffing in v-for docs
- Update api-reference with accurate exports and special properties
- Fix fetch-api, infinite-scroll, laravel examples to use @VUE:mounted

262 tests pass, build clean.
- Rename package from pico-vue to @rush/pico-vue with publishConfig
- Replace .github/workflows/jsr-publish.yml with npm-publish.yml
  (uses NODE_AUTH_TOKEN secret for npm registry auth)
- Remove jsr.json (no longer needed)
- Update scripts/release.cjs: remove jsr.json version bump, fix
  yarn -> pnpm commands
- Update all docs CDN links: unpkg, jsdelivr, esm.sh now reference
  @rush/pico-vue
- Update all npm install and import references in docs

Note: requires NPM_TOKEN secret to be set in GitHub repository
settings before next release tag push.
- add portable playground page with live preview and code editor
- move docs examples into playground presets from examples and tests
- use CDN imports for playground snippets
- refine compact toolbar and pane styling
- remove old examples docs pages
BREAKING: remove $data global variable that was documented but never
actually worked in expressions, causing ReferenceError at runtime.

- Delete docs/globals/data.md
- Remove $data nav link from docs sidebar config
- Remove $data from api-reference and v-effect docs
- Remove legacy examples/ and tests/ HTML files
- Rewrite README with clearer project description, quick start,
  CDN/npm install instructions, and feature table
- Add CONTRIBUTING.md with dev setup, PR process, release workflow,
  and code style guidelines
- Fix npm publish workflow to include --access public flag
- add Vue dependency required for VitePress builds
- align API docs with runtime types and cleanup behavior
- clarify refs, v-bind, and v-effect behavior
- add Vue compatibility guide
- reorganize docs navigation and sidebar
Replace the custom in-page playground editor (iframe + code editor app)
with a directory page linking each of the 25 examples to a ready-to-edit
mylab.wsm.one/play URL.

- Remove docs/public/playground/ (index.html editor app, examples.json)
- Remove buildEnd hook and unused fs/path imports from VitePress config
- Fix TodoMVC: wrap localStorage in try/catch for MyLab sandbox
  (lacks allow-same-origin, so localStorage throws SecurityError)
- Fix Markdown: convert external <script src> tags (marked, lodash) to
  ESM imports so module execution waits for dependencies to load
feat(docs): replace self-hosted playground with MyLab share links
docs(playground): update MyLab playground domain to byrush.me
docs: update domain to pocket-vue.byrush.me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants