Coder Social home page Coder Social logo

rubik's Introduction

code-kid-X (xtreme?)

Nothing special about me you want to know about, just that I write serious code for fun ..

Did you have a ๐Ÿฟ ?

rubik's People

Contributors

codekidx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rubik's Issues

Support for Blocks in rubik

General idea of rubik is to keep the core minimal and provide blocks that could attach to rubik server seamlessly which can serve as the building blocks of your application.

Idea:

// Block is a guideline for extended functionality in rubik
type Block interface {
	OnAttach(*App)
}

App will have restricted access to the application and you can access the project config via app.Get or app.Decode

NOTE:

2 functions are expected to be added to core with this change.

func Attach(symbol string, block Block) {}

func GetBlock(symbol string) Block {}

change the signature of render method to support ParseFiles

right now the render method is called by

func Render(path string, vars interface{}, ttype templateType) (RenderMixin, error) {}

change it to

func Render(ttype templateType, vars interface{}, path ...string) (RenderMixin, error) {}

this will let is now that if any template depend upon another and parse files together

add locale support

adding locale support is a tedious task by hand but rubik has its own config management system to leverage from.

idea is:

  • config/locale/{langabbr}.toml can be the language specific configutaration used.
  • language struct declaration can be inside config/lang.go
  • headers to pick up from can be lang
  • default language can be set from config using lang top level field
  • and a new type of transport key called locale can be introduced to inject language specific configurations

Code:

type MyEntity struct {
  Locale LocaleConfig `rubik:"|locale"`
}

rubik test suite

we need to morph the current framework without affecting the existing APIs to write easy to mock test package.

#27 should also be considered

API documentation to be improved

Currently, the API Documentation is not developer-friendly. Make sure you update it with as much information possible and cover all methods.

basic schema validation from struct tag

Provide a basic schema validation using the ! character.

For example:

type Pancake struct {
  CakeType `rubik:"cake_type|query"`
  Cream `rubik:"!"`
}

NOTE: you need suffix as !

The cream should be required and by default all fields should be optional.

Stack trace page on errors thrown by user

Show a stack trace when some error occurs while in rubik lifecycle scope.

  1. Use inbuilt Render() method to render nice template
  2. This can only be done after #9 is done.
  3. Support for opening files via browser anchor tag in this stack trace page

setup github actions

setup a ci workflow to be triggered whenever

  • PR is create for master branch
  • Whenever a PR is merged into master

session manager interface support

Research a lot and implement support for pluggable session manager to rubik.

Session manager and Cacher to be supported internally by Rubik

REPL: don't open if it is not a rubik project

check for rubik.toml file and then open the project... this will help select command of REPL to select a specific rubik project from rest of the projects and provide help for them

Improve: Workspace config "x" should not be map[string]map[string]string

Describe your difficulties
Creating a config with map[string]map[string]string is a pain

Describe your suggestion
Reduce it to a discrete type ed:

type Command struct {
    Cmd string
    Pwd string
}

type WorkspaceCommand map[string]Command

...
X: WorkspaceCommand

Any specific flow you want to implement/change?
None

respond assertion to decrease injection overhead

use of segue method to offload the time to deliver a response.

In order to decrease the computations to speculate the response type of the developer we can as the developer to assert a response type

Some example and ideas:
1.

func indexCtl(en interface{}) (interface{}, error) {
    return rubik.Respond(value, rubik.Response.Type)
}
func indexCtl(en interface{}) (interface{}, error) {
    return rubik.Send(value, rubik.Response.Type)
}

support for overriding default config

default.toml must be the common config from which all the other config can be extended.

eg:
default

port = ":4000"
name = "app"

alpha

port = ":7000"

for SKETCH_ENV alpha it final config must be

port = ":7000"
name = "app"

injector implementation

for injecting struct tags into the request parameter we need an implementation of interface with new inputs.

  • default no tags must be considered as query transport
  • no tag can be said to have variable name with small 1st character.
  • non native inbuilt types must be considered as a JSON object

a way to support testing of blocks

there is currently no way to write test cases for a rubik block which is not a good way to ensure the working of a block.

We need to find a way to initialize a mock rubik app instance without routes and attach the desired block.

first class support for templating

Include templating support on the top of the rubik stack and with first class function.

Some ideas are:

// for html templates
func indexCtl(en interface{}) (interface{}, error) {
    return rubik.View("name.html", valueToInject)
}
// for json and text templates
func indexCtl(en interface{}) (interface{}, error) {
    return rubik.Text("name.json", valueToInject)
}
// decide what type of template it is with 3rd param
func indexCtl(en interface{}) (interface{}, error) {
    return rubik.Template("name.html", valueToInject, rubik.Type.HTML)
}
// for html templates
func indexCtl(en interface{}) (interface{}, error) {
    return rubik.RenderHTML("name.html", valueToInject)
}

// for html templates
func indexCtl(en interface{}) (interface{}, error) {
    return rubik.RenderJSON("name.json", valueToInject)
}

REPL: select command

the select command must select a single from project from a set of rubik projects.

More info: you can load your selected rubik project in memory and then work upon it

speculation implementation

write implementation for speculating the response of developers inside speculate.go

The basic scope of this implementation must cover all the basic structures or types that developers use.

add a verbose mode

that logs important actions done by the Rubik's core module.

A general approach would be:

rubik.toml

verbose = true # top level verbose flag

logger.go (some logging adapter)

log.debug() // based on the above flag

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.