Would like a public URL for the storybook using cl_server.
However, currently, this project is focused on Storybook for the development (local) environment.
Using it in a development environment requires disabling all caches on the component rendering endpoint. This is necessary to allow hot reloading when working locally.

The following is required for the cl_server storybook to work:
- Permission to use the CL Server endpoint set to Anonymous user
- The following needs to be set in services.yml

parameters:
  twig.config:
    debug: true
    cache: false
  cors.config:
    enabled: true
    allowedHeaders: ['*']
    allowedMethods: ['*']
    allowedOrigins: ['*']
    exposedHeaders: false
    maxAge: false
    supportsCredentials: true
services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory

No ideal to disable the cache on production environments.

Issue fork cl_server-3385428

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

AndySipple created an issue. See original summary.

andysipple’s picture

Issue summary: View changes
andysipple’s picture

Issue summary: View changes
paulsheldrake’s picture

I think there is the potential deal with this on the storybookJS side. Have made a feature request in the https://github.com/Lullabot/storybook-drupal-addon/issues/42 package

We could then leave all the Drupal stuff as is and compile a static version locally or through a build process without having to get funky with settings and config.

agarzola’s picture

That is a good feature request on its own, but I think being able to use cl_server in production would still be helpful for anyone who wants to be able to render components with arbitrary data (e.g. à la Storybook controls) in production.

e0ipso’s picture

Title: Can we make development mode optional? » Make development mode optional and secure for production use

e0ipso’s picture

Status: Active » Needs review
e0ipso’s picture

e0ipso’s picture

Status: Needs review » Reviewed & tested by the community

Merging.

  • e0ipso committed 39c7e93b on 2.x
    Issue #3385428 by e0ipso, AndySipple, agarzola, paulsheldrake: Make...
e0ipso’s picture

Status: Reviewed & tested by the community » Fixed
e0ipso’s picture

//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support to this project makes my volunteer contributions more sustainable.
There are multiple ways to show appreciation for the work I did in this project, those include:
  • Triaging issues, and adding more context to existing issues.
  • Writing documentation, or patches for this project.
  • Writing blog posts, speaking about it at conferences.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.