Giter Site home page Giter Site logo

bayareawebpro / laravel-micro.js Goto Github PK

View Code? Open in Web Editor NEW
105.0 4.0 6.0 3.79 MB

A Laravel inspired front-end framework for JavaScript artisans.

Home Page: https://bayareawebpro.github.io/laravel-micro.js/

License: MIT License

JavaScript 100.00%
ioc-container service-provider middleware config laravel lazy-loading vue laravel-micro react javascript

laravel-micro.js's People

Contributors

bayareawebpro avatar garanaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-micro.js's Issues

TypeError: "obj is null"

Add check for null value when reading object names in container.

 /**
     * Get Name
     * @param obj
     * @return {String|null}
     */
{
    key: "getName",
    value: function getName(obj) {
      var possible = {
        name: obj.name ? obj.name : null,
        proto: obj.prototype ? obj.prototype.name : null,
        construct: obj.constructor ? obj.constructor.name : null,
        type: _typeof(obj) || null
      };
      return possible.name || possible.proto || possible.construct || possible.type;
    }

Singleton method missing

Not a bug, more like an enhancement:

Today I saw that there is no singleton method, but instead a third parameter in the method bind to share the instance. I extended the Container class with my own and added the method myself, it's merely a proxy to the bind method, but only takes two parameters and automatically passes the third as true:

"use strict";

import Container from 'laravel-micro.js';

export default class Application extends Container
{
    constructor() {
        super();
    }
    
    singleton(alias, binding) {
        return this.bind(alias, binding, true);
    }
}

I think this could be a useful addition to the main container

Dependency injection returns undefined

When injecting Router into the VueRoot binding, it returns undefined when VueRoot gets called from application.js.

VueServiceProvider.js

application.js

console

However, the VueRoot binding gets resolved without issues.

I followed the VueServiceProvider example from the laravel-micro-preset repo. https://github.com/bayareawebpro/laravel-micro-preset/blob/master/src/stubs/micro-app/services/Vue/VueServiceProvider.js

webpack.config.js

Any idea what the issue could be? I tried everything but no solution. I feel like webpack 4 might be the culprit, but no idea where to start.

Coalescing operator not transpiled

I was trying laravel-micro.js and I'm stuck with

ERROR in ./node_modules/laravel-micro.js/src/Support/Stringable.js 130:42
Module parse failed: Unexpected token (130:42)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     substr(start, end = null) {
|         return new Stringable(
>             this.value.substr(start, end ?? this.length() - start)
|         );
|     }
 @ ./node_modules/laravel-micro.js/src/index.js 7:0-45 14:0-27:1
 @ ./src/js/bootstrap.js
 @ ./src/js/app.js

Maybe consider to loose coalescing for now instead of forcing us to transpile node_modules or specific module (which is an extra step)?

Did you need/want a pull request for this kind of change?

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.