After first paint
Lee Blazek
After time to first paint
| HTML | Jade, pug, EJS, marko, handlebars, mustache | mostly server side rendered. backbone/marionette, jquery, etc |
|---|---|---|
| CSS | Sass, scss, stylus, less | have their own preprocessor |
| JS | ES, 7, TS, Coffeescript | Usually need bundler (webpack, babel, etc) |
lists (ol, ul, dl) - super useful
| Content sectioning | html, Main, nav, section, aside, footer, header, h1,h2,.. |
| Block level | div, lists(ul, ol, ..), ng component selectors(dps-card) |
| inline | span, b, i, strong, a, small |
Fewer diverse tags, means less CSS, better for SEO and Accessibility, performance, writing e2e tests
in other words no "divitis", "classitis", "span mania"
Use css before JS
pseudo classes / combinators
CSS
| :hover | |
| :first-child | |
| :last-child | |
| :nth-child | https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child |
| :before | |
| :after | |
| > | The > combinator selects nodes that are direct children of the first element. |
SCSS nesting and parent selector
SCSS SYNTAX
nav {
ul {
margin: 0;
padding: 0;
list-style: none;
}
li { display: inline-block; }
a {
display: block;
padding: 6px 12px;
text-decoration: none;
&:hover {
background: red;
}
}
}nav ul {
margin: 0;
padding: 0;
list-style: none;
}
nav li {
display: inline-block;
}
nav a {
display: block;
padding: 6px 12px;
text-decoration: none;
}
nav a:hover {
background:red;
}
For simpler peices of layout (bootstrap has them also)
Better for whole page layout stuff
<div class="pl-3 pt-1 font-weight-light">
By {{problem?.physician}}
<small class="float-right"
*ngIf="problem.clinicalStatus == 'Resolved'">
Resolved
</small>
</div>
If an angular app sends a date "1/1/2019" to a java(or other api) typed as Int or number, etc it will throw error?
If a server (java or any) sends a date "1/1/2019" to a typescript app(angular, react, etc) that is typed in typescript as number will it throw error?
to typecheck in browser you need to use "typeof" var
| code | ||
|---|---|---|
| feature flag / router | prevents user navigation to whole route | not change able after deployed |
| feature flag / dva perm filter | tree shaked out in .ts files. HTML rendering prevented, or controller code exec | not change able after deployed |
| keycloak | all code shipped to browser | can change after deploy |
Is a pipe in dps-ui-core.
Uses a permission trick to block navigation to entire route
<ng-container *ngIf="'insurance' | dvaPermValid : 'FEATURE_INCLUDE' | async">
<!--stuff-->
</ng-container>// We can't use functions due to aot, can't import the enviroments since ts won't let us...
const jenkinsHostPorts = ['localhost:3000', 'localhost:3001', 'localhost:3002', 'localhost:3003', 'localhost:3004', 'localhost:3005',
'localhost:3006', 'localhost:3007', 'localhost:3008', 'localhost:3009', 'localhost:3010'];
const host = window.location.host.toString();
const isLocalOrCiOrQa = [...jenkinsHostPorts, 'ci.oneviewdps.davita.com', 'qa.oneviewdps.davita.com'].indexOf(host) !== -1;
// NOTE: here is example of how to featureflag routes via environment
{
path: 'profile',
component: ProfileComponent,
data: {
permissions: { // NOTE: delete this line to go past ci with profile
only: isLocalOrCiOrQa ? [] : ['no-one-ever'], // NOTE: delete this line to go past ci with profile
}, // NOTE: delete this line to go past ci with profile
label: 'Patient Profile',
}
},