
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@jay-framework/editor-client
Advanced tools
Socket.io client implementation for editor applications to connect to Jay dev servers.
This package provides a Socket.io client that can be used by editor applications to connect to Jay dev servers and perform real-time operations. It includes:
import { createEditorClient } from '@jay-framework/editor-client';
// Create the editor client
const client = createEditorClient({
portRange: [3101, 3200],
scanTimeout: 5000,
retryAttempts: 3,
editorId: 'my-editor-123',
});
// Connect to the dev server
await client.connect();
// Publish a jay-html file
const result = await client.publish({
type: 'publish',
pages: [
{
route: '/pages',
jayHtml: '<div>Hello World</div>',
name: 'home',
},
],
});
console.log('Published:', result.status[0].filePath);
import {
createEditorClientWithConnectionManager,
createConnectionManager,
} from '@jay-framework/editor-client';
// Create a custom connection manager
const connectionManager = createConnectionManager({
portRange: [3101, 3200],
autoReconnect: true,
reconnectDelay: 1000,
maxReconnectAttempts: 5,
});
// Create editor client with the connection manager
const client = createEditorClientWithConnectionManager(connectionManager);
// Connect and handle state changes
await client.connect();
client.onConnectionStateChange((state) => {
console.log('Connection state:', state);
});
// Use protocol methods
const imageResult = await client.saveImage({
type: 'saveImage',
imageId: 'my-image',
imageData:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==',
});
console.log('Image saved:', imageResult.imageUrl);
id
, timestamp
, and payload
fieldsThe package follows a clean separation of concerns:
EditorProtocol
interfaceAll messages use a wrapper structure:
interface ProtocolMessage {
id: string;
timestamp: number;
payload: {
type: 'publish' | 'saveImage' | 'hasImage';
// ... message-specific fields
};
}
interface ConnectionManagerOptions {
portRange?: [number, number]; // Default: [3101, 3200]
scanTimeout?: number; // Default: 5000ms
retryAttempts?: number; // Default: 3
editorId?: string; // Auto-generated UUID if not provided
autoReconnect?: boolean; // Default: true
reconnectDelay?: number; // Default: 1000ms
maxReconnectAttempts?: number; // Default: 5
}
Comprehensive test suite including:
This package is designed to be used by any editor application that needs to communicate with Jay dev servers, such as:
interface EditorClientOptions extends ConnectionManagerOptions { // Additional editor-specific options can be added here }
## Integration with Editor Applications
This package is designed to be used by any editor application that needs to communicate with Jay dev servers, such as:
- Figma plugins
- Web-based editors
- Desktop applications
- Browser extensions
FAQs
Unknown package
We found that @jay-framework/editor-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.