bayareawebpro / laravel-micro.js Goto Github PK
View Code? Open in Web Editor NEWA Laravel inspired front-end framework for JavaScript artisans.
Home Page: https://bayareawebpro.github.io/laravel-micro.js/
License: MIT License
A Laravel inspired front-end framework for JavaScript artisans.
Home Page: https://bayareawebpro.github.io/laravel-micro.js/
License: MIT License
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;
}
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
When injecting Router
into the VueRoot
binding, it returns undefined when VueRoot
gets called from application.js.
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
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.
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?
Use it or drop it. Needs test case to confirm array implementation.
https://github.com/bayareawebpro/laravel-micro.js/blob/master/src/Support/Repository.js#L162
https://github.com/bayareawebpro/laravel-micro.js/blob/master/src/Support/Repository.js#L176
laravel-micro.js/tests/repository.test.js
Line 16 in 57efe26
Incorrect usage from deprecated implementation. Must be a class or object with a handle method.
https://bayareawebpro.github.io/laravel-micro.js/#/docs/error-handling
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.