0.4.7 • Published 4 months ago

@teambit/harmony v0.4.7

Weekly downloads
2,249
License
Apache-2.0
Repository
github
Last release
4 months 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@rio-test/generator.component-templates@acuity-brands/uiux.utils.uiux-react-js@infinitebrahmanuniverse/nolb-_teamb@wbit/generator.my-react@everything-registry/sub-chunk-900@corpdk/envs.my-react-env@corpdk/react.envs.my-react-env@banxware-bit/envs.banxware-base@lamasdev/envs.tailwind-react@pv-frontend/env@resnovas/generator-mitosishiui-template@watheia/design.aspects.news@watheia/design.aspects.contact@watheia/design.aspects.home@watheia/dox.apps.dox-app@watheia/dox.micro-dox@watheia/envs.material.react-mui-env@watheia/app.envs.tailwind-react@watheia/labs.hello-world@watheia/layout.aspects.rxmodel@watheia/labs.harmony-ui-app@watheia/compendium.envs.blog-env@watheia/blog.envs.mdx-env@watheia/hello.hello.extensions.preact@watheia/hello.hello.extensions.snowpack@waweb/compendium-harmony-ui-app@waweb/app@watheia/base-ui.extensions.sapper-mfe@watheia/nx-lab.aspects.document-generator@watheia/mfe.envs.wa-react@watheia/micro.aspects.wapp@waweb/envs.wa-react@waweb/comps.aspects.view-gen@yiminghe/test.bit.envs.component-env@yiminghe/test.bit.envs.tsx-env@yiminghe/bit.envs.tsx-env@zalastax/nolb-_teamb@test-remote/templates.envs.my-reactebit-bin@teambit/tracker@teambit/ui.menu@teambit/ui.main-dropdown@teambit/user-agent@teambit/ui.react-router.slot-router@teambit/yarn@teambit/ui-foundation.ui.react-router.slot-router@teambit/ui-foundation.ui.main-dropdown@teambit/ui-foundation.ui.menu@teambit/worker@teambit/update-dependencies@teambit/webpack@teambit/variants@teambit/watcher@teambit/version-history@teambit/bit@teambit/bit-custom-aspect@teambit/bit-dev@teambit/command-bar@teambit/community@teambit/compiler@teambit/component@teambit/component-log@teambit/component-compare@teambit/component-sizer@teambit/generator@teambit/forking@teambit/formatter@teambit/global-config@teambit/git@teambit/flows@teambit/notifications@teambit/objects@teambit/pnpm@teambit/preview@teambit/pkg@teambit/panels@teambit/prettier@teambit/angular-v10@teambit/angular-v11@teambit/angular-v8@teambit/angular-v9@teambit/api-reference@teambit/compositions@teambit/dev-files@teambit/diagnostic@teambit/docker@teambit/scope@teambit/schema@teambit/renaming@teambit/readme@teambit/refactoring@teambit/remove@teambit/bundler@teambit/builder@teambit/cache@teambit/builder-ui@teambit/config@teambit/config-merger
0.4.7

4 months ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.6

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.3.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.3

3 years ago

0.2.11

4 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.1

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.1.6-dev

5 years ago

0.2.0

5 years ago

0.1.3-dev

5 years ago

0.1.5-dev

5 years ago

0.1.1-dev

5 years ago

0.1.0-dev

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.20

5 years ago

0.0.21

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15-dev

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.11

5 years ago

0.0.12

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago