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

[sitecore-jss-angular] Fix Editing Scripts component rendered twice in pages #1948

Merged
merged 5 commits into from
Oct 11, 2024

Conversation

yavorsk
Copy link
Contributor

@yavorsk yavorsk commented Oct 11, 2024

Description / Motivation

This PR fixes issue where editing scripts are rendered twice (for server and client) in pages edit mode metadata - by rendering the scripts only on the server.

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate) - setup local app as rendering host for pages, and make sure client editing scripts are rendered only once in the markup and there is no 'duplicate modules' error in the browser console

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)

@yavorsk yavorsk requested a review from a team October 11, 2024 12:16
@stasmaxymov
Copy link
Contributor

@yavorsk Is there a way to run Angular in full SPA mode, without server-side rendering? If yes, the fix might not work with it

@yavorsk
Copy link
Contributor Author

yavorsk commented Oct 11, 2024

hey @stasmaxymov , yea I was also thinking about this. In editing mode we always have SSR and since we are rendering these scripts for editing mode only anyway I guess it should be fine

Copy link
Contributor

@art-alexeyenko art-alexeyenko left a comment

Choose a reason for hiding this comment

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

This looks good, thank you Yavor.
One thing I'd change is having to set a spy in each test - I'll adjust this in a moment.

@art-alexeyenko art-alexeyenko merged commit ae03d91 into dev Oct 11, 2024
1 check passed
@art-alexeyenko art-alexeyenko deleted the feature/JSS-4297 branch October 11, 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