Code Monkey home page Code Monkey logo

Comments (9)

radix avatar radix commented on June 18, 2024
  1. Verified on firefox as well
  2. I think I've traced it down as far as dommy.template.__GT_document_fragment(document.body) failing, but it's really hard for me to debug it further as I'm not very familiar with protocols and cljs yet.

Unfortunately neither chrome nor firefox are giving a traceback for this error, so it's really hard to track down.

from dommy.

jeluard avatar jeluard commented on June 18, 2024

This might be due to how Polymer handle specially body as opposed to other elements. You probably won't have any issue with other selections (at least I don't here).

body normally has to be manually wrapped, see faq.

from dommy.

radix avatar radix commented on June 18, 2024

Sorry I never got back to you on this issue. So, the question is, whose responsibility is this incompatibility? Should Dommy work around it, or should this be filed as a bug against Polymer? Do you have any opinions on that?

from dommy.

jeluard avatar jeluard commented on June 18, 2024

Good question. I don't think polymer will fix that as it's a deliberate trade-off for performance reason (I believe). On the other hand dommycan't reasonably implement a work around specific to polymer.

I guess your best option is not to use dommy to select document.body and relies on good old DOM:

(dommy/append! js/document.body "foo")

from dommy.

cpetzold avatar cpetzold commented on June 18, 2024

Hmm, not sure why you're getting that issue as (sel1 :body) should just be expanding to js/document.body: https://github.com/Prismatic/dommy/blob/master/src/dommy/macros.clj#L70

from dommy.

cpetzold avatar cpetzold commented on June 18, 2024

Ah sorry, I re-read your initial comment.. the issue is in append!, not sel1: https://github.com/Prismatic/dommy/blob/master/src/dommy/core.cljs#L74

The parent node in append! gets "coerced" to a node with template/->node-like. I wonder if it would be better if it was assumed that the parent is a valid dom node, instead of being looser. I'm not sure if anyone is taking advantage of it anyways..

from dommy.

jeluard avatar jeluard commented on June 18, 2024

I believe this might help understanding the issue.
One theory could be that dommy somehow installs its own properties to a polymer wrapped element then later on access the non-wrapped version.

from dommy.

jeluard avatar jeluard commented on June 18, 2024

FYI I got this issue and fixed it by using (.querySelector js/document "body") to select the body.

I don't think there is any other option when using polymer's polyfill as using document.body is not supported.

from dommy.

cpetzold avatar cpetzold commented on June 18, 2024

Dommy no longer coerces nodes (see #85), and @jeluard's fix (using the native querySelector for body) seems reasonable for use with polymer.

from dommy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.