0.0.399 • Published 8 days ago

@robertakarobin/util v0.0.399

Weekly downloads
-
License
-
Repository
github
Last release
8 days ago

@robertakarobin/util

Common configurations and helpers for Robin's projects.

If it doesn't have any dependencies then it's probably in here; otherwise it's in another package.

Contribute

npm i
npx husky install

Install

cd my_project
npm i -S https://github.com/robertakarobin/util.git

VSCode

cp -R ./node_modules/@robertakarobin/util/.vscode .vscode

(When/if https://github.com/microsoft/vscode/issues/15909 is done, extend the settings intead.)

Typescript

When prompted whether you want VSCode to use the locally-installed Typescript, select 'Yes'.

Goals

  • Valid typing
  • Valid HTML
  • No custom template syntax
  • No custom CSS syntax
  • No custom VSCode extension required
  • No 3rd party modules for front-end code, and for back-end code only when it would otherwise require reinventing a big ol' wheel beyond the day-to-day of making a web app
  • Automates boring CSS stuff
  • Produces static HTML/CSS files for SSG
  • Adds interactivity with JS to static HTML files, without needing to rerender
  • Specify what should get rerendered, when and where
  • Produces interactive sites for CSR
  • Blends seamlessly from static files to CSR
  • Autocompletes routes
  • Markdown support

Notes

  • The build script copies the contents of src to a tmp folder so that it can transpile <markdown> tags before the TS is compiled. Without this step the Markdown would need to be compiled in the browser. However, if your tsconfig.json has path aliases for src then it'll keep the Markdown from getting transpiled correctly. To resolve, point your alias to tmp as well as src, e.g. paths: { "@src/*": ["tmp/*", "src/*"]}
  • Have to include tmp in the tsconfig includes until TSX fixes an issue with decorators: https://github.com/evanw/esbuild/issues/3496

TODO

  • TODO1: Add TS preprocessing back in
  • TODO1: Don't refer to functions by string -- keeps names from being minified
  • TODO2: Image preprocessing
  • TODO2: Import SVGs
  • TODO2: Remove CSS from JS bundles
  • TODO3: Use # private fields
  • TODO3: CSS class and variable mapping

Done:

  • Allow anonymous event handlers, for when we know a component won't be SSGd
  • A way to cache DOM queries, like Angular's ViewChild
  • Fully hydrate the template on the landing page -- e.g. with event listeners and stuff -- without needing to rerender it
  • Don't use [on] attributes?
  • Style setter
  • Specify which routes to build in build config, not with isSSG
  • Match routes with params
  • Add reducer functions
    • I'm calling them formatters, since (a) reducers involve actions, and (b) "reducer" is a confusing name
  • onEl => onConstruct
  • Extract out link component
  • Make Emitter subscriptions strong by default
  • Make Component.instances weak
  • Extract util/index.ts to separate files, for code splitting
  • Add isHydrated option
  • Don't require script
  • Bust CSS cache
  • Add minify as build option
  • Template/CSS prefix
  • .bind works on emitters too
  • Use constructor to create or get existing instance
  • Components emit events
  • Show [data-component] on build?
  • Jump anchors
  • Base URI
  • Add route helper
  • Don't use Component.push in <script>
  • Set absolute path for imports
  • Extract window. boilerplate to beginning of layout
  • Automatically set HTML attributes
  • Differentiate between weak/strong subscriptions
  • Add config with HTML/CSS validator/formatter
  • Fix Windows paths
  • toFunction should return the instance
  • Component content shouldn't be duplicated
  • Bug: Instances not binding to elements on rerender
  • bind without needing page referesh
  • Route names for HTML IDs
  • Fix route() names not bring strongly typed
  • CSS to external
  • Vendor doesn't need own bundle
  • CSS breakpoints
  • Declare CSS variables inline
  • Get CSS variable names inline
  • Support nested tokens
  • Bundle all components/pages together
  • Markdown support
  • Include CSS on fallback pages
0.0.399

8 days ago

0.0.398

8 days ago

0.0.397

8 days ago

0.0.395

8 days ago

0.0.394

9 days ago

0.0.393

9 days ago

0.0.392

9 days ago

0.0.396

8 days ago

0.0.391

9 days ago

0.0.390

10 days ago

0.0.389

15 days ago

0.0.388

18 days ago

0.0.387

18 days ago

0.0.386

18 days ago

0.0.384

23 days ago

0.0.383

23 days ago

0.0.382

24 days ago

0.0.385

23 days ago

0.0.381

25 days ago

0.0.380

25 days ago

0.0.379

28 days ago

0.0.369

1 month ago

0.0.378

29 days ago

0.0.372

1 month ago

0.0.371

1 month ago

0.0.370

1 month ago

0.0.377

30 days ago

0.0.376

1 month ago

0.0.375

1 month ago

0.0.374

1 month ago

0.0.368

1 month ago

0.0.367

2 months ago

0.0.362

2 months ago

0.0.366

2 months ago

0.0.365

2 months ago

0.0.364

2 months ago

0.0.363

2 months ago

0.0.359

2 months ago

0.0.361

2 months ago

0.0.360

2 months ago

0.0.358

2 months ago

0.0.357

2 months ago

0.0.356

2 months ago

0.0.355

2 months ago

0.0.354

2 months ago

0.0.353

2 months ago

0.0.352

2 months ago

0.0.339

2 months ago

0.0.348

2 months ago

0.0.347

2 months ago

0.0.346

2 months ago

0.0.345

2 months ago

0.0.349

2 months ago

0.0.340

2 months ago

0.0.344

2 months ago

0.0.343

2 months ago

0.0.342

2 months ago

0.0.341

2 months ago

0.0.351

2 months ago

0.0.350

2 months ago

0.0.337

2 months ago

0.0.338

2 months ago

0.0.336

2 months ago

0.0.335

2 months ago

0.0.334

2 months ago

0.0.333

2 months ago

0.0.332

2 months ago

0.0.329

3 months ago

0.0.328

3 months ago

0.0.327

3 months ago

0.0.331

3 months ago

0.0.330

3 months ago

0.0.326

3 months ago

0.0.325

3 months ago

0.0.324

3 months ago

0.0.323

3 months ago

0.0.319

3 months ago

0.0.318

3 months ago

0.0.322

3 months ago

0.0.321

3 months ago

0.0.320

3 months ago

0.0.315

3 months ago

0.0.314

3 months ago

0.0.313

3 months ago

0.0.317

3 months ago

0.0.316

3 months ago

0.0.312

3 months ago

0.0.311

3 months ago

0.0.310

3 months ago

0.0.309

3 months ago

0.0.308

3 months ago

0.0.307

3 months ago

0.0.296

3 months ago

0.0.295

3 months ago

0.0.294

3 months ago

0.0.293

3 months ago

0.0.299

3 months ago

0.0.298

3 months ago

0.0.297

3 months ago

0.0.292

3 months ago

0.0.304

3 months ago

0.0.303

3 months ago

0.0.302

3 months ago

0.0.301

3 months ago

0.0.306

3 months ago

0.0.305

3 months ago

0.0.300

3 months ago

0.0.291

3 months ago

0.0.290

3 months ago

0.0.289

3 months ago

0.0.288

3 months ago

0.0.287

3 months ago

0.0.285

3 months ago

0.0.284

3 months ago

0.0.283

3 months ago

0.0.282

3 months ago

0.0.286

3 months ago

0.0.279

3 months ago

0.0.278

3 months ago

0.0.277

3 months ago

0.0.281

3 months ago

0.0.280

3 months ago

0.0.274

3 months ago

0.0.273

3 months ago

0.0.272

3 months ago

0.0.271

3 months ago

0.0.276

3 months ago

0.0.275

3 months ago

0.0.270

3 months ago

0.0.269

4 months ago

0.0.268

4 months ago

0.0.267

4 months ago

0.0.266

4 months ago

0.0.263

4 months ago

0.0.262

4 months ago

0.0.265

4 months ago

0.0.264

4 months ago

0.0.259

4 months ago

0.0.261

4 months ago

0.0.260

4 months ago

0.0.258

4 months ago

0.0.257

4 months ago

0.0.256

4 months ago

0.0.255

4 months ago

0.0.254

4 months ago

0.0.253

4 months ago

0.0.252

4 months ago

0.0.251

4 months ago

0.0.249

4 months ago

0.0.248

4 months ago

0.0.247

4 months ago

0.0.250

4 months ago

0.0.246

4 months ago

0.0.245

4 months ago

0.0.244

4 months ago

0.0.241

5 months ago

0.0.243

5 months ago

0.0.242

5 months ago

0.0.239

5 months ago

0.0.240

5 months ago

0.0.238

5 months ago

0.0.237

5 months ago

0.0.236

5 months ago

0.0.235

5 months ago

0.0.230

5 months ago

0.0.234

5 months ago

0.0.233

5 months ago

0.0.232

5 months ago

0.0.231

5 months ago

0.0.227

5 months ago

0.0.226

5 months ago

0.0.225

5 months ago

0.0.224

5 months ago

0.0.229

5 months ago

0.0.228

5 months ago

0.0.223

5 months ago

0.0.222

5 months ago

0.0.219

5 months ago

0.0.218

5 months ago

0.0.217

5 months ago

0.0.221

5 months ago

0.0.220

5 months ago

0.0.216

5 months ago

0.0.215

5 months ago

0.0.214

5 months ago

0.0.213

5 months ago

0.0.212

5 months ago

0.0.211

5 months ago

0.0.210

5 months ago

0.0.209

5 months ago

0.0.208

5 months ago

0.0.207

5 months ago

0.0.206

5 months ago

0.0.205

5 months ago

0.0.204

5 months ago

0.0.203

5 months ago

0.0.202

5 months ago

0.0.201

5 months ago

0.0.200

5 months ago

0.0.196

5 months ago

0.0.199

5 months ago

0.0.198

5 months ago

0.0.195

5 months ago

0.0.194

5 months ago

0.0.193

5 months ago

0.0.192

5 months ago

0.0.191

5 months ago

0.0.190

5 months ago

0.0.189

5 months ago

0.0.188

5 months ago

0.0.187

5 months ago

0.0.184

5 months ago

0.0.183

6 months ago

0.0.182

6 months ago

0.0.16

1 year ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago