akkadu / styleguide Goto Github PK
View Code? Open in Web Editor NEWDeveloper styleguide for contributing to Akkadu repositories
Home Page: https://akkadu.github.io/styleguide/
License: MIT License
Developer styleguide for contributing to Akkadu repositories
Home Page: https://akkadu.github.io/styleguide/
License: MIT License
request
is deprecatedisomorphic fetch
uses node-fetch under the hood, acting more like a client polyfill with ss supportaxios
is a good module as well, but it would need to be implemented on client (11kb) to be API-consistent with client request moduleIs your feature request related to a problem? Please describe.
Request.js is an Axios powered module written some time ago to normalise our request patterns on the client side.
Things that the request.js provides:
In addition if we at any point want to extend this further, we can always split it into for instance sub classes.
Also if we want to for whatever reason change axios to another module, we can do that without a major refactor.
Describe the solution you'd like
Is your feature request related to a problem? Please describe.
According to the "Oneline JSDoc Comments" rule at style guide, developers seems to be forced to use single line style comment rather than multiple detailed lines style comments. It may simplify the comments wirtng process and reduce the timing for managing comments, however, it may not provide that much benefit in the long run.
Describe the solution you'd like
I would like to suggest making the "Oneline JSDoc Comments" as an optional rule when coding, and possibly making multiple detailed lines style (JSDoc proposed) comments as a prefered option for developers.
With the multiple lines style comments, it could gain potential benefits, such as:
However, there're drawbacks, for example, it may increase the complicity of managing comments, expand developing time, making the comments a bit verbose sometimes, etc.
Additional context
References:
For client date parsing, dayjs is suitable for all our current needs.
It's clear that there are different practices and utilities from testing "pure" components, and large page-level components, however apart from general rules of thumb, it's not clear how we want to handle everything inbetween.
We could have page-level components that carry little-to-no business logic in them other than importing other components that can be covered in e2e testing frameworks, but what about other complex components that import many other components yet contain some business logic of their own? Is this a question of testing strategies or component design?
I would like to have a framework for which all business logic (methods, reactivity, and async functions especially) are testable as units, whereas integrations are only tested once per page. Maximizing test coverage while minimizing complexity is important to consider.
Is your feature request related to a problem? Please describe.
We have decided to use validate.js in the past for all frontend request validation, but it is not documented anywhere.
in addition after that decision we've extended it's features inside @akkadu/validator to which we can add extra functionality when needed.
Describe the solution you'd like
do
const request = async(params) => {
const options = filterParams()
const res = await fetch(options)
const someInfo = await res.getSomeInfo()
const json = await res.json()
const data = mapMyData()
return { ...data, ...someInfo }
}
don't
const request = (params) => new Promise((resolve, reject) => {
const options = filterParams()
let response
let data = {}
return fetch(options)
.then(res =>
response = res
return res.getSomeInfo()
)
.then(someInfo =>
data.someInfo = someInfo
return response
)
.then(res => res.json())
.then(json => { ...data, ...json })
})
Should outline
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.