Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Next.js] [BYOC] Component Builder integration endpoint #1729

Merged
merged 11 commits into from
Feb 8, 2024

Conversation

illiakovalenko
Copy link
Contributor

@illiakovalenko illiakovalenko commented Feb 7, 2024

Description / Motivation

Added a new endpoint to enable Component Builder to work with BYOC components registered in a JSS application

  • The FEAASRenderMiddleware ( /api/editing/feaas/render) will

    1. Enable Next.js Preview Mode.
    2. Redirect to the /feaas/render page.

NOTE: Handles Vercel protection bypass, custom server url etc.

If "src" query parameter is provided, the page will render a FEAAS component.
The page provides all the registered FEAAS components

  • The FEAASRender (/feaas/render) page is responsible for

    1. Rendering the FEAAS component if the "feaasSrc" is provided.
    2. Rendering all the registered components.
    3. The page is rendered only if it's requested by the api route (/api/editing/feaas/render) using the preview mode.
  • Introduced a common RenderMiddleware

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@illiakovalenko illiakovalenko requested a review from a team February 7, 2024 16:51
Copy link
Contributor

@ambrauer ambrauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! See some comments

Copy link
Contributor

@ambrauer ambrauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
One last thought is if we want to include this under "editing" or not. Maybe we should do "/api/feaas/render" (or "/api/feaas/preview") instead and leave "editing" dedicated to our Pages/EE editing integration?
Although you are using the "editing" debug namespace so would probably need to switch that.
I could be convinced either way :)

@illiakovalenko illiakovalenko merged commit c4ccad3 into dev Feb 8, 2024
1 check was pending
@illiakovalenko illiakovalenko deleted the feature/JSS-1041 branch February 8, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants