This guide is intended for developers working on the Timebase project.
# Install dependencies
npm installTo start a local development server:
# Start the development server (builds and serves)
npm run devThe development server runs on http://localhost:8080. It will automatically rebuild the project when you run it, but it does not currently support hot module replacement (HMR).
# Build the application (extract data, logos, and build pages)
npm run build
# Run tests
npm test
# Update web features data
npm run update
# Stop the server
npm run stoptimebase/
├── src/ # Source code
│ ├── client.js # Main entry point
│ ├── client-bcd.js # BCD entry point
│ ├── core/ # Core logic (data processing, timeline app)
│ ├── renderer/ # UI rendering logic
│ └── utils/ # Utility functions
├── data/ # Generated data files
│ ├── web-features.js # Data from web-futures
│ └── bcd.js # Data from MDN BCD
├── scripts/ # Build and maintenance scripts
├── tests/ # Unit tests
├── docs/ # Generated static site (output of build)
├── images/ # Browser logos
└── package.json # Project configuration
The application uses two main data sources:
- Web Features: Sourced from the
web-futuresnpm package. This data is processed byscripts/extract-data.jsintodata/web-features.js. - Browser Compatibility Data (BCD): Sourced from
@mdn/browser-compat-data. This data is processed byscripts/extract-bcd-data.jsintodata/bcd.js.
- TimelineApp: The main application class that orchestrates data loading, rendering, and event handling.
- DataProcessor: Handles the transformation of raw data into a format suitable for the timeline.
- Renderer: Responsible for generating the HTML for the timeline.
- ScrollManager: Manages scrolling and navigation to specific dates or features.
- StateManager: Manages the application state (filters, selection) and synchronizes it with the URL.
To update the web features data to the latest version:
npm run updateThis command will:
- Update the
web-futuresdependency - Run extraction scripts to generate fresh data files in
data/