embroider-build / embroider

Compiling Ember apps into spec-compliant, modern Javascript.
MIT License
334 stars 136 forks source link

Deprecations in TemplateResolver #2031

Closed jrjohnson closed 1 month ago

jrjohnson commented 2 months ago

When upgrading to Ember 5.9 we're seeing a huge number of deprecation messages in our build sourced in glimmer-vm and triggered here in packages/compat/src/resolver-transform.ts (in several places) when staticHelpers is enabled.

DEPRECATION: The this property on path nodes is deprecated, use head.type instead
DEPRECATION: The parts property on path nodes is deprecated, use head and tail instead
DEPRECATION: The this property on path nodes is deprecated, use head.type instead
...

Reproduction:

ember new test-app --pnpm
cd test-app
pnpm add -D @embroider/core @embroider/compat @embroider/webpack webpack

Enable embroider and static helpers in ember-cli-build.js

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const { Webpack } = require('@embroider/webpack');

module.exports = function (defaults) {
  const app = new EmberApp(defaults, {
    // Add options here
  });

  return require('@embroider/compat').compatBuild(app, Webpack, {
    staticHelpers: true,
  });
};
pnpm build

> test-app@0.0.0 build
> ember build --environment=production

Environment: production
DEPRECATION: The this property on path nodes is deprecated, use head.type instead
DEPRECATION: The parts property on path nodes is deprecated, use head and tail instead
mkszepp commented 2 months ago

I think its related to this comment https://github.com/embroider-build/embroider/pull/1967#issuecomment-2207031045

We need only to create a PR agaist stable to fix this

mkszepp commented 1 month ago

We can close this.. PR is merged and released

jrjohnson commented 1 month ago

Thanks @mkszepp!