Git Product home page Git Product logo

vivi's Introduction

Build Status codecov npm license Greenkeeper badge

Vivi

A lightweight component-focused Javascript framework. Vivi is currently still in it's early stages, so breaking changes are more common. This package uses semantic versioning, so breaking changes will result major version updates.


Announcements

Typescript

Vivi has converted from Typescript to Javascript for better compatitbility. It's still possible to run Vivi.js with TS, but if you want to use the old version of Vivi that took advantage of a lot of TS-only features like decorators, you can find it in the Vivi-Typescript repo and under @cspruit/vivi-ts npm package.

Versioning

Vivi is moving over to true automated semantic releases, so future update announcements and milestones will be groups of major feature updates and fixes.

Node Tree Milestone Update (Previously v3):

Node tree milestone is complete and has been released! Some of the new changes:

  • Dynamic loading for child components from the template, like adding a list of components based off an array
  • Easier loading for child components from the component class
  • Lots of component and template-related bugfixes! Yay!
  • Smaller package size!

Installation and Gettings Started

  • Install by running npm install --save-dev @cspruit/vivi in the same directory as the package.json file lives.
  • Webpack is required to use Vivi's automatic template and style loading. For more detail, checkout the Getting Started page.

Contributing

All contributions, suggestions, and issues are welcome!

Check out the Issues page. In general anything listed is up for grabs, though bugs tend to be more detailed than enhancements and might be better to pick up if starting out.

How to Contribute

  1. Fork this repository
  2. Create a branch: git checkout -b <branch_name>
  3. Make your changes and commit using : npm run commit
    • Please remeber to write tests, if applicable.
    • You can run tests by running npm run test.
  4. Push to the original branch: git push origin https://github.com/CassandraSpruit/Vivi.git
  5. Create a Pull Request

License

This project uses GPL 3.0.

vivi's People

Contributors

cleespruit avatar greenkeeper[bot] avatar semantic-release-bot avatar

Stargazers

 avatar Josh Griffith avatar

Watchers

James Cloos avatar  avatar Josh Griffith avatar

vivi's Issues

Add "Bind" functionality to Component

Is your feature request related to a problem? Please describe.
Related to #4. Since that's probably not coming back anytime soon, a quick bind function is adequate enough to replace it for the time being.

Describe the solution you'd like
Something like this:

const el = this.bind('div.my-class', EventType.click, this.handleClick);

An in-range update of xo is breaking the build 🚨

The devDependency xo was updated from 0.25.3 to 0.25.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

xo is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v0.25.4
  • Temporarily disable the import/order rule 776927f

v0.25.3...v0.25.4

Commits

The new version differs by 2 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Get Codecov back working again

Another victim of the great moving. Probably just needs to be setup again or is a build issue as nyc and generating cover works fine.

Drop the "Service" section of baked-in services

Describe current status
Since the move to remove service dependencies, the current way to get services is a little wordy, especially for ApplicationEventService, which is pretty commonly used.

const appEvents = this.vivi.get('ApplicationEventService');

Describe the outcome you'd like
Shorten names of services and allow for services not to have "Service" after the name. This may require some refactoring in the module factory as get and getFactory is dependent on that.

Additional context
...

[BUG][Module] Overriding component and calling it by the old name does not return anything

Describe the bug
Found while trying to test the following code:

	vivi = new ModuleFactory(
		{
			componentConstructors: [MockComponent],
			rootComponent: MockComponent
		},
		{},
		[{key: 'Logger', override: MockLogger}]
	);
	vivi.get('Logger').setTest(t);

It returns an error on get('Logger') because it's probably registered under 'MockLogger'.

Expected behavior
Overridden services need to registered under the name of the service that they're over ridding.

Additional context
Introduced with #10 feature add

Get test coverage back to 100%

Describe current status
With the recent switch from jest -> ava and slew of refactors, a lot of tests had to be scrapped or rewritten. No more 100% coverage. 😒

Describe the outcome you'd like
With a smallish library like this, 100% isn't impossible. This time around I think some integration tests are in order. Unfortunately with the unit tests we had, they were somewhat fragile because there is so much dependency between classes that any sort of refactoring or clean up caused most of them to break.

Additional context
...

[BUG] v-each blows up if the array does not exist

Description
<div class="git" v-if="this.git.errors" v-each="this.git.errors as ErrorsComponent"></div>
This code will throw an error if this.git.errors is undefined.
(Does not throw error if this.git.errors.length is just 0 though)

To Reproduce
Steps to reproduce the behavior:

  1. Create a component that has a component that uses v-each on an undefined array
  • Running v-if check doesn't work because the v-each runs before v-if.

Expected behavior
Application should crash if v-each is run on an undefined array, either by throwing a warning or ignoring that code if v-if is used.

An in-range update of @cspruit/array-like-map is breaking the build 🚨

The dependency @cspruit/array-like-map was updated from 1.0.1 to 1.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@cspruit/array-like-map is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details

Release Notes for v1.1.0

1.1.0 (2020-01-14)

Features

Commits

The new version differs by 2 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Create a mock version of the Logger service

Describe current status
The new logger is great, but testing with it is somewhat of a nightmare. It doesn't play well with most test runners because it outputs to the console which is...mixed at best. It's fine with AVA as long as the --verbose tag is on, but it does interrupt the output. Honestly Jest was just as bad because it'd show that before the test results. And if you had 1000+ tests like Vivi does...

Additionally - and probably more importantly, if an error is reported, it doesn't fail the test. It'd be nice to configure what fails a test and what is fine. (Like an expected error, for example)

Describe the outcome you'd like
Expand the Logger service for tests that can eat logs if needed and fail/pass tests if certain things happen.

Additional context
Should probably be done before or during #7.

Allow for "Baked-In" services to be overwritten

Describe current status
As of writing, Vivi has 4 baked in services, ApplicationEvent, Logger, NodeTree, and ParseEngine.
While NodeTree and ParseEngine are pretty integral to Vivi and would likely not be touched, I can see ApplicationEvent and Logger being annoying for a user that would want a custom solution as ApplicationEvent uses Zephyr for event handling over something like say RxJS and a lot of people like rolling their own logging services.

Describe the outcome you'd like
Allow for custom baked-in services to be injected into the module.

Additional context
This would assist in implementing #8 as it requires Logger to be expanded.

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/core was updated from 7.7.7 to 7.8.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[BUG][Components] Child elements throw error

Describe the bug
Uncaught TypeError: child.startLoad is not a function

To Reproduce
Steps to reproduce the behavior:

  1. Create component
  2. In component, create children
  3. See error
    Idk if it matters but I also created the factory in the component too

Expected behavior
Should load

Screenshots
image

Desktop (please complete the following information, if applicable):

  • Browser: Chrome

Todo-bot not fetching new @todos

There should be a lot more issues listed in here with the @todo keyword.

It probably got jumbled up during the repo move. Alternatively, jsdocs is somehow messing with it since @todo is also a valid jsdoc tag.

Component - v-each: add a "sort by" feature

Is your feature request related to a problem? Please describe.
Arrays sorts are pretty common. It would lighten user processing if v-each could handle sorting.

Describe the solution you'd like
Something like this would be nice:
v-each="this.color as ColorComponent; sortBy name ASC"
Or alternatively this might be cleaner:
v-each="this.color as ColorComponent" v-each-sort="name" v-each-sort-dir="asc"

Components - Bring back Element Binding

Background
When converting over to TS -> JS, one major feature that was lost was element binding via the ElementDecorator.

This was intentionally dropped because JS does not have a great alternative to TS-esque decorators. They exist if you do tinkering with babel and polyfills, but it would also require the end user to install these.

Additionally, having to create a class variable with a decorator just to bind an element was not a perfect solution to begin with. Often these were manipulated in the class later on in the code, but not always and it'd be flagged by linters.

Workaround
Currently you can just use the old style of grabbing elements and binding events to them. It's a bit wordy though.

Move Vivi to using Microbundle

Currently Vivi uses Webpack to generate library files for other things to consume it. It's mostly fine except it currently generates only UMD files and there's the webpack.config.js file to maintain.

Look at Zephyr for a good example of implementation.

v-data does not process objects

Describe the bug
When passing data into a child component via v-data-XYZ property, if the value of the attribute is an object, it won't be passed into the child as an object.

To Reproduce
In component
this.info = { puppy: 'bow wow' }

In template
<child-element v-data-info="this.info"></child-element>

Child element will not have an object of { puppy: 'bow wow' }, it'll have a string literal of 'this.info', which is the bug.

Expected behavior
Objects passed into child can be passed via template.

Additional Info
Currently, v-data-* just does a simple replacement like any other attribute. v-data-* will have to be added to the blacklist and custom added to the engine.

[BUG] Load cycle runs twice on creation

To Reproduce
Steps to reproduce the behavior:

  1. Create a component through createChild() in the parent component
  2. Child component's load() fn will run twice.

This is likely the same bug as #23, just in a different stage in the lifecycle. It's possible the component is created once and then written over again, causing anything in it's lifecycle to run twice, but show more or less correctly in the DOM.

Expected behavior
Load() and other lifecycle functions are only run once per component instance.

Only allow one factory to be created

Describe the bug
Calling multiple createFactories on the same component will...do just that, but also screws up the component registry.

To Reproduce
Steps to reproduce the behavior:

  1. vivi.createFactory(SomeComponent)
  2. vivi.createFactory(SomeComponent)
  3. Error

Expected behavior
Calling multiple createFactories should just create it once and warn the user if they call it multiple times on the same thing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.