Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Latest commit

 

History

History
62 lines (44 loc) · 1.72 KB

README.md

File metadata and controls

62 lines (44 loc) · 1.72 KB

OctoberTS

TypeScript implementation of the October CMS Frontend Framework

THIS IS A WORK IN PROGRESS

Do not use this in production. The code is still a mess so don't bother creating larger PRs since most of the code base will be refactored. Please open an issue detailing your implementation before you write code.

# install deps
yarn
# run tests
yarn test

API

// Optional, adds IE11 support
import './src/polyfills'

// Import requried features.
import {Build, withAttachLoading, withRequest, withValidation} from './src'

// Attach Framework features to the DOM globally.
const framework = Build(
    withRequest(),       // data-request
    withValidation(),    // data-request-validate
    withAttachLoading(), // data-attach-loading
)

// Use on demand without global event listeners.
const framework = Build()
const response = framework.request('onUpdate')

Implementation status

  • global DOM events api
  • on demand api

Framework extras

  • data-request-validate
  • data-attach-loading
  • Loading indicator
  • Flash messages
  • data-request-flash
    • Error handling
    • Flash handling

Framework

  • data-request
  • data-track-input

Incompatibilities

  • eval attributes are not supported (data-eval-*) by design and probably won't be in the future
  • There are some limitations to the data-request-update syntax: The value has to be wrapped in ' and functions or variables are not supported (no dynamic evaluation is done!). See tests for examples
  • All event listeners need to get their data off of the e.details event property, instead of the multiple function attributes