-
Notifications
You must be signed in to change notification settings - Fork 25
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
Refactor: latex and qrcode pipes #2530
Draft
chrismclarke
wants to merge
30
commits into
master
Choose a base branch
from
refactor/shared-pipes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Change how reports our output to include parent `data:[]` field. This improves ability to generate type definitions for reports (not manipulated prior to writing to disk)
github-actions
bot
added
scripts
Work on backend scripts and devops
maintenance
Core updates, refactoring and code quality improvements
labels
Nov 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
maintenance
Core updates, refactoring and code quality improvements
scripts
Work on backend scripts and devops
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
TODO
Description
Refactor
latex
andqrcode
pipes to instead be called from their corresponding components.Review Notes
Confirm qrcode and latex example component sheets working as expected (looks correct to me)
Dev Notes
As there are currently no other components that attempt to parse qrcode or latex values it makes sense to keep the code component-specific, and hence will be able to tree-shake in/out during an optimised build depending on component use.
I've moved the latex code to a util file so that if other components did want to implement latex they could still call the method (which would by default also be included in optimised build whenever the component is, without the need to define any implicit dependencies due to the direct import).
I haven't refactors the
markdown
pipe as it is currently in use by both button and text component which are included in every build regardless of optimisation (so will break the pipe for any build that tries to remove). It's also used by tile and simple checkbox components.In the future likely the best way to remove would probably be some sort of parameter_list setting to specify
format: markdown
, which can be parsed in the template service before providing the value at the component level. We could then use report analysis to see if authors ever use, and remove formatter as necessary. Would likely also want to include a global option to enable by default on all components (if desirable). But all this is quite overkill for now, so just sticking to the easier-to-manage pipes.Git Issues
Closes #
Screenshots/Videos
Build Analysis - qrcode and katex dependencies no longer appearing when compared to #2520 snapshot of plh_kids_kw build. Core bundle reduced additional 300kb/~10%