decentraland / creator-hub

MIT License
0 stars 4 forks source link

Clear error messages when importing an SDK6 library on an SDK7 project #164

Open nearnshaw opened 1 year ago

nearnshaw commented 1 year ago

When a user tries to import a library that is made for SDK6, we should display a human readable error message warning that this library they are trying to import is not compatible with this version of the SDK. The library names don't explicitly state what SDK version they are for, and it will likely become a common mistake to install the wrong one. Today, the error messages they will see will likely reference invalid syntax, which will be confusing to someone not familiar with the syntax changes across versions.

All SDK6 libraries include decentralnad-ecs as a dependency in the package.json, so the best way would be to check for that, and assume any library with that dependency is not compatible with an SDK7 project.

The error message should not assume that the user knows that decentraland-ecs == SDK6 and @dcl/sdk == SDK7

The ideal place to display this error is when attempting to import the library via the editor. If that's too complicated, it may be ok to display in console when attempting to run a preview or build.