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

sexy

v0.5.2

Published

![npm](https://img.shields.io/npm/v/sexy-framework?color=%23&style=flat-square) ![size](https://img.badgesize.io/https://unpkg.com/sexy-framework/dist/sexy.js?compression=gzip&label=gzip&style=flat-square)

Downloads

8

Readme

Sexy framework

npm size

Sexy - is super fast reactive framework for building fast UI. Perfect Google PageSpeed metrics (better 4-5 times then NuxtJS)

Sexy is fast because it compiles components to Native Javascript and it manages reactivity at compiler time!

  1. No reactivity libs (all deps are made by code analyser)
  2. No runtime (Framework doesnt work in runtime, only on compilation step)
  3. Partial hydration (even for loops and conditional statements)

Thanks SolidJS (dom expressions) and Sinuous (fast looping) for their work that helped to make max performance.

Benefits

  • Small. 3.73kB gzip.
  • Fast. No reactivity libs, No runtime work
  • Partial hydration. Hydrate only dynamic and statefull parts of application
  • Truly reactive. automatically derived from the app state.
  • Tips & Tricks. Slots, Loops, Statements and Props as we get used to

Performance

Performance is a main key of Sexy framework. (syntethic tests)

  1. Faster in x4.5 times to hydrate dynamic components then NuxtJS
  2. Faster in x3.5 times to hydrate static components then NuxtJS
  3. Faster in x3 times to hydrate components with events then NuxtJS
  4. Faster in x10 times to hydrate components then Svelte (in real test FID better in 3 times)

Best choice for mobile web apps development.

Benchmark was made with 10 000 components with loop function. (Without loop its much more faster).

Performance TODO

  • [x] Cache value
  • [ ] Class and style optimiztion
  • [ ] Render to string (remove JSDOM to speed up server render)

Attribute speed test with MarkoJS benchmark showed 19000 ops/sec for sexy framework and x5 hydration speed

Features

  • [x] Single file components
  • [x] Statements
  • [x] Slots
  • [x] Loops
  • [x] Props
  • [x] Hooks (mounted/unmounted)
  • [x] Components auto import/naming
  • [x] Directives (Plugins)
  • [x] Two-way bindings
  • [x] Animation (basic via class)
  • [x] Lazy loading (there is bug with root subscriber)
  • [x] Dependencies (SFC)
  • [ ] Store (Vuex, Mobx...)
  • [x] SSR
  • [x] Simple router
  • [ ] Static site generation
  • [x] Project config for SSR (styles entry, bundle analyzer...)
  • [ ] Client ssr-first mode (if there is huge page then render it on server, cache and transfer to client instead of render on client directly)
  • [ ] Recursive components
  • [ ] Dynamic components !! (tags complete)
  • [ ] Docs !!
  • [ ] Boilerplate generation !!
  • [ ] Benchmarks for hydration most popular frameworks

Expression generation should be fixed and tested more

Single file components

Syntax is similar to VueJs but loop and conditional statements has a bit different syntax

@if(expression)
<div :class="[var2]" :style="var1">
	<slot>Default slot text</slot>
</div>
@elseif(expression)
1
@else
2
@endif

Each with multiple nodes

@each((item, key) in items)
<template :key="key">
// code
</template>
@endeach

Each with signle nodes

@each((item, key) in items)
<div :key="key">
// code
</div>
@endeach

Examples

Example with Loop, external component, (bind) (two-way data binding and directive), references and style blocks

<div>
	@each(item, key in items)
		<nav.container ref="test" :key="item.v" (bind)="vv" transition:classed="fade" lazy>
			test {{ item.v }}
		</nav.container>
	@endeach
	<!-- <input type="text" (bind)="vv" ref="input"> -->
	{{ vv }}
</div>

<script>
import { bind } from 'sexy-framework/directives'

let items = o([{
	v: 'a'
}, {
	v: 'b'
}]);

let vv = o('test');

function mounted()
{
	
}

function unmounted()
{
	
}
</script>


<style>
.red {
	color: rgb(0, 0, 0);
}
</style>

Example events, classes, styles

<div @click="change" :class="[classList, { active: tick === 1 }]" :style="{ fontSize: tick() + 'px' }">
	<slot></slot>
</div>

<script>
let tick = o(24);
let test = p(null);
let value = p(null);

let classList = () => {
	return {
		red: tick() % 2 == 0,
		green: tick() % 3 == 0,
		some: test() === null,
	}
}

function change()
{
	$emit('input', 2);
}

function mounted()
{
	console.log('container mounted');
}

function unmounted()
{
	console.log('container unmounted');	
}
</script>

Contributors

Burkhanov Kirill ([email protected])

License

Copyright (c) 2020 Burkhanov Kirill. This is free software, and may be redistributed under the terms specified in the LICENSE file.