Open tjcrowder opened 6 years ago
Cross-linking we also have a request for this in the core Marko repo: https://github.com/marko-js/marko/issues/785
Tigt: Does eBay have official browser support somewhere? I assume Marko's browser support lines up with it
DylanPiercey: https://github.com/eBay/browserslist-config
Tigt: thank you
Tigt: https://github.com/eBay/browserslist-config/commit/0a7df835a87915b5f298cdd57868a78bf6bddbfe
Tigt: this is a more aggressive than I would have guessed, but no IE11 is no IE11
DylanPiercey: There was much rejoicing
Tigt: for Marko itself, I'll probably have to add a note that the VDOM runtime doesn't support IE11, but the server-generated HTML has no such problems
Tigt: What's the best way to add client-side JS to a Marko-rendered page for browsers unsupported by the builtin hydration code?
Tigt: I forget if there's a way to attach arbitrary functions to a component without invoking Marko overhead or not
DylanPiercey: I'm not sure what you mean by that
Tigt: okay, so, when using component-browser.js or state, it attaches JS to a component inside the normal Marko lifecycle
Tigt: in cases where the builtin Marko lifecycle code doesn't support the current browser, is there a way to attach JS to a component that doesn't need it?
DylanPiercey: I don't believe so.
DylanPiercey: I mean you can write out manual script tags, or just include some global script fallback jquery style, but otherwise no.
Tigt: "an exercise for the reader", got it
DylanPiercey: Probably just use progressive enhancement would be the real answer.
Tigt: right, it's just sometimes progressive enhancement can be more granular than JS vs. no-JS
Tigt: if you want a Print this page button, you shouldn't have to take that away from IE users
DylanPiercey: Yeah. We're not very optimized for that.
Tigt: I guess in that case you'd do <button onclick="print()">
but not sure how you'd do that with CSP in the way
Tigt: I'll write that it's possible but you'll have to figure it out
DylanPiercey:
<button id:scoped="btn">...
<script>
document.getElementById("${component.elId("btn")}").onclick = () => print();
</script>
Tigt: oh neat
Tigt: would that get the out.global.cspNonce applied?
DylanPiercey: yeah, I think it does.
DylanPiercey: Don't quote me on it, but if it doesn't it'd be easy to fix.
Tigt: if not, it's only <script nonce=out.global.cspNonce>
away
DylanPiercey: Yeah
DylanPiercey: Also we have a (currently undocumented) out.script which appends to the next script Marko will flush.
So you could do:
<button id:scoped="btn">...
$ out.script(`document.getElementById("${component.elId("btn")}").onclick = () => print();`);
DylanPiercey: But probably we don't want to recommend that. Tigt: any particular reason why? DylanPiercey: out is going away in Marko 6 DylanPiercey: Well, we'll support a subset of things on out, eg out.global, but it'll be deprecated.
Marko looks cool!
Please add a browser compatibility list or statement somewhere in the docs, ideally in the introduction. https://markojs.com/ doesn't (currently?) work on IE11, so I went looking to see if Marko does, and some time later I think the answer is "yes" but A) It took some time to get there, and B) I'm not sure that's true. :-D
src/components/ready.js
in Marko's source has a comment about doing a DOM ready check on Internet Explorer, and Marko issue #796 seemed to be IE-specific and got fixed the same day it was reported (impressive!) (and the person reporting the issue said most of their users are on IE11). So that suggests that there's at least some support for IE11, but is it limited? Are the particular things to avoid?Why
When evaluating a framework of this sort, one of the first questions I and others ask is "What browsers / browser versions are supported?"
Is this something you're interested in working on?
If someone wants to give me the raw info, I'm happy to do some wordsmithing and a PR.