marko-js / marko

A declarative, HTML-based language that makes building web apps fun
https://markojs.com/
MIT License
13.35k stars 643 forks source link

Unexpected deprecation warnings #1438

Closed xtremespb closed 4 years ago

xtremespb commented 4 years ago

Marko Version: 4.18.17

Details

When building my project with Webpack, I've started getting the deprecated messages from Marko.

A short investigation have shown me that there's a probable bug in taglib-loader/Tag.js.

If I downgrade to marko@4.18.16, the error is gone. So that's something what's related to 4.18.17.

Expected Behavior

No deprecation errors in console because there's nothing deprecated in my code or templates yet.

Actual Behavior

When building with Webpack, I get the following errors:

` WARNING!! @key property is deprecated at C:\Users\xtrem\Documents\Git\zoia2\node_modules\marko\src\core-tags\components\marko.json

WARNING!! The default "targetProperty" for "@" attribute definitions is changing from "" to "null" (merged in with the rest of the input) in a future Marko release. In order to avoid an issue upgrading, please explicitly define the "targetProperty". at C:\Users\xtrem\Documents\Git\zoia2\node_modules\marko\src\core-tags\migrate\marko.json `

For targetProperty, it's because of this attr:

Attribute {
  name: '*',
  type: 'string',
  required: false,
  allowExpressions: true,
  setFlag: null,
  pattern: null,
  removeDashes: true,
  filePath: 'C:\\Users\\xtrem\\Documents\\Git\\zoia2\\node_modules\\marko\\src\\core-tags\\migrate\\marko.json'
}

For @key, it's because of this:

Attribute {
  name: 'key',
  type: 'string',
  required: false,
  allowExpressions: true,
  setFlag: null,
  pattern: null,
  preserveName: true,
  autocomplete: [
    {
      displayText: 'key="<name>"',
      snippet: 'key="${1:name}"',
      description: 'Used to identify loop interations and to reference the rendered tag within the component class.',
      descriptionMoreURL: 'https://markojs.com/docs/conditionals-and-lists/#always-set-a-key'
    }
  ],
  filePath: 'C:\\Users\\xtrem\\Documents\\Git\\zoia2\\node_modules\\marko\\src\\core-tags\\components\\marko.json'
}

Possible Fix

I'm not sure, but probably we need to update Tag.js or marko\src\core-tags\components\marko.json?

Your Environment

Windows 10 Node 12.10.0

https://github.com/xtremespb/zoia2

Steps to Reproduce

You will see the errors I've described above in console.

xtremespb commented 4 years ago

I want to highlight the fact that if I downgrade to marko@4.18.16, the error is gone. So that's a bug of a new version (4.18.17).

The temporary solution is to downgrade ;-)

xtremespb commented 4 years ago

After an update to the new version (4.18.18), the same error appears:

NOTICE
The module [marko] is using deprecated features.
Run with process.env.SHOW_MODULE_COMPLAINS=1 to see all warnings.
xtremespb commented 4 years ago

Same for 4.18.23. Am I the only one who experiencing such kind of issues?

DylanPiercey commented 4 years ago

Sorry for the delay. It looks like this is a Windows specific issue that snuck through. I've created https://github.com/marko-js/marko/pull/1448 which should resolve the issue.

mlrawlings commented 4 years ago

Fixed in marko@4.18.24