<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to override a Web UI component without having to update all it&amp;apos;s references? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323769#M10770</link>
    <description>&lt;P&gt;I see in your example that you're replacing the &amp;lt;link&amp;gt; references and the href attribute in nuxeo-layout, but in my case what would I replace? The whole nuxeo-app.html file and add the import there? If I just add the html import in my *custom-bundle.html it will throw the customElementRegistry error&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2019 22:38:26 GMT</pubDate>
    <dc:creator>a_c</dc:creator>
    <dc:date>2019-12-19T22:38:26Z</dc:date>
    <item>
      <title>How to override a Web UI component without having to update all it&amp;apos;s references?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323765#M10766</link>
      <description>&lt;P&gt;Hello community&lt;/P&gt;
&lt;P&gt;I need to change the way the &lt;CODE&gt;&amp;lt;nuxeo-user-avatar&amp;gt;&lt;/CODE&gt; returns the user's initials, which is a simple javascript function.
The problem is, I would need to override all the references in other components throughout the application as well, like the &lt;CODE&gt;&amp;lt;nuxeo-user-tag&amp;gt;&lt;/CODE&gt; component, or  the &lt;CODE&gt;&amp;lt;nuxeo-user-group-formatter&amp;gt;&lt;/CODE&gt;, which would also have to be overriden and have their references changed  in the &lt;CODE&gt;nuxeo-app.html&lt;/CODE&gt; file or the &lt;CODE&gt;elements.html&lt;/CODE&gt; file, and so on.&lt;/P&gt;
&lt;P&gt;It snowballs to a bunch of other components which I'd also have to override just for a simple function!&lt;/P&gt;
&lt;P&gt;Since web components cannot be redefined or unregistered, is there any better way to change the behavior of a component without having to override all the other components that use it?
How can I keep using the same component and only change the logic I need?
Or how to tell the component to use a different function with my custom logic at runtime?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;
This is the xml contribution file I would use to override the component:&lt;/P&gt;

&lt;COMPONENT name="mx.gob.ssa.avatar" version="1.0.0"&gt;
    &lt;REQUIRE&gt;org.nuxeo.web.ui.resources&lt;/REQUIRE&gt;
    &lt;EXTENSION target="org.nuxeo.ecm.platform.WebResources" point="resources"&gt;
        &lt;RESOURCE name="custom-avatar" type="import" shrinkable="false"&gt;
            &lt;URI&gt;/ui/custom-user-avatar.html&lt;/URI&gt;
        &lt;/RESOURCE&gt;
    &lt;/EXTENSION&gt;
    &lt;EXTENSION target="org.nuxeo.ecm.platform.WebResources" point="bundles"&gt;
        &lt;BUNDLE name="web-ui"&gt;
            &lt;RESOURCES append="true"&gt;
                &lt;RESOURCE&gt;custom-avatar&lt;/RESOURCE&gt;
            &lt;/RESOURCES&gt;
        &lt;/BUNDLE&gt;
    &lt;/EXTENSION&gt;
&lt;/COMPONENT&gt;</description>
      <pubDate>Thu, 19 Dec 2019 17:44:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323765#M10766</guid>
      <dc:creator>a_c</dc:creator>
      <dc:date>2019-12-19T17:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to override a Web UI component without having to update all it&amp;apos;s references?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323766#M10767</link>
      <description>&lt;P&gt;Have you tried to duplicate the source code of the element (&lt;A href="https://github.com/nuxeo/nuxeo-ui-elements/blob/maintenance-2.4.x/widgets/nuxeo-user-avatar.html"&gt;https://github.com/nuxeo/nuxeo-ui-elements/blob/maintenance-2.4.x/widgets/nuxeo-user-avatar.html&lt;/A&gt;
) and copy it into your Nuxeo Studio Designer Project, make your updates and reference it in your custom bundle file?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 20:31:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323766#M10767</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2019-12-19T20:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to override a Web UI component without having to update all it&amp;apos;s references?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323767#M10768</link>
      <description>&lt;P&gt;You mean the xml contribution file? I edited my question to show my contribution.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 21:17:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323767#M10768</guid>
      <dc:creator>a_c</dc:creator>
      <dc:date>2019-12-19T21:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to override a Web UI component without having to update all it&amp;apos;s references?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323768#M10769</link>
      <description>&lt;P&gt;Hello, I'm making a reference to what is done to extend the user profile for exemple&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 21:42:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323768#M10769</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2019-12-19T21:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to override a Web UI component without having to update all it&amp;apos;s references?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323769#M10770</link>
      <description>&lt;P&gt;I see in your example that you're replacing the &amp;lt;link&amp;gt; references and the href attribute in nuxeo-layout, but in my case what would I replace? The whole nuxeo-app.html file and add the import there? If I just add the html import in my *custom-bundle.html it will throw the customElementRegistry error&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 22:38:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323769#M10770</guid>
      <dc:creator>a_c</dc:creator>
      <dc:date>2019-12-19T22:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to override a Web UI component without having to update all it&amp;apos;s references?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323770#M10771</link>
      <description>&lt;P&gt;I asked the same question a few weeks ago and the answer from the Nuxeo team was that it's not possible without overriding the massive 80k LOC nuxeo-app.html file.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 16:54:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323770#M10771</guid>
      <dc:creator>Benjamin_Gamard</dc:creator>
      <dc:date>2019-12-24T16:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to override a Web UI component without having to update all it&amp;apos;s references?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323771#M10772</link>
      <description>&lt;P&gt;I see, it is I as I feared. Could you share a link to the question please?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 16:57:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323771#M10772</guid>
      <dc:creator>a_c</dc:creator>
      <dc:date>2019-12-24T16:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to override a Web UI component without having to update all it&amp;apos;s references?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323772#M10773</link>
      <description>&lt;P&gt;Here it is https&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 17:01:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323772#M10773</guid>
      <dc:creator>Benjamin_Gamard</dc:creator>
      <dc:date>2019-12-24T17:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to override a Web UI component without having to update all it&amp;apos;s references?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323773#M10774</link>
      <description>&lt;P&gt;There is no way to do it today (at least not until we have import maps support). This can’t be supported as we might need to break the API and we can’t ensure your override implements the API we need. Solutions to address this that we’d like to propose once we can do so:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;import maps (&lt;A href="https://www.chromestatus.com/feature/5315286962012160"&gt;https://www.chromestatus.com/feature/5315286962012160&lt;/A&gt; )&lt;/LI&gt;
&lt;LI&gt;custom npm deps (you fork nuxeo-elements and reference your fork instead)&lt;/LI&gt;
&lt;LI&gt;source overlay
Essentially you can override any source file of Web UI or it’s deps during the build (we take those files and override the local fs before doing a build)
Finally, about the “This is the xml contribution file I would use to override the component:” the answer is “Where we’re going we don’t need/want no XML contribution” (due back to the future reference. The Webresource component thing and the wro4j resource processors only apply to resources managed by Nuxeo and we’re moving to a static / custom deployment of Web UI (already have an image with nginx deployment). Also we’re not planning to support any runtime procesing of resources (ig “magic” is to happen it’ll happen at build time)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Sun, 05 Jan 2020 09:04:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-override-a-web-ui-component-without-having-to-update-all/m-p/323773#M10774</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2020-01-05T09:04:18Z</dc:date>
    </item>
  </channel>
</rss>

