HubSpot / hubspot-cli

A CLI for HubSpot
https://developers.hubspot.com
Other
153 stars 57 forks source link

HS Theme Preview - Global Module Issue #1124

Closed dev6Minded closed 1 month ago

dev6Minded commented 1 month ago

Description and Context

I noticed an issue with the "hs theme preview", when I up and run the example page which contains the global module (with modified settings in the global editor) - the data is missing - it looks like HS doesn't fetch the data but instead serves the ones defined from the fileds.json file (Created discussion https://community.hubspot.com/t5/CMS-Development/HS-Theme-Preview-Global-Module-Issue/td-p/1025021)

The most interesting thing is that when I use a global partial containing non-global modules (but HS treats them as global), everything works fine and I can see the updated data.

CLI: 5.2.0

  1. Create a theme
  2. Create/use a page with a D&D area
  3. Create a module and set it as a global module
  4. Add into module native filed like RichText, Simple menu, etc
  5. Add this module to a page
  6. Edit this module in the global content editor (add example text, menu items etc)
  7. Save the global module, save and publish the page, and open the created page in a browser
  8. Run command: hs theme preview
  9. Open the page in the local env
  10. Open a local preview of the created page

In local mode, I'm not able to see data set up in step 6

Expected behavior

I want to see the changes that were made

Screenshots

image image image

Page preview (normal and local):

image

jsines commented 1 month ago

Hey there thanks for reporting! This is a problem we're aware of internally and is actually a symptom of a broader issue we're trying to solve around the friction between local rendering of themes & modules in pages and the content that's set for them in the different editors. As-is, we're forced to make a trade-off here between either making changes to global modules within a theme visible when locally rendered (how it is currently), or having that global content shown within the local renders (which would block local changes from showing through). So this is a somewhat intentional choice to preserve the ability to make and preview changes to a theme's global modules while we work toward a better solution that covers both use cases.

Unfortunately that means it may be a bit of time before this works the way you would expect, but it's something that's definitely on our radar and we intend to support more fully down the road. For now I'll close this out, but link it in our internal issue tracking for this project to keep a record of the interest for this feature. Thanks again for filing an issue! 😄