[2.0.0-rc1] Compatibility with XB

Created on 1 December 2024, 21 days ago

Problem/Motivation

Following πŸ› [2.0.0-beta2] plugin.manager.sdc conflict with Experience Builder Active we can now test UI Patterns 2 with Experience Builder (XB). Careful: in Decmeber 2024, XB is still in early dev and very unstable, so the results may change from day to day.

Using XB components in UIP2

XB's json-schema-definitions stream wrapper is not triggered by UI Patterns 2. Normally, it must be done automatically by the JSON Schema library, without any actions on our side, but let's check.

sounds crazy, but XB is also providing some SDC components, but most of them are not using the attributes variable in templates. Unfortunately, there is nothing to do on out side.

Using UIP2 components in WB

Let's investigate this error:
ValueError: "" is not a valid backing value for enum Drupal\experience_builder\JsonSchemaInterpreter\SdcPropJsonSchemaType in Drupal\experience_builder\JsonSchemaInterpreter\SdcPropJsonSchemaType::from() (line 131 of /src/PropShape/PropShape.php).

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @pdureau
  • πŸ‡«πŸ‡·France pdureau Paris
  • πŸ‡«πŸ‡·France just_like_good_vibes PARIS

    i just gave a test with a fresh 11.1.0 drupal and the last experience_builder from dev branch.

    i did not receive the mentioned errors.
    i managed to check the UI and almost nothing worked. My components were appearing but they are still in such an early stage, it seems difficult to check anything yet.

  • πŸ‡«πŸ‡·France pdureau Paris

    No error? That s'great news. I will check again.

    By the way, I know they are still very early stage, and I don't expect the builder to work properly, I just want the 2 JSON schema resolvers ($ref: ui-patterns:// and $ref: json-schema-definitions://) to work well together.

  • πŸ‡«πŸ‡·France pdureau Paris

    No, it doesn't work.

    Using XB components in UIP2

    • I install both ui_patterns_library and experience_builder
    • I got to /admin/appearance/ui/components/experience_builder/shoe_button
    • icon prop has this unknown prop type: {"$ref":"json-schema-definitions:\/\/experience_builder.module\/shoe-icon","type":"object"}

    According to https://git.drupalcode.org/project/experience_builder/-/blob/0.x/schema.... the expected resolved json schema must be

    title: Icon
    type: object
    properties:
      name:
        type: string
        title: Name
        default: primary
        enum:
        - moon-stars-fill
        - moon-stars
        - star-fill
        - star
        - stars
        - rocket-fill
        - rocket-takeoff-fill
        - rocket-takeoff
        - rocket
    

    Which will be loaded as Enum prop by UIP2.

    So, what is happening? Why the JSON schema reference is not resolved?

    • It is broken on Experience Builder side?
    • Is it broken because of having XB & UIP2 together?

    Using UIP2 components in WB

    I was not able to test because XB is currently broken:

    Symfony\Component\Routing\Exception\RouteNotFoundException: Route "experience_builder.experience_builder" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 211 of core/lib/Drupal/Core/Routing/RouteProvider.php).

    Let's try later.

  • πŸ‡«πŸ‡·France pdureau Paris
  • πŸ‡©πŸ‡ͺGermany Christian.wiedemann

    christian.wiedemann β†’ made their first commit to this issue’s fork.

  • πŸ‡«πŸ‡·France pdureau Paris

    Using XB components in UIP2

    The issue was on UIP2 side. Fixed by Christian in https://git.drupalcode.org/issue/ui_patterns-3490873/-/commit/51c4ea3e22...

    But he needs to add some tests.

    Using UIP2 components in WB

    We are not able to test because XB is currently broken (not the same bug as yesterday...). Let's wait a bit and pull again.

  • πŸ‡«πŸ‡·France pdureau Paris
  • Merge request !310Add support for β†’ (Open) created by Christian.wiedemann
  • Pipeline finished with Canceled
    2 days ago
    Total: 86s
    #375031
  • Pipeline finished with Failed
    2 days ago
    Total: 570s
    #375033
  • πŸ‡«πŸ‡·France pdureau Paris

    Today, we decided to merge this issue because the Using XB components in UIP2 fix is enough for RC1 (after adding some tests, right?).

    About Using UIP2 components in WB:

    • It seems XB is not resvolving $ref: ui-patterns:// but it may not resolved "$ref":"json-schema-definitions: either, so let's wait they implement a working reference resolver
    • when both XB and UIP2 are installed, XB is raising errors, so our component plugin manager decorators may not be fully compatible
    • XB is not loading UIP2 components (!) but is loading the ui_patterns_blocks's blocks twice, because of our (UIP2) context management; we derivate blocks twice, one with entity context and one without

    Let's create a 2.1.0 issue.

Production build 0.71.5 2024