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

@beyond-js/widgets-bundle

v1.0.0

Published

Texts bundle and processor for BeyondJS

Downloads

63

Readme

BeyondJS Widgets Bundle

Overview

The BeyondJS Widgets Bundle allows developers to create and manage UI components like pages and layouts using a widget system. Widgets are self-contained, reusable components that can be rendered in various parts of the application, providing a flexible and modular approach to building user interfaces.

Features

  • Reusable Components: Create self-contained widgets that can be reused across different parts of the application.
  • Layout and Page Widgets: Support for creating layout widgets that define the structure of the application and page widgets for specific views.
  • Configurable Properties: Widgets can be customized through properties defined in the module.json file.
  • Support for Multiple Processors: Widgets can use different processors like TypeScript, Sass, HTML, Vue, Svelte, and more.

How It Works

Widgets in BeyondJS are configured in the module.json file and processed to create reusable UI components. The widgets can be registered, customized, and used throughout the application. The bundle handles the processing and registration of these widgets, ensuring they are ready for use in the application.

Configuration

To configure a widget bundle, you need to define it in your module's module.json file. Below is an example configuration:

{
	"name": "my-widget-bundle",
	"platforms": ["web"],
	"widget": {
		"element": {
			"name": "my-widget",
			"attrs": ["attr1", "attr2"]
		},
		"is": "page",
		"route": "/my-route",
		"render": {
			"csr": true,
			"ssr": false
		}
	}
}

Key Properties

  • name: The name of the bundle.
  • platforms: Specifies the platforms the bundle supports.
  • widget: Contains configuration details specific to the widget.
    • element: Defines the element name and attributes for the widget.
      • name: The name of the custom element.
      • attrs: An array of attributes that the element can accept.
    • is: Specifies the type of widget, such as layout or page.
    • route: Defines the route for page widgets.
    • render: Specifies rendering options.
      • csr: Client-side rendering (default is true).
      • ssr: Server-side rendering (default is false).

Types of Widgets

Layout Widgets

Layout widgets define the overall structure of the application. They are used to create reusable layouts that can be applied to different parts of the application.

Example configuration for a layout widget:

{
	"name": "my-layout-bundle",
	"type": "widget",
	"platforms": ["web"],
	"widget": {
		"element": {
			"name": "my-layout",
			"attrs": ["attr1", "attr2"]
		},
		"is": "layout"
	}
}

Page Widgets

Page widgets represent specific views or pages within the application. They can define their own routes and be rendered independently.

Example configuration for a page widget:

{
	"name": "my-page-bundle",
	"type": "widget",
	"platforms": ["web"],
	"widget": {
		"is": "page",
		"route": "/my-page"
        "element": {
			"name": "my-page",
			"attrs": ["attr1", "attr2"]
		}

	}
}

Best Practices

  • Naming Conventions: Use meaningful names for widgets and attributes to make the code more readable and maintainable.
  • Reusable Attributes: Define reusable attributes for widgets to enhance modularity and flexibility.
  • Consistent Configuration: Maintain a consistent configuration structure in the module.json file for better readability and ease of maintenance.