trame-client is the internal JavaScript core of the trame framework, providing client-side infrastructure for web applications. It handles connections to a trame server, state synchronization, method calls, dynamic component loading, and template feeding in the browser. It is typically installed as a dependency of the main 'trame' package and is not intended for direct end-user Python interaction. The current version is 3.11.4, and it follows the release cadence of the trame ecosystem.
pip install trame-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic Trame application, which implicitly uses `trame-client` for its client-side functionality. Since `trame-client` is an internal dependency, end-users typically interact with Trame through its main API and widgets. Run this Python script and navigate to the displayed URL in your browser.
Explicitly set `server.client_type = 'vue2'` in your Trame application if you need to maintain compatibility with Vue 2 components. For new development or migration, embrace Vue 3 and its compatible widgets.
Ensure you explicitly install any required trame widget libraries (e.g., `pip install trame-vuetify trame-vtk`) in your project's dependencies if your application uses them.
Avoid attempting to import directly from `trame_client` in your Python application code. Instead, use the `trame` API (e.g., `from trame.app import get_server`, `from trame.widgets import html`).
Ensure that the Trame server is fully started and its WebSocket endpoint is ready before making the application accessible to users (e.g., deferring Nginx startup until the Trame server responds successfully). Consider implementing client-side retries or automatic page refreshes if the WebSocket connection fails initially.
Ensure your trame Python application is running (e.g., `server.start()`), verify the server's host and port, check local firewall settings, and confirm no other process is occupying the specified port.
Define the missing property in the trame `state` dictionary (e.g., `state.myVariable = 'initial_value'`) or register the method using appropriate trame decorators or functions in your Python script.
Verify that the component is correctly registered in your trame Python application using `html.client.set_component`, `html.client.load_script`, or `html.client.load_style`, and that its definition is available to the client.