0.4.6 • Published 1 year ago

@teambit/harmony v0.4.6

Weekly downloads
2,249
License
Apache-2.0
Repository
github
Last release
1 year ago

Harmony

Harmony is the engine that drives Bit extensibility and composability. It's an abstract extension system indended to make any software extendable and composable.

Harmony takes a "micro-kernel" approach and implements the near-minimum amount of software required to build any JavaScript system from independent components through composition.

Installation

$ bit install @teambit/harmony

Quick start

import { Harmony, Extension } from 'harmony';

@Extensioin
class Person {
  sayHello(name = 'world') {
    return `hello ${name}!`;
  }
}

const person = Harmony.load(Person); 
helloWorld.sayHello(); // returns 'hello world!'

Component composition

DI

class Dude {
  constructor(
    private person: Person
  ) {}

  sayHello() {
    return this.person.sayHello('dude');
  }
};

Harmony.load([Dude]).sayHello(); // echos 'hello dude!'

Hooks

@Extension()
class CLI {
  // @hook('command') commands = Hook.create<Command>();
  static command() {
    return Hook.create<Command>();
  }

  run() {
    const allCommands = this.commands.list(); // outputs all hook subscribers
  }
} 

@Extension()
class Compiler {
  
  @command()
  main() {
    return {
      synopsis: 'compile <path>',
      render: () => <Box></Box>
    };
  }
}

Extension configuration

Extension metadata

API reference

License

Apache License, Version 2.0

Made with ❤ to open software by Team Bit.

bit-bin@teambit/react@rio-test/generator.component-templates@acuity-brands/uiux.utils.uiux-react-js@infinitebrahmanuniverse/nolb-_teamb@wbit/generator.my-react@everything-registry/sub-chunk-900@pv-frontend/envhiui-template@showtime-xyz/universal.extensions.react-native-web@resnovas/generator-mitosis@lamasdev/envs.tailwind-react@waweb/app@waweb/compendium-harmony-ui-app@waweb/comps.aspects.view-gen@waweb/envs.wa-react@teambit/tester@teambit/ui-foundation.ui.main-dropdown@teambit/ui-foundation.ui.menu@teambit/ui-foundation.ui.react-router.slot-router@teambit/ui.react-router.slot-router@teambit/deprecation@teambit/dependency-resolver@teambit/docs@teambit/documenter.envs.documenter-react@teambit/dev-files@teambit/diagnostic@teambit/docker@teambit/formatter@teambit/generator@teambit/git@teambit/global-config@teambit/logger@teambit/mdx@teambit/linter@teambit/merging@teambit/lister@teambit/merge-lanes@teambit/mocha@teambit/multi-compiler@teambit/multi-tester@teambit/mover@teambit/changelog@teambit/checkout@teambit/cli@teambit/cache@teambit/clear-cache@teambit/cloud@teambit/bundler@teambit/builder@teambit/builder-ui@teambit/eject@teambit/dummy@teambit/e2e.workspace@teambit/envs@teambit/env@teambit/environments@teambit/elements@teambit/sign@teambit/status@teambit/stencil@teambit/stash@teambit/yarn@teambit/renaming@teambit/refactoring@teambit/react-elements@teambit/update-dependencies@teambit/variants@teambit/version-history@teambit/watcher@teambit/user-agent@teambit/scope@teambit/schema@teambit/remove@teambit/readme@teambit/ui.main-dropdown@teambit/ui.menu@teambit/webpack@teambit/workspace@teambit/worker@teambit/workspace-config-files@teambit/sidebar@teambit/ui@teambit/snapping@teambit/typescript@teambit/tracker@test-remote/templates.envs.my-react@teambit/aspect-loader@teambit/component-sizer@teambit/component-tree@teambit/component-compare@teambit/component-log@teambit/graphql@teambit/harmony-ui-app@teambit/graph@teambit/html@teambit/harmony.testing.load-aspect@teambit/node@teambit/notifications@teambit/pkg
0.4.5

1 year ago

0.4.4

1 year ago

0.4.6

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.3.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.3

2 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.1

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.1.6-dev

4 years ago

0.2.0

4 years ago

0.1.3-dev

4 years ago

0.1.5-dev

4 years ago

0.1.1-dev

4 years ago

0.1.0-dev

4 years ago

0.0.25

4 years ago

0.0.24

4 years ago

0.0.23

4 years ago

0.0.22

4 years ago

0.0.20

4 years ago

0.0.21

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15-dev

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago