Custom Element upgrade NPM packages demo

Опубликовано: 13 Январь 2021
на канале: A shot of code
167
8

In this web devleopment tutorial we look to upgrade our ScrollToTop Custom Element. It needs the Lit-Element, PikaWeb (to Snowpack )and Typescript packages updated. So we walk through from extracting the project from Github to performing these upgrades and then committing the changes back into Github.

The LitElement upgrade has one breaking change which is that the decorators are no longer in the main package, so we need to import from the distinct decorators module.

SnowPack was quite straightforward just needed to remove all the PikaWeb references in the package.json. Then change our script import in index.html to be of type module and to reference the .JS extension rather than the .TS extension

Typescript was a simple update from V3 to V4 - just needed to change the version in the package.json to allow us to upgrade the major version. We specified a '*' here for the version to allow this to take place.

The upgrade for Typescript we found by using the npm 'outdated' command.

Next up will look to progress the Snowpack upgrade so that it uses the SkyPack CDN and we go NPM less!


Смотрите видео Custom Element upgrade NPM packages demo онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь A shot of code 13 Январь 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 167 раз и оно понравилось 8 людям.