MCPcopy
hub / github.com/riot/riot

github.com/riot/riot @v10.1.4 sqlite

repository ↗ · DeepWiki ↗ · release v10.1.4 ↗
1,302 symbols 3,416 edges 75 files 355 documented · 27%
README

Riot logo

Simple and elegant component-based UI library

Build Status MIT License Join the discord community channel Join the chat (ja) at https://riot-jp-slackin.herokuapp.com/ OpenCollective Backers OpenCollective Sponsors

NPM version NPM downloads jsDelivr Hits Coverage Status Riot Size [Code Quality]qlty-url

Sauce Test Status

Custom components • Concise syntax • Simple API • Tiny Size

Riot brings custom components to all modern browsers. It is designed to offer you everything you wished the native web components API provided.

Tag definition

<timer>


Seconds Elapsed: { state.time }



  <script>
    export default {
      tick() {
        this.update({ time: ++this.state.time })
      },
      onBeforeMount(props) {
        // create the component initial state
        this.state = {
          time: props.start,
        }

        this.timer = setInterval(this.tick, 1000)
      },
      onUnmounted() {
        clearInterval(this.timer)
      },
    }
  </script>
</timer>

Open this example on Plunker

Mounting

// mount the timer with its initial props
riot.mount('timer', { start: 0 })

Nesting

Custom components let you build complex views with HTML.

<timetable>
  <timer start="0"></timer>
  <timer start="10"></timer>
  <timer start="20"></timer>
</timetable>

HTML syntax is the de facto language on the web and it's designed for building user interfaces. The syntax is explicit, nesting is inherent to the language and attributes offer a clean way to provide options for custom tags.

Performant and predictable

  • Absolutely the smallest possible amount of DOM updates and reflows.
  • Fast expressions bindings instead of virtual DOM memory performance issues and drawbacks.
  • One way data flow: updates and unmounts are propagated downwards from parent to children.
  • No "magic" or "smart" reactive properties or hooks
  • Expressions are pre-compiled and cached for high performance.
  • Lifecycle methods for more control.

Close to standards

  • No proprietary event system.
  • Future proof thanks to the javascript module syntax.
  • The rendered DOM can be freely manipulated with other tools.
  • No extra HTML root elements, data- attributes or fancy custom attributes.
  • No new syntax to learn.
  • Plays well with any frontend framework.

Use your dearest language and tools

Powerful and modular ecosystem

The Riot.js ecosystem is completely modular, it's designed to let you pick only the stuff you really need:

CDN hosting

How to contribute

If you are reading this it's already a good sign and I am thankful for it! I try my best working as much as I can on riot but your help is always appreciated.

If you want to contribute to riot helping the project maintenance please check first the list of open issues to understand whether there is a task where you could help.

Riot is mainly developed on UNIX systems so you will be able to run all the commands necessary to build and test the library using our Makefile. If you are on a Microsoft machine it could be harder to set up your development environment properly.

Following the steps below you should be able to properly submit your patch to the project

1) Clone the repo and browse to the riot folder

git clone git@github.com:riot/riot.git && cd riot

2) Set up your git branch

git checkout -b feature/my-awesome-patch

3) Install the npm dependencies

npm i

4) Build and test riot using the Makefile

# To build and test riot
$ make riot

# To build without testing
$ make raw

5) Pull request only against the main branch making sure you have read our pull request template

6) Be patient

Credits

Riot is actively maintained with :heart: by:

Gianluca Guarini

Many thanks to all smart people from all over the world who helped improving it.

Official Website

https://riot.js.org

Backers

Support us with a monthly donation and help us continue our activities. Become a backer

Backers

Sponsors

Become a sponsor to get your logo on our README. Become a sponsor

Sponsors

Thanks

Special thanks to Browserstack for their support

browser stack

Extension points exported contracts — how you extend this code

RiotComponent (Interface)
(no doc)
riot.d.ts
RandomComponentState (Interface)
(no doc)
test/typing/component-object-export.spec.ts
RiotPureComponent (Interface)
(no doc)
riot.d.ts
RandomComponentProps (Interface)
(no doc)
test/typing/component-object-export.spec.ts
PureComponentFactoryFunction (Interface)
(no doc)
riot.d.ts
RandomComponent (Interface)
(no doc)
test/typing/component-object-export.spec.ts
RiotComponentWrapper (Interface)
(no doc)
riot.d.ts
TodoItem (Interface)
(no doc)
test/typing/public-api.spec.ts

Core symbols most depended-on inside this repo

unmount
called by 128
riot.d.ts
update
called by 97
riot.d.ts
$
called by 62
riot.d.ts
mount
called by 49
riot.d.ts
simplePropertyNode
called by 42
riot+compiler.js
get
called by 36
riot+compiler.js
kw
called by 35
riot+compiler.js
requireShared
called by 28
riot+compiler.js

Shape

Function 1,268
Method 19
Interface 13
Class 2

Languages

TypeScript100%

Modules by API surface

riot+compiler.js688 symbols
riot+compiler.min.js323 symbols
riot.js115 symbols
riot.min.js62 symbols
riot.d.ts22 symbols
test/typing/component-object-export.spec.ts7 symbols
test/specs/lifecycle-events.spec.js7 symbols
test/specs/components-registration.spec.js6 symbols
src/core/create-component-from-wrapper.js6 symbols
test/typing/with-types-infer.ts4 symbols
test/typing/public-api.spec.ts4 symbols
src/core/manage-component-lifecycle.js4 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

@riotjs/compiler10.0.2 · 1×
@riotjs/dom-bindings10.0.5 · 1×
@riotjs/prettier-config1.1.0 · 1×
@riotjs/register10.0.0 · 1×
@riotjs/util10.1.2 · 1×
@rollup/plugin-commonjs29.0.2 · 1×
@rollup/plugin-node-resolve16.0.3 · 1×
@testing-library/user-event14.6.1 · 1×
@wdio/cli9.27.1 · 1×
@wdio/local-runner9.27.1 · 1×
@wdio/mocha-framework9.27.1 · 1×
@wdio/sauce-service9.27.1 · 1×

For agents

$ claude mcp add riot \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact