Giter Club home page Giter Club logo

misk-web's Introduction

Deprecation Warning

Misk-Web is deprecated, please do not create new tabs and plan to migrate off long term.

The Misk dashboard is migrating away from a React Typescript stack to using server-side-rendered kotlinx.html using Hotwire and Tailwind CSS.

Existing Readme Below

See the project website for documentation and APIs.

Misk-Web is a micro-frontends Typescript + React web framework from Cash App.

It also happens to work seamlessly with Misk!

Quick Links

NPM Packages

NPM Package Docs Description
npm Docs React + Typescript components and utilities
npm Docs A simpler way to wire up interactive form, network, and other components with Redux
npm Docs Common interfaces, colors, constants
npm Docs Shared developer build tools
npm Docs Shared Prettier config
npm Docs Test libraries (Jest) and configuration
npm Docs Standard TSLint configuration and rules
npm [Deprecated] Migrated to @misk/core

How to work with this repo

misk-web manages its Node installation via Hermit. Follow the Quickstart guide, then activate the hermit environment:

cd path/to/misk-web
source bin/activate-hermit

Also consider enabling Hermit shell hooks.

This repo is a monorepo managed by Rush. Using Rush allows coordinated version releases and iterative builds, among other headache-saving features. Please take time to read their documentation for other commands not described below.

Set up rush:

npm i -g @microsoft/rush

Then build everything:

# Like `npm install`, but for all packages in the repo.
rush update
# Like `npm run build`, but for all of them.
rush build

misk-web's People

Contributors

aashnisshah avatar adrw avatar dependabot[bot] avatar javierr14 avatar keeferrourke avatar krispenney avatar r3mariano avatar renovate-bot avatar renovate[bot] avatar staktrace avatar swankjesse avatar tso avatar wesleyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

misk-web's Issues

Create an asyncGet() function

Make it easier to have a read only data tab without ever touching ducks.

import { asyncGet } from "@misk/common"
YourCompoennt<data: props> {
     <HTMLTable>
       ...
     </HTMLTable>
}
TabContainer<> {
	const data = asyncGet(url)
	if (data) {
	 	render() {
	 		<Your Component data={data}/> 		
	} else {
		<OfflineComponent>
	}
	render() {
		<ReadOnlyTab url={} render={}
	}
}

Implement better way of storing and serving remote static assets in @misk/common

Currently we package remote static assets from respective NPM packages and remote URLs within @misk/common which are included in shipped compiled code.

@misk/common/styles.js and @misk/common/vendors.js are vital to each tab, thus if an error is shipped there should be a better way to force update all tabs to the new version than simply waiting for them to update the @misk/common locally installed NPM package.

@misk/ packages are shipped in Misk Jars so that may be sufficient. Otherwise a CDN with a static Url that can be used to point at the latest version of static assets may be a better solution.

Update CLI with latest idioms

  • export const fnName = async () => {} function declarations
  • Remove chalk, commander, node-emoji libraries
  • Use winston logger

Add TabContainer for use with Navbar

const TabContainer = styled(ResponsiveContainer)`
  position: relative;
  top: 110px;
  padding-left: 5px;
`

Duplicate definitions in any Loader tabs

Loading: Consider Alternatives to using divs + React to load tabs

Theory 1:

  • eval the code so it registers the window variables
  • execute the command to render the variables from window

Theory 2:

  • all tab scripts stay on loader at all times
  • div stays within loader router (ie. div config only when /_admin/config route match)
  • within each tab's router, they only match on their subpath
  • shift domains so that loader can use /_admin/{tab} paths and change each tab's to /_admin/tab/{tab} so that tab individual testing can still be done
  • because of each tab only showing when the local router matches, the tabs will hide/reveal automatically without reloads since all navigation will resolve at the main /_admin router

Theory 3:

  • Make all the tabs as externals, generate require or import statements in LoaderContainer code, enforce that all tabs have a main container which is loaded in. Thus, tabs aren't loaded as separate React apps but as components in the same Loader React app

Theory 4:

Theory 5:

Duplicate Palette tab to PaletteExemplar

  • Palette Exemplar has two words to easier to see the rename rules as a template
  • Leaves palette to be used for public demo since small changes between demo and what should be used as a template
  • Palette demo currently broken because default build is to lib/web/_tab/... but lib is included in the .gitignore
  • Review that relative_path_prefix in Palette should be _admin/ (probably should be _tab/). Make sure relative_path_prefix value is correct as a template.

Typescript Cast Bug

[2018-11-29 17:04:01] waiting for [       2] misk-web-misk-web-web running containers to finish...
✖ 「atl」: Child process failed to process the request: Error: Debug Failure. Invalid cast. The supplied value [object Object] did not pass the test 'isJsonSourceFile'.
    at Object.cast (/node_modules/typescript/lib/typescript.js:1325:22)
    at getTypeOfVariableOrParameterOrPropertyWorker (/node_modules/typescript/lib/typescript.js:35591:41)
    at getTypeOfVariableOrParameterOrProperty (/node_modules/typescript/lib/typescript.js:35567:48)
    at getTypeOfSymbol (/node_modules/typescript/lib/typescript.js:35856:24)
    at resolveESModuleSymbol (/node_modules/typescript/lib/typescript.js:32928:36)
    at getTargetOfNamespaceImport (/node_modules/typescript/lib/typescript.js:32431:20)
    at getTargetOfAliasDeclaration (/node_modules/typescript/lib/typescript.js:32560:28)
    at resolveAlias (/node_modules/typescript/lib/typescript.js:32595:30)
    at getSymbol (/node_modules/typescript/lib/typescript.js:31689:38)
    at resolveNameHelper (/node_modules/typescript/lib/typescript.js:31843:34)
    at resolveName (/node_modules/typescript/lib/typescript.js:31829:20)
    at resolveEntityName (/node_modules/typescript/lib/typescript.js:32680:26)
    at resolveEntityName (/node_modules/typescript/lib/typescript.js:32688:33)
    at resolveTypeReferenceName (/node_modules/typescript/lib/typescript.js:38485:20)
    at getTypeFromTypeReference (/node_modules/typescript/lib/typescript.js:38670:30)
    at getTypeFromTypeNode (/node_modules/typescript/lib/typescript.js:40178:28)
    at tryGetTypeFromEffectiveTypeNode (/node_modules/typescript/lib/typescript.js:35562:24)
    at getTypeForVariableLikeDeclaration (/node_modules/typescript/lib/typescript.js:35192:32)
    at getWidenedTypeForVariableLikeDeclaration (/node_modules/typescript/lib/typescript.js:35531:56)
    at getTypeOfVariableOrParameterOrPropertyWorker (/node_modules/typescript/lib/typescript.js:35645:24)
    at getTypeOfVariableOrParameterOrProperty (/node_modules/typescript/lib/typescript.js:35567:48)
    at getTypeOfSymbol (/node_modules/typescript/lib/typescript.js:35856:24)
    at getPropertyTypeForIndexType (/node_modules/typescript/lib/typescript.js:39485:36)
    at getIndexedAccessType (/node_modules/typescript/lib/typescript.js:39685:20)
    at instantiateTypeWorker (/node_modules/typescript/lib/typescript.js:40634:24)
    at instantiateType (/node_modules/typescript/lib/typescript.js:40592:26)
    at addMemberForKeyType (/node_modules/typescript/lib/typescript.js:37127:32)
    at resolveMappedTypeMembers (/node_modules/typescript/lib/typescript.js:37106:21)
    at resolveStructuredTypeMembers (/node_modules/typescript/lib/typescript.js:37237:25)
    at getSingleCallSignature (/node_modules/typescript/lib/typescript.js:48694:32)
    at compareSignaturesRelated (/node_modules/typescript/lib/typescript.js:41128:61)
    at signatureRelatedTo (/node_modules/typescript/lib/typescript.js:42517:24)
    at signaturesRelatedTo (/node_modules/typescript/lib/typescript.js:42497:43)
    at structuredTypeRelatedTo (/node_modules/typescript/lib/typescript.js:42236:43)
    at recursiveTypeRelatedTo (/node_modules/typescript/lib/typescript.js:41959:64)
[2018-11-29 17:04:17] waiting for [       2] misk-web-misk-web-web running containers to finish...

Build initial new-tab.sh

  1. Make it work through curl | bash -s so a local shell file doesn't have to be updated
  2. Prompt for new name in formats: foo-bar, fooBar, FooBar
  3. Download .zip of palette src code from github
  4. Unzips to pwd
  5. Renames folder to `foo-bar
  6. Recursive find/replace in directory of palette -> fooBar, Palette -> FooBar

Create abstract loader tab/function with no view

Make Loader tab more abstract so that it doesn’t have any view and only does loading. Create new tab that has the dashboard view

Thus loader can then be used for any app regardless of the view.

Likely rename loader -> dashboard
Abstract the loading functionality out to functions in @misk/common

Eliminate need for misk-web sh script in Docker

  • Bake hash directory / conditional builds functionality and other directory walking into Misk-Web-Plugin and @misk/cli
    • #104 : only spin up docker images if a build will occur
    • #105 : make mirroring of node_modules from Docker container only occur after a ./gradlew web develop style command since it only needs to be there for code completion with VS Code. Doesn't need to happen on every build or anything else
  • Less code to maintain
  • More predictable and testable behavior inside of Docker container
  • Simplify the required registered tasks in Misk-Web-Plugin. Currently mirrors the options in misk-web or used to take a -Pcmd= to pass in the options directly which is a poor DevEx

Add createPackageJson function/tool to `@misk/dev` that pulls from miskTab.json

  • Generates package json with latest packages determined from Docker image version in src/miskTab.json
  • Put json file that is copied into Docker image that includes mappings of Docker image version to the @misk/ versions
  • Make it so following files can pull slug from miskTab.json
    • Webpack
    • src/index.tsx::createIndex
    • index.html (through webpack)
    • gradlew (ports for Docker)

Add miskweb install command

Wrap npm install command in CLI, run it if a pre-command verification of a node_modules folder isn't present.

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.