Skip to content

Conversation

pamelafox
Copy link
Collaborator

@pamelafox pamelafox commented Aug 30, 2024

Purpose

With upcoming changes potentially adding JS (#1790), I wanted to make sure we didn't have any unneeded JS. I used the rollup-plugin-visualizer to visualize the current package sizes:
Screenshot 2024-08-30 at 11 44 00 AM

I realized that the syntax highlighter was bringing in all languages which added a ton to our overall size. I've adjusted it to only bring in the language we need, JSON.

Now its footprint is much smaller:

Screenshot 2024-08-30 at 11 51 26 AM

This brings app/backend/static to ~13M, down from 16M.

Does this introduce a breaking change?

When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.

[ ] Yes
[X] No

Does this require changes to learn.microsoft.com docs?

This repository is referenced by this tutorial
which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial,
check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.

[ ] Yes
[X] No

Type of change

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[X] Other... Please describe: Performance

Code quality checklist

See CONTRIBUTING.md for more details.

  • The current tests all pass (python -m pytest).
  • I added tests that prove my fix is effective or that my feature works
  • I ran python -m pytest --cov to verify 100% coverage of added lines
  • I ran python -m mypy to check for type errors
  • I either used the pre-commit hooks or ran ruff and black manually on my code.

@pamelafox pamelafox changed the title Reduce JS size Reduce JS size by using more specific import for react-syntax-highlighter Aug 30, 2024
@pamelafox pamelafox merged commit cd2dcd2 into Azure-Samples:main Aug 30, 2024
10 checks passed
@pamelafox pamelafox deleted the syntax branch August 30, 2024 19:18
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.

1 participant