3.1.1 • Published 10 months ago

edge-supercharged v3.1.1

Weekly downloads
1,058
License
MIT
Repository
github
Last release
10 months ago

Table of contents

Edge Supercharged

Supercharge your components and use them as edge tags

gh-workflow-image typescript-image npm-image license-image synk-image

Edge supercharged enables you to use your components as edge tags. It began by scanning all the templates stored inside the ./components directory of your view root and make them available as tags.

Usage

Install the package from npm registry as follows

npm i edge-supercharged

# yarn
yarn add edge-supercharged

And use it as follows

const edge = require('edge.js').default
const { Supercharged } = require('edge-supercharged')

const supercharged = new Supercharged()
edge.use(supercharged.wire, {
  recurring: process.env.NODE_ENV === 'development'
})

During development, you must set the recurring option to true, so that edge reapplies the plugin on each render call. This will allow edge-supercharged to re-discover the components from the filesystem.

Creating components

The components must live inside the ./components directory relative to the views directory and then you can reference your components as tags.

Instead of using the component as follows

@component('button', { type: 'submit' })
  <span> Submit form </span>
@end

You can use it as follows:

@button({ type: 'submit' })
  <span> Submit form </span>
@end

Learn more ➞