Skip to content

v5.0.0

Latest

Choose a tag to compare

@nvxdm nvxdm released this 06 Mar 18:56
· 2 commits to main since this release

Breaking Changes

  • Version scheme: Major version now matches Strapi major version. Jumped from 2.x to 5.0.0 to align with Strapi 5.
  • Replaced lodash-es with micromustache: Template syntax for option labels changed from lodash templates (<%= field %>) to mustache-style ({{ field }}). Supports dot-path access for nested properties (e.g., {{ address.city }}).
  • Search placeholder changed: The {q} placeholder in URLs/bodies is now {{ q }}, consistent with the mustache template syntax used everywhere else.

Added

  • Presets system: Define reusable fetch configurations in config/plugins.js under remote-select.presets. Presets encapsulate URL, method, headers, body, and mapping — so content editors just pick a preset name instead of configuring each field manually.
    • New GET /remote-select/presets endpoint returns available preset names.
    • Preset selector dropdown in the admin field configuration UI (auto-populated from server config). Falls back to a free-text input if presets can't be loaded.
    • Server-side preset resolution with variable and search substitution.
    • New PresetFetchOptionsSchema yup validation for preset-based requests.
  • RemoteSelectPluginOptions type export from the server entry point, allowing typed plugin configuration in consumer projects.
  • fetchPresetNames utility: Synchronous XHR call during admin plugin registration to load preset names for the field configuration UI.

Changed

  • Refactored OptionsProxyService: Complete rewrite. Now handles both custom and preset configs, with clearer separation of concerns (variable substitution, header parsing, option label/value extraction, deduplication).
  • Refactored admin components (RemoteSelect.tsx, SearchableRemoteSelect.tsx): Both now build request bodies conditionally based on whether a preset or custom config is used. Searchable select delegates {{ q }} substitution to the server for presets.
  • Replaced lodash-es debounce in SearchableRemoteSelect with a simple setTimeout/clearTimeout pattern, removing the lodash-es dependency entirely.
  • Improved validation schema: RemoteSelectFetchOptions.schema.ts now validates method field and includes search parameter. Added separate PresetFetchOptionsSchema for preset-based requests.
  • Updated getRemoteSelectRegisterOptions: Now accepts presetNames parameter to dynamically build the preset selector. Added "Configuration preset" section to the field settings UI.
  • Cleaned up dependencies: Removed lodash-es and @types/lodash-es. Added micromustache as a runtime dependency.
  • Server config default now includes presets: {} alongside variables: {}.
  • Updated README.md: Documentation reflects new template syntax, preset system, and updated configuration examples.

Removed

  • lodash-es dependency: Replaced entirely by micromustache for templates and native setTimeout for debounce.
  • server/src/services/service.ts: Removed unused legacy service file.