eBay / nice-form-react

A meta based form builder for React.
http://opensource.ebay.com/nice-form-react/
MIT License
33 stars 3 forks source link

Made the examples self contained #5

Closed leroydev closed 6 months ago

leroydev commented 6 months ago

Closes #4. Also makes all the examples lazy loaded. This should speed up first load speed of the examples website but should be tested whether this works properly in a production build too. Locally for me with a production build served with http-server it did work.

supnate commented 6 months ago

Hi @leroydev , thank you very much for deep dive into code and propose optimization!

However, adapter is designed to be a global config. Just like you need to config global providers for redux, some UI libs, etc. So using nice form consists of two parts, one for config and the other is real usage.

leroydev commented 6 months ago

Hi @supnate, thanks for taking the time to review quickly! What do you think about adding a comment above the example code that adds the adapters, that mentions this should only be done globally but is done within the example to make them self-contained? Then you have the best of both worlds, users can more quickly setup an example locally to play around with it and it is clear to them that the adapters is supposed to be global configuration.

If not, I do feel that including the definition of the custom datepicker in each example does add value. Otherwise the user will be searching for a bit and would have to run into the one example that does have that code in it.

And the lazy loading should make the docs faster to load so might also be an improvement you want to consider.

Let me know which parts you want in what form and I'll make adjustments 🙂

supnate commented 6 months ago

Thanks @leroydev .

  1. The get started section in readme should help users to know how to configure nice form. Examples mainly shows different scenarios of usage.
  2. For widget definition, we think it's usually configured globally for common widgets to avoid duplicated code. But I agree adding a doc link would be helpful.
  3. Lazy load for examples code is good change 👍
leroydev commented 6 months ago

Closed in favor of #6