Download the PHP package icetea/icecube without Composer

On this page you can find all versions of the php package icetea/icecube. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package icecube

IceCube

A PHP Single-File Component (SFC) framework for building reactive, component-based web applications. IceCube allows you to write PHP components with colocated styles and JavaScript in a single file, similar to Vue.js Single File Components.

Goals

IceCube aims to provide:

  1. Single-File Component Architecture: Write PHP components with their styles and JavaScript in one cohesive file (.ice.php)
  2. Component Encapsulation: Scoped styles that don't leak to other components
  3. Reactive Client-Side Behavior: Easy-to-use client-side interactivity with a refs-based system
  4. Flexible Compilation: Support for different style preprocessors (CSS, SCSS) and bundling strategies (embedded, Vite)
  5. Performance Optimization: Automatic compilation, caching, and on-demand loading of components
  6. Developer Experience: Intuitive API for creating interactive components without complex build processes
  7. Progressive Enhancement: Components work server-side first, with optional client-side enhancements

Architecture

Core Components

1. Component System

2. Parser Layer

3. Compiler Layer

Style Compilers

Implement the StyleCompiler interface:

Script Compilers

Implement the ScriptCompiler interface:

4. Registry System

5. Cache System

Compilation Flow

Client-Side Runtime

The registry generates JavaScript that:

  1. Dynamically imports component scripts on-demand
  2. Initializes components via MutationObserver (supports dynamic content)
  3. Provides a refs proxy for easy DOM element access
  4. Passes component props from server to client
  5. Tracks component initialization states (icing → iced)

Style Scoping

Styles are automatically scoped by wrapping them with the component's data attribute:

Global styles (marked with <style global>) bypass scoping.

Usage Guide

Basic Setup (Without Vite)

1. Create a Component

Create a file app/Components/Counter.ice.php:

Alternatively, separate the JavaScript into Counter.js:

2. Initialize the Compiler

In your application bootstrap (e.g., bootstrap/app.php):

3. Render Components in Views

In your Blade template:

4. Production Optimization

For production, use caching:

Advanced Setup (With Vite)

1. Install Required Dependencies

2. Configure Vite

Update vite.config.js to use Vite's glob import for dynamic component loading:

3. Create IceCube Loader Script

Create resources/js/icecube.js:

4. Use icecube.js in your app

In blade template:

Or in icedom

5. Configure Compiler with Vite Strategy

In your application bootstrap or controller:

6. Run Vite Dev Server

With ViteScriptCompiler, compiled JavaScript will import CSS separately:

7. Use NPM Packages in Components

You can import any NPM package in your component JavaScript files:

Laravel Integration Guide

Quick Setup

1. Register Service Provider

Add IceCubeServiceProvider to config/app.php:

Or for Laravel 11+, add to bootstrap/providers.php:

2. Publish Configuration

This creates resources/js/icecube.js where you can customize:

3. Create Storage Link

4. Use Components in Blade Views

Service Provider Behavior

The IceCubeServiceProvider automatically:

Production Build Command

Compile all components and generate cache before deployment:

This CompileIceCubeCommand scans all .ice.php files, compiles them, and stores the cache.

Note: The command automatically detects if you're using ViteScriptCompiler and will skip storing styles in cache (since Vite handles CSS bundling separately).

Add to your deployment script:

Configuration

Configuration in config/icecube.php:

SCSS Import Paths (Optional)

To use SCSS imports like @import './_base.scss', configure in your service provider:

Dynamic Components (HTMX/AJAX)

Components work seamlessly with dynamic content loading:

The icecube.js runtime automatically initializes dynamically added components.

Multiple Compiler Configurations

Configure multiple compilers for different component sets in config/icecube.php:

Compilers are automatically registered in the Laravel container as icecube.compiler.{name} singletons.

Compile All:

Compile Specific:

The IceCubeServiceProvider automatically:

Component API

Props System

Public properties are automatically passed to client-side:

Refs System

Use data_ref() to mark elements for easy client-side access:

Component Parameters

Style Scoping

SCSS Support

To use SCSS, configure the compiler with ScssStyleCompiler:

Then use SCSS syntax in your components:

File Structure

Best Practices

  1. Component Organization: Keep components in a dedicated directory (e.g., app/Components)
  2. Naming Convention: Use PascalCase for component class names and files
  3. Separation of Concerns: For complex JavaScript, use separate .js files
  4. Style Scoping: Prefer scoped styles; use global styles sparingly
  5. Props Validation: Validate and type-hint public properties
  6. Production Builds: Always pre-compile and cache components in production
  7. Asset Strategy: Choose between embedded styles or Vite based on your build setup

License

MIT License


All versions of icecube with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
icetea/icedom Version ^1.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package icetea/icecube contains the following files

Loading the files please wait ...