←back to thread

392 points _kush | 3 comments | | HN request time: 1.664s | source
Show context
fergie ◴[] No.44394408[source]
What is this "XSLT works natively in the browser" sourcery? The last time I used XSLT was like 20 years ago- but I used it A LOT, FOR YEARS. In those days you needed a massive wobbly tower of enterprise Java to make it work which sort of detracted from the elegance of XSLT itself. But if XSLT actually works in the browser- has the holy grail of host-anywhere static templating actually been sitting under our noses this whole time?
replies(10): >>44394475 #>>44394896 #>>44395079 #>>44395141 #>>44395223 #>>44395594 #>>44396076 #>>44396139 #>>44397002 #>>44399078 #
rsolva ◴[] No.44394896[source]
Browsers support XSLT v1.0 only, and from what I understand, there has been talk of depricating it.

I would rather that they introduced support for v3, as that would make it easier to serving static webpages with native support for templating.

replies(1): >>44394990 #
smartmic ◴[] No.44394990[source]
I'm also more concerned about depreciation risk. However, you can still do a lot with XSLT 1.0. There is also SaxonJS, which allows you to run XSLT 3.0. However, embedding JavaScript to use XSLT defeats the purpose of this exercise.
replies(1): >>44398562 #
1. imtringued ◴[] No.44398562[source]
It doesn't really defeat the purpose. It just shows how much fuss about avoiding JS is a sign of insisting on ideological purity rather than accomplishing any particular goal.

What exactly is the difference between generating HTML using the browser's XLST 1.0 runtime and SaxonJS's XLST 3.0 runtime? Before you say the goal is to not have to deal with JS, then you've already accomplished that goal. You don't need to touch NPM, webpack, React, JSX, etc.

Blocking first party JS is lunacy by the way.

replies(2): >>44398824 #>>44399271 #
2. rsolva ◴[] No.44398824[source]
I speak only for my self, but I greatly value having no dependencies or build processes. Just put the files on a web server and have it run for the next 20 years.

It might not scale for larger businesses, but for regular people on the web who just want to put something out in the world and have minimal churn keeping it up, it can have great value!

3. ndriscoll ◴[] No.44399271[source]
> What exactly is the difference between generating HTML using the browser's XLST 1.0 runtime and SaxonJS's XLST 3.0 runtime?

Several hundred kB (compressed) of runtime, for one. It could make sense for browsers to have something like that built-in like they did with pdf.js, though Saxon is proprietary so it would not be that thing.