Flow: Remove legacy stuff from DndUtil

Created on 5 Mar 2020  路  6Comments  路  Source: vaadin/flow

A couple of things noticed in the DndUtil class:

  1. public static final String DND_CONNECTOR_COMPATIBILITY = "frontend://dndConnector.js";
  2. private static final String MOBILE_DND_POLYFILL_URL = "context://webjars/mobile-drag-drop/2.3.0-rc.1/index.min.js";
  3. private static final String VAADIN_MOBILE_DND_POLYFILL_URL = "context://webjars/vaadin__vaadin-mobile-drag-drop/1.0.0/index.min.js";
High Major bug

All 6 comments

This is a completely different case compared to the regular Bower webjars that were deprecated with Vaadin 14.

  1. This is an npm webjar and not a bower webjar
  2. The file is loaded from the regular webjars/ URL rather than our custom handler for frontend/bower_components/
  3. The file is intended to be loaded on demand as a standalone file rather than being inlined into the application bundle

If we were to change this to be installed through package.json instead of pom.xml, we would then also have to add some additional webpack configuration to make it available as a standalone file instead of being inlined in the main bundle. My gut feeling is that the additional complexity would not be worthwhile. The situation changes slightly if we ever implement proper support for code splitting @JsModule dependencies.

I think the original forum post could have been included here - as it had the context to the issue and logs about what might be going wrong. IIRC it said that something tried to load "frontend://dndConnector.js" and that a) should not happen and b) cannot work Flow 3 onwards.

The constant DND_CONNECTOR_COMPATIBILITY should be removed and not used at all as it is for ES5 browsers, that are not supported starting from v15. As Leif says, the mobile dnd polyfill is a different thing, and I don't think it had anything to do with the error the user had.

Attaching the original Forum post here https://vaadin.com/forum/thread/18129338/migrating-from-vaadin-14-to-vaddin-15-0-0.

As Pekka mentioned, the initial motivation for this ticket was to remove DND_CONNECTOR_COMPATIBILITY. I saw some suspicious webjars there, had the wrong assumption that they are also some legacy stuff that could be removed.

After Updating to Vaadin 15.0.4 the error is not shown at the page but it is still shown in the console:

frontend://dndConnector.js:1 Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME

Hi @Tonne-TM, thanks for the feedback, I just checked the source code, there is no more frontend://dndConnector.js in the source code. Have you tried to clean the project? delete node_modules, package.json, package-lock.json, target etc.

Hi @Tonne-TM, thanks for the feedback, I just checked the source code, there is no more frontend://dndConnector.js in the source code. Have you tried to clean the project? delete node_modules, package.json, package-lock.json, target etc.

Thanks, i forgot to do that! (problem solved)

Was this page helpful?
0 / 5 - 0 ratings