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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ticatec/uniface-micro-frame

v0.0.1

Published

A powerful micro-frontend framework built on Svelte 5 for developing modular web applications with iframe-based architecture

Downloads

7

Readme

Uniface Micro Frame

npm version License: MIT

A powerful micro-frontend framework built on Svelte 5, designed for developing modular web applications with iframe-based micro-frontend architecture.

Overview

Uniface Micro Frame is a comprehensive framework that provides:

  • Micro-frontend support - Applications run within iframe containers
  • Dynamic routing - Hash-based routing system for single-page applications
  • Module management - Stack-based page management with lifecycle controls
  • UI components - Pre-built page layouts and form components
  • Internationalization - Built-in i18n support
  • Type safety - Full TypeScript support

Installation

npm install @ticatec/uniface-micro-frame

Quick Start

1. Basic Setup

import HomePage from '@ticatec/uniface-micro-frame';
import type { ModuleInitialize } from '@ticatec/uniface-micro-frame';

// Define your routes
const routes = {
  '/': () => import('./components/Dashboard.svelte'),
  '/users': () => import('./components/UserList.svelte'),
  '/settings': () => import('./components/Settings.svelte')
};

// Optional module initialization
const initializeModule: ModuleInitialize = async () => {
  // Initialize your module here
  console.log('Module initialized');
};

2. App Component

<script lang="ts">
  import HomePage from '@ticatec/uniface-micro-frame';
  
  export let routes;
  export let initializeModule;
</script>

<HomePage {routes} {initializeModule} />

Core Features

Page Management

The framework provides a stack-based page management system through the AppModule class:

import { AppModule } from '@ticatec/uniface-micro-frame/module';

// Show a new page
AppModule.showPage(MyComponent, { param1: 'value' });

// Close the current page
AppModule.closeActivePage();

Page Components

CommonPage

A basic page layout with header, content area, and optional sidebar:

<script>
  import { CommonPage } from '@ticatec/uniface-micro-frame';
  
  const pageAttrs = {
    title: 'My Page',
    comment: 'Page description'
  };
</script>

<CommonPage {pageAttrs} canBeClosed={true}>
  <div slot="sidebar">
    <!-- Sidebar content -->
  </div>
  
  <div slot="header-ext">
    <!-- Header extensions -->
  </div>
  
  <!-- Main content -->
  <div>Page content goes here</div>
</CommonPage>

CommonFormPage

An enhanced page layout with built-in action bar for forms:

<script>
  import { CommonFormPage } from '@ticatec/uniface-micro-frame/CommonFormPage';
  
  const pageAttrs = {
    title: 'Edit Form',
    comment: 'Edit user information'
  };
  
  const actions = [
    { label: 'Save', type: 'primary', handler: saveForm },
    { label: 'Reset', type: 'secondary', handler: resetForm }
  ];
</script>

<CommonFormPage {pageAttrs} {actions}>
  <!-- Form content -->
  <form>
    <!-- Form fields -->
  </form>
</CommonFormPage>

Routing System

The framework uses hash-based routing with dynamic imports:

// Route definition with parameters
const routes = {
  '/users/:id': () => import('./UserDetail.svelte'),
  '/posts/:category/:slug': () => import('./PostView.svelte')
};

// Access route parameters in components
export let id; // Route parameter
export let category; // Route parameter
export let slug; // Route parameter

Module Initialization

Implement the ModuleInitialize interface for custom module setup:

import type { ModuleInitialize } from '@ticatec/uniface-micro-frame';

const initializeModule: ModuleInitialize = async () => {
  // Setup API clients
  await setupApiClient();
  
  // Initialize stores
  initializeGlobalStores();
  
  // Configure third-party libraries
  configureLibraries();
};

Architecture

Framework Structure

src/lib/
├── HomePage.svelte          # Main entry component
├── common/                  # Common utilities and types
│   ├── ModuleInitialize.ts  # Module initialization interface
│   ├── PageAttrs.ts         # Page attribute types
│   └── PageInitialize.ts    # Page initialization utilities
├── module/                  # Module management
│   ├── AppModule.ts         # Core module manager
│   ├── ModuleHome.svelte    # Module home container
│   └── PageLoader.ts        # Dynamic page loader
├── pages/                   # Pre-built page components
│   ├── CommonPage.svelte    # Basic page layout
│   ├── CommonFormPage.svelte # Form page layout
│   ├── InvalidPage.svelte   # 404 error page
│   └── NotInFramePage.svelte # Frame detection page
└── i18nRes/                 # Internationalization
    └── i18nRes.ts          # Resource definitions

Key Concepts

  1. Iframe-based Architecture: Applications are designed to run within iframe containers for true isolation
  2. Stack-based Pages: Pages are managed in a stack, allowing for modal-like overlays
  3. Dynamic Loading: Components are loaded dynamically based on routes
  4. Type Safety: Full TypeScript support with proper type definitions

Styling

Import the framework's CSS for proper styling:

@import '@ticatec/uniface-micro-frame/uniface-micro-frame.css';

Or customize using the SCSS source:

@import '@ticatec/uniface-micro-frame/src/lib/uniface-micro-frame.scss';

Dependencies

Peer Dependencies

  • Svelte 5.x - The framework is built for Svelte 5

Core Dependencies

The framework integrates with the Uniface ecosystem:

  • @ticatec/uniface-element - UI component library
  • @ticatec/i18n - Internationalization utilities
  • @ticatec/enhanced-utils - Enhanced utility functions

Development

Building the Package

npm run build

Development Server

npm run dev

Type Checking

npm run check

License

MIT

Author

Henry Feng


For more information and advanced usage examples, please refer to the source code and type definitions included in the package.