Parcel: Deprecation warning when using posthtml

Created on 22 Aug 2018  ยท  4Comments  ยท  Source: parcel-bundler/parcel

โ” Question

When using the posthtml transforms via .posthtmlrc, I get a deprecation warning.

๐Ÿ’ป Code Sample

.posthtmlrc
using posthtml-include 1.2.0

{
  "plugins": {
    "posthtml-include": {
      "root": "./src/library/"
    }
  }
}

will throw (multiple times):

โ ‹ Building...addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.

๐ŸŒ Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.7
| Node | 10.7.0
| npm/Yarn | 6.3.0 / 1.9.2
| Operating System | macOS 10.13.6

Question

Most helpful comment

@gregorybolkenstijn it's only deprecated within webpack.
It will stay inside parcel untill it gives compatibility issues with other tools, than we will deprecate it slowly if there is an alternative to it.

All 4 comments

I think it's because Parcel uses addDependencyTo for compatibility reasons, see: https://github.com/parcel-bundler/parcel/blob/master/src/transforms/posthtml.js#L41-L48
PR that added that configuration: https://github.com/parcel-bundler/parcel/pull/1355

@bre7 Does that mean it will be gone in a future release?

@gregorybolkenstijn it's only deprecated within webpack.
It will stay inside parcel untill it gives compatibility issues with other tools, than we will deprecate it slowly if there is an alternative to it.

@DeMoorJasper Is it possible to reopen this? This outputs a bunch of errors into my console every time Parcel builds my source, and it stops Parcel from repainting the console.

Server running at http://localhost:7777
โ ‹ Building...addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
โœจ  Built in 776ms.
addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
โ ‹ Building...addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
โ ‹ Building...addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
โ ‹ Building...addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
addDependencyTo is deprecated in favor of
result.messages.dependency; posthtml-loader >= v1.0.1 will
automatically add your imported files to webpack's file watcher.
โœจ  Built in 18ms.
Was this page helpful?
0 / 5 - 0 ratings