kottans / framework-2021 Goto Github PK
View Code? Open in Web Editor NEWA custom framework empowered Weather App
Home Page: https://kottans.org/framework-2021/
A custom framework empowered Weather App
Home Page: https://kottans.org/framework-2021/
P0 - must have
P1 - nice to have; put aside for a while when any task of a higher priority arrives (e.g. next homework in the course)
P2 - you will really ramp your skills up if you do; put aside when any task of a higher priority arrives (e.g. next homework in the course)
v1.1.x => v1.2
Framework: is able to re-render a specific component (?)
Hooks:
Source: https://codesandbox.io/s/pedantic-wilson-41ip7?file=/src/index.ts:0-442
//@ts-expect-error
import kebabCase from "kebab-case";
const styles = {
color: "blue",
fontFamily: "comic sans ms",
fontSize: "42px"
};
Object.defineProperty(styles, "toString", {
value: function (this: string) {
return Object.keys(this)
.map((key) => `${kebabCase(key)}:${this[key]}`)
.join(";");
},
writable: false
});
document.getElementById("app").innerHTML = `
<div style="${styles}">Hello world</div>
`;
Contexts:
https://openweathermap.org/api
Global data container gets updated with nw request.
Framework: re-renders App
Every component looks into global data container
Code base: single spaghetti-file
Components:
Framework.render
Static data (3 cities, todays weather, 5 days forecast)
.postcssrc
: add globalModulePaths
{
...
plugins: {
...
'postcss-modules': {
...
globalModulePaths: [
'src/index.css'
]
}
}
}
src/index.css
for global styles... just like CHECKED and DISABLED
Consider adding SingleSelection
component example based on <select>
.
.gitignore
.editorconfig
package.json
(with npm)Problem:
createElement
doesn't handle tags' className
attribute.
Solution:
If className
is a string then => split at spaces.
Then element.classList.add(...classNamesList)
Problem:
a8e06ad (currently on dev) brings back push-dir
as a publishing script.
Alternative deployment package gh-pages
is already listed among dev dependencies.
Desired outcome:
gh-pages
is used as a publishing method.
Suggested approach:
package.json
: change deploy
script so that it runs gh-pages -d dist
Problem:
a8e06ad (currently on dev) brings back shell interpretation of glob passed to npx prettier
.
Desired outcome:
npx prettier
glob is quoted and therefore interpreted by prettier, not shell.
Suggested approach:
package.json
: change prettify
script so that it runs npx prettier --write \"**/*.{js,css,md,html}\"
P0 - must have
P1 - nice to have; put aside for a while when any task of a higher priority arrives (e.g. next homework in the course)
P2 - you will really ramp your skills up if you do; put aside when any task of a higher priority arrives (e.g. next homework in the course)
v1.0.x => v1.1.x
Preps to v1.2
Pre-requisites:
FuncName()
)Task:
Under windows 10, NodeJS v14+, with parcel-bundler v1.12.4 as a dev dependency npm run start
results in D:\dev\OR\kottans\framework-2021\index.js: Invalid Version: undefined
error.
It's a known issue.
Pin parcel-bundler version as 1.12.3 in dev-dependecies
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.