lookbook-hq / lookbook

A UI development environment for Ruby on Rails apps ✨
https://lookbook.build
MIT License
913 stars 94 forks source link

DataResolver is a little noisy on application startup #458

Closed agrobbin closed 1 year ago

agrobbin commented 1 year ago

Describe the bug

I'm not sure when this started happening, but I recently noticed some output on application startup (across seemingly all environments) from Lookbook. For each parameter with Ruby code in it:

# @param size [Symbol] select {{ UI::CardComponent::SIZES.keys }}

We're seeing this output in our application startup logs, coming from DataResolver#evaluate:

Data cannot be evaluated (Input: 'UI::CardComponent::SIZES.keys ')

To Reproduce

Write a component preview with a parameter that has evaluated Ruby, then start the server!

Expected behavior

There should be no output on application startup.

Version numbers

Please complete the following information:

allmarkedup commented 1 year ago

Thanks @agrobbin, good spot - it's due to a change I made in the 2.0.2 release that has resulted in some up-front data resolving happening that shouldn't be. Will get a fix up and out in the next release 👍

allmarkedup commented 1 year ago

Okay this should be fixed now in #468 - will go out in the next release if everything looks okay :-)

agrobbin commented 1 year ago

Great, thanks for the quick resolution @allmarkedup!

allmarkedup commented 1 year ago

I've just released the fix for this in 2.0.3 so I'm going to go ahead and close this down now. Thanks for bringing it to my attention @agrobbin :-)

agrobbin commented 1 year ago

Much quieter, thanks @allmarkedup!