0.4.7 • Published 9 months ago

@teambit/harmony v0.4.7

Weekly downloads
2,249
License
Apache-2.0
Repository
github
Last release
9 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-900hiui-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@banxware-bit/envs.banxware-base@corpdk/envs.my-react-env@corpdk/react.envs.my-react-env@resnovas/generator-mitosis@teambit/envs@teambit/docs@teambit/dev-files@teambit/env@teambit/environments@teambit/eject@teambit/elements@teambit/jest@teambit/insights@teambit/isolator@teambit/importer@teambit/issues@teambit/install@teambit/ipc-events@teambit/new-component-helper@teambit/ng-packagr@teambit/node@teambit/notifications@teambit/objects@teambit/pkg@teambit/multi-compiler@teambit/panels@teambit/mover@teambit/multi-tester@teambit/sidebar@teambit/sign@teambit/snapping@teambit/typescript@teambit/ui@teambit/ui.menu@teambit/variants@teambit/version-history@teambit/webpack@teambit/user-agent@teambit/update-dependencies@teambit/watcher@teambit/api-reference@teambit/angular-v10@teambit/angular-v11@teambit/angular-v8@teambit/angular-v9@teambit/api-server@teambit/component-tree@teambit/component-log@teambit/component-sizer@teambit/component-writer@teambit/babel@teambit/aspect@teambit/aspect-loader@teambit/application@teambit/apply@teambit/component.ui.component-drawer@teambit/component@teambit/compiler@teambit/component-compare@teambit/community@teambit/bundler@teambit/builder@teambit/builder-ui@teambit/bit@teambit/changelog
0.4.7

9 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

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.3

4 years ago

0.2.11

5 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

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15-dev

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.11

6 years ago

0.0.12

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago