GithubHelp home page GithubHelp logo

kardysm / components-autoupdate Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 865 KB

Package for importing proper (version of) components for server-driven-ui systems.

License: MIT License

TypeScript 93.23% JavaScript 6.77%
server-driven-ui autoupdate components-library component-architecture server-driven

components-autoupdate's Introduction

NOTE: package is WIP, not production ready yet

Component autoupdate

Module for importing proper (version of) components for server-driven-ui systems.

Description

This project aims to extend Server-Driven UI (SDUI) with ability to load needed components at specific versions, externally.

Current state of SDUI allows commanding of layouts made of components that already are present within client. It brings restrictions in frequent components update. Given component might be missing or version could be incompatible.

SDUI sends which component app should render. After applying component-autoupdate, contract might be expanded with required semver range (package rely heavily on semver package)

Package aims to waive this restriction by looking for needed version as follows:

  1. within client's space
  2. in remote repository
  3. then, load needed version

Getting Started

Installing

No installable package yet. Clone the repo if you want to build on its basis

Executing program

  • import and init package
    // insert your local path here 
    import {init} from 'components-autoupdate' 
    
    const autoupdater = init(options)
  • init returns following api:
{
importComponent,
registerVersion,
isSemVer,
isSemVerRange,
constants
}
  • use importComponent in most cases; return type is result of import(url)
importComponent({
  name: ComponentName // <- string
  range: SemVerRange // valid semver range, passing isSemVerRange
  })
  • use registerVersion if component of given version has been loaded outside importComponent

Limitations

  • Only valid semver versions are supported atm
  • It is ES6 module, not adapted evironments to other than JS
  • default fetcher loads data from npm and components from unpkg. You can, however, pass custom fetcher with init options

Authors

Contributors names and contact info:

Version History

  • 0.3.0 - pre-alpha version

License

This project is licensed under the MIT License - see the LICENSE.md file for details

components-autoupdate's People

Contributors

kardysm avatar

Stargazers

 avatar

Watchers

 avatar

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.