Giter VIP home page Giter VIP logo

framework-2021's Issues

Homework assignment v1.1.x => v1.2.x; Preps to v1.3.x

Complete the items below

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

  • P0: split your code base into modules (components, data/API, framework)
  • P0: migrate to JSX
  • P1: make your app looking nice with a touch of visual design / css-styling

css-in-js

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>
`;

Add component functions (v1.0)

Components:

  • App
  • Search by city
  • Temperature units switch (F/C)
  • Today's weather
  • 5 days forecast

Framework.render

Static data (3 cities, todays weather, 5 days forecast)

Setup dev env

  • .gitignore
  • .editorconfig
  • eslint config
  • prettier config
  • package.json (with npm)
  • builder (with HMR/watch)

dev env: Change app deployment script to use gh-pages

Issue 1

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

Issue 2

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}\"

Homework assignment v1.0.x => 1.1.x; Preps to v1.2

Complete the items below taking the item group priority into consideration

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

Add components with props, htmlx (v1.2)

Pre-requisites:

  • Template literals & tagged letrals: write your own template parser:
    • simple interpolation
    • every param transformed (strings are enclosed in qoutes, numerics are multiplied, objects/arrays stringified, functions => FuncName())
  • Data Structures: write your own DOM tree and HTML renderer
  • RegExp: write your own HTML parser (HTML string => tree)

Task:

  • Function calls => HTMLX
  • Each function => component with props

parcelJS v1.12.4 incompatible with nodeJS v14+

Problem

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.

Solution

Pin parcel-bundler version as 1.12.3 in dev-dependecies

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.