-
Notifications
You must be signed in to change notification settings - Fork 62
HTML Projector #1812
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
HTML Projector #1812
Conversation
|
Very fun! I am having some issues using variables (I guess we have to use literals?). Also, I noticed this file had some pretty poor performance (maybe due to complicated types?) Eventually we would like this use modules, is that correct? |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #1812 +/- ##
==========================================
- Coverage 50.37% 50.23% -0.14%
==========================================
Files 230 232 +2
Lines 25368 25484 +116
==========================================
+ Hits 12780 12803 +23
- Misses 12588 12681 +93
🚀 New features to boost your workflow:
|
|
@gcrois yah I can make it so you can use externally defined variables in the handler, it's just more work since there's now an ambiguity about which value of the externally defined variables to use, i.e. if your HTML literal is in a function body and uses the function parameter. so in fully generality would need a closure selector, which currently only exists for the probe projector, but will be factored out of that at some point so it can apply to any projector. the performance issue is due to a dev bug |
# Conflicts: # src/haz3lcore/projectors/ProjectorCore.re # src/haz3lcore/projectors/ProjectorInit.re # src/language/term/Typ.re
|
Subsumed by #2115 |
This adds a minimal HTML/DOM ADT and associated projector, porting over the code from the old LLM branch. This might be usable to @gcrois to accelerate livelit work, or might be worth merging separately if we can resolve a few issues.
This intentionally supports a very limited subset of tags and attributes, and does css styles entirely via strings. More can be added straightforwardly going forward, but if we want to add many more we need to think about how to handle lexically larger types for display; at it stands, these already affect perf for the value display and the context inspector.
This also supports a couple handlers; the provided handler should do a functional update of the entire HTML value. This isn't very ergonomic, but can in principle be used to do some fun things; the example in the screenshot strips the element style when clicked. This also just uses the lexical syntax of the handler at the moment, so only built-in functions will work. This isn't an inherent limitation, but I didn't want to add a closure picker at the moment.
TODO: