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

.pre-process-main.pl can be simplified or rolled into Wattsi #234

Closed
domenic opened this issue Jun 5, 2020 · 2 comments · Fixed by #285
Closed

.pre-process-main.pl can be simplified or rolled into Wattsi #234

domenic opened this issue Jun 5, 2020 · 2 comments · Fixed by #285

Comments

@domenic
Copy link
Member

domenic commented Jun 5, 2020

I'm idly investigating if we can simplify html-build by removing the Perl scripts. Here's at least one piece of low-hanging fruit.

If you run

HTML_SOURCE=html HTML_CACHE=.cache perl .pre-process-main.pl < html/source > .temp/source-expanded-1

and diff the results, there are only three transformations actually performed:

  • Replacing <!--REPRESENTS article--> and friends in https://html.spec.whatwg.org/#usage-summary-2 with the values defined elsewhere in the document
  • Replacing <!--BOILERPLATE cldr.inc --> and friends with some files from the build process
  • Replacing <pre>EXAMPLE offline/clock/clock.appcache</pre> and friends with their contents from the demos/ folder.

All the stuff in parserExpander and its sub-function expand appear to be unused.

I think we should add a facility to Wattsi to do arbitrary file insertions, e.g. <!--INSERTFILE filename-->. Then we can eliminate the <!--BOILERPLATE x--> and <pre>EXAMPLE x</pre> specializations of this from the Perl script and leave it doing only the more complicated <!--REPRESENTS --> business.

The REPRESENTS thing is part of a more general class of problems (basically, substituting text or HTML from one part of the spec into another) that we could try to tackle in Wattsi as a separate effort, after we've done the easier stuff.

@sideshowbarker
Copy link
Contributor

👍 yeah, all looks doable — and getting rid of the Perl dependency would be a nice win

@domenic
Copy link
Member Author

domenic commented Sep 21, 2020

One thing I realized is that, unless this is done in a failure-tolerant way (which seems subpar), then this would probably break wattsi-server and thus PR preview :-/.

domenic added a commit that referenced this issue Sep 21, 2020
sideshowbarker pushed a commit that referenced this issue Sep 22, 2020
domenic added a commit that referenced this issue Oct 23, 2023
They were replaced by Rust versions in 188742d. Now that the --remote build is available, we should not keep these two code paths around.

Closes #234.
domenic added a commit that referenced this issue Oct 23, 2023
They were replaced by Rust versions in 188742d. Now that the --remote build is available, we should not keep these two code paths around.

Closes #234.
domenic added a commit that referenced this issue Oct 24, 2023
They were replaced by Rust versions in 188742d. Now that the --remote build is available, we should not keep these two code paths around.

Closes #234.
domenic added a commit that referenced this issue Oct 24, 2023
They were replaced by Rust versions in 24db54a. Now that the --remote build is available, we should not keep these two code paths around.

Closes #234.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants