Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.13 Canary | Regression Tracking #9639

Open
runspired opened this issue Jan 16, 2025 · 17 comments
Open

4.13 Canary | Regression Tracking #9639

runspired opened this issue Jan 16, 2025 · 17 comments

Comments

@runspired
Copy link
Contributor

runspired commented Jan 16, 2025

WONTFIX

  • transforms now come from a public instead of private import location
  • setConfig is required if not using the ember-data package
  • extending @ember-data/store instead of ember-data/store now requires full configuration
  • super in hooks in classes extending @ember-data/store no longer works
  • model._notifyProperties has been removed
  • cache is stricter:
    • You must include an 'id' for the resource data ${resource.type}
    • Missing Resource Type: received resource data with a type '${resource.type}' but no schema could be found with that name.
  • mutating an attribute on a record by setting it directly will now generate a change notification for that attribute. Previously, because attr is implemented as a computed prop we were relying on it managing its own value and not emitting the notification. This caused bugs for other consumers of the change (inspector, references, schema-record) and so we no longer swallow this notification.
    • this can have the unexpected effect of causing tracked functions and cached getters which create new records to recompute if the attribute which is mutated was originally set inside the tracked function or cached getter, as it will be subscribed to this change.
  • Backports fix for deleteRecord does not set hasDirtyAttributes to true #9053
  • the private APIs belongsToReference.belongsToRelationship and hasManyReference.hasManyRelationship have been removed.
  • There appears to be a subtle timing change around notifying the identity and state of a new record as it is saved.

MAYBEFIX

  • adapter.useFetch is assigned in a new way, resulting in the getter approach in app adapters not working. fields approach works e.g. useFetch = false.
  • isRelationship and isAttribute on field meta is no longer present. These were meant to be private and not part of the spec, but some apps may have discovered and made use of them.
  • key on field meta is no longer present, this was a private reflection of name and name should be used instead.
  • relationship graph uses the passed in arrays from operations that update remote state for perf, this exposes them to accidental mutation later. We should consider freezing and/or slicing these arrays in debug as this is mostly an issue with tests using mirage.
    • This can result in Relationship state sometimes storing non-stable identifiers
  • hasMany relationships will notify any time they receive an updated payload even if the state is exactly the same due to the fix in # for ensuring we notify for potential re-ordering. (feb6e5a#diff-6bf06ca7b029990de472c9fae36ea1e7e074b8e3d8ddfaf87edc2b5eb41e5d76R154)
  • existing notification bug where we will notify attribute keys that aren't in the schema (e.g. due to the API returning keys that aren't in the schema which is really common in Mirage) can lead to over-notification issues now that we subscribe to these notifications in the Request component.
  • if you call createRecord in a test expecting a re-render, you need to await settled

TO FIX

  • deprecated registerSchema does not setup schema in a way that avoids the store attempting to call createSchemaService
  • getSchemaDefinitionService only checks for schemas registered with registerSchema
  • receiving a new request with the same id as the original request in the request component can error because the second request will be backgrounded and we don't account for that in the request validation. Error is The `request` passed to `RequestManager.request(<request>)` was empty (`{}`). Requests need at least one valid key.
  • Error: this.warnMessageNoModelForKey is not a function #9611 (affects both 5.x and 4.13)

FIXED

  • ember-inflector support initializer needs to be backported
@nickschot
Copy link

nickschot commented Feb 21, 2025

Trying out 4.13-alpha.4 (upgraded from latest 4.12) I ran into what appears to be an inflection issue.

Did anything change in that area, or am I missing something else?

Model definition with @belongsTo('media', { inverse: null, async: true }) media; with a model named media.js now throws Error: No model was found for 'medium' and no schema handles the type at runtime.

It's set up with the inflector as: Inflector.inflector.uncountable('media', 'media');

@runspired
Copy link
Contributor Author

runspired commented Feb 21, 2025

@nickschot great find! in 5.x we deprecated support for ember-inflector. 5.x deprecations are activateable in 4.13 but off-by-design since they would be new deprecations.

To manage that deprecation, we automatically intercept inflections from ember-inflector and add them to our own inflection library.

That interception logic in ember-data may not be setup right in 4.13, or you may be assembling the packages yourself (as opposed to using ember-data) in which case the interception needs to be explicitly installed in your app. I'll look into the former.

Sidenote: the check if (macroCondition(dependencySatisfies('ember-inflector', '*'))) { will fail if ember-inflector is not installed by your app as a direct dependency iirc.

@nickschot
Copy link

nickschot commented Feb 21, 2025

Some quick answers to that & a bit more context:

EDIT:

  • After manually importing deprecation-support in an initializer it seems to work, so looks like it might just be that import missing somewhere.

@runspired
Copy link
Contributor Author

Thanks! I'll get that initializer backported :)

@gitKrystan
Copy link
Contributor

@nickschot Can you try the latest 4.13 canary? It should have the initializer fix.

@nickschot
Copy link

@nickschot Can you try the latest 4.13 canary? It should have the initializer fix.

Most of our test suite seems to pass on CI, but the initializer fix doesn't seem to work when running tests through localhost:4200/tests.

I also had to make sure to have all the proper @ember-data & @warp-drive packages available in the top level node_modules (did a quick fix with a public hoist for testing).

There's also some other issues, but I have to dig into those more to see if that's just caused by the test setup.

@runspired
Copy link
Contributor Author

the initializer fix doesn't seem to work when running tests

via any mechanism or just when launching that way?

available in the top level node_modules

because typescript? or because you build with embroider which disallows the transitive dependency and thus things like import Model from '@ember-data/model'; don't "just work" anymore?

@nickschot
Copy link

nickschot commented Mar 11, 2025

the initializer fix doesn't seem to work when running tests

via any mechanism or just when launching that way?

available in the top level node_modules

because typescript? or because you build with embroider which disallows the transitive dependency and thus things like import Model from '@ember-data/model'; don't "just work" anymore?

As discussed in chat: breaks on visiting /tests but works on CI with prebuilt app (environment=test) + ember-exam

In addition @warp-drive/build-config currently needs to be hoisted/added to deps. From chat:

TLDR we need to ensure app re-exports are exported out of library code so that build config is processed correctly

@LuisMacedoKantar
Copy link

I just updated from 4.13.0-alpha.4 to 4.13.0-alpha.5, and now I’m getting an error related to Webpack and ember-auto-import. If I remove the setConfig from ember-cli-build and use the legacy emberData key, everything works fine again, though I get a warning to use setConfig.

@warp-drive/build-config is hoisted.

  - name: Error
  - nodeAnnotation: ember-auto-import-webpack
  - nodeName: WebpackBundler
  - originalErrorMessage: webpack returned errors to ember-auto-import
  - stack: Error: webpack returned errors to ember-auto-import

@runspired
Copy link
Contributor Author

@LuisMacedoKantar is there a log of what the error is anywhere?

@LuisMacedoKantar
Copy link

Yes @runspired

ERROR Summary:

  • broccoliBuilderErrorStack: Error: webpack returned errors to ember-auto-import
    at /home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/webpack.js:541:32
    at finalCallback (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:500:32)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:578:17
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/HookWebpackError.js:67:2
    at Hook.eval [as callAsync] (eval at create (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/Hook.js:18:14)
    at Cache.storeBuildDependencies (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Cache.js:126:37)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:574:19
    at Hook.eval [as callAsync] (eval at create (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/Hook.js:18:14)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:570:23
    at Compiler.emitRecords (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:1046:4)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:560:11
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:1009:14
    at Hook.eval [as callAsync] (eval at create (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/Hook.js:18:14)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:1006:27
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/neo-async/async.js:2818:7
    at done (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/neo-async/async.js:3522:9)
    at Hook.eval [as callAsync] (eval at create (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:835:33
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/graceful-fs/graceful-fs.js:143:16
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/graceful-fs/graceful-fs.js:61:14
    at FSReqCallback.oncomplete (node:fs:192:23)
  • code: [undefined]
  • codeFrame: webpack returned errors to ember-auto-import
  • errorMessage: webpack returned errors to ember-auto-import
    at WebpackBundler (ember-auto-import-webpack)
    -- created here: --
    at new Plugin (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/broccoli-plugin/dist/index.js:47:36)
    at new WebpackBundler (/home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/webpack.js:115:9)
    at AutoImport.makeBundler (/home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/auto-import.js:153:16)
    at AutoImport.addTo (/home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/auto-import.js:171:56)
    at Class.postprocessTree (/home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/index.js:53:55)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25
    at Array.reduce ()
    at addonProcessTree (/home/abc/xxx/cba/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
    at EmberApp.addonPostprocessTree (/home/abc/xxx/cba/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ember-cli/lib/broccoli/ember-app.js:606:12)
    at EmberApp.toTree (/home/abc/xxx/cba/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ember-cli/lib/broccoli/ember-app.js:1331:17)
    -- (end) --
  • errorType: Build Error
  • location:
    • column: [undefined]
    • file: [undefined]
    • line: [undefined]
    • treeDir: [undefined]
  • message: webpack returned errors to ember-auto-import
    at WebpackBundler (ember-auto-import-webpack)
    -- created here: --
    at new Plugin (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/broccoli-plugin/dist/index.js:47:36)
    at new WebpackBundler (/home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/webpack.js:115:9)
    at AutoImport.makeBundler (/home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/auto-import.js:153:16)
    at AutoImport.addTo (/home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/auto-import.js:171:56)
    at Class.postprocessTree (/home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/index.js:53:55)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25
    at Array.reduce ()
    at addonProcessTree (/home/abc/xxx/cba/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
    at EmberApp.addonPostprocessTree (/home/abc/xxx/cba/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ember-cli/lib/broccoli/ember-app.js:606:12)
    at EmberApp.toTree (/home/abc/xxx/cba/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ember-cli/lib/broccoli/ember-app.js:1331:17)
    -- (end) --
  • name: Error
  • nodeAnnotation: ember-auto-import-webpack
  • nodeName: WebpackBundler
  • originalErrorMessage: webpack returned errors to ember-auto-import
  • stack: Error: webpack returned errors to ember-auto-import
    at /home/abc/xxx/cba/node_modules/.pnpm/ember-auto-import@2.10.0_@glint[email protected][email protected]/node_modules/ember-auto-import/js/webpack.js:541:32
    at finalCallback (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:500:32)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:578:17
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/HookWebpackError.js:67:2
    at Hook.eval [as callAsync] (eval at create (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/Hook.js:18:14)
    at Cache.storeBuildDependencies (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Cache.js:126:37)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:574:19
    at Hook.eval [as callAsync] (eval at create (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/Hook.js:18:14)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:570:23
    at Compiler.emitRecords (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:1046:4)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:560:11
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:1009:14
    at Hook.eval [as callAsync] (eval at create (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/Hook.js:18:14)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:1006:27
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/neo-async/async.js:2818:7
    at done (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/neo-async/async.js:3522:9)
    at Hook.eval [as callAsync] (eval at create (/home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/Compiler.js:835:33
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/graceful-fs/graceful-fs.js:143:16
    at /home/abc/xxx/cba/node_modules/.pnpm/[email protected]/node_modules/graceful-fs/graceful-fs.js:61:14
    at FSReqCallback.oncomplete (node:fs:192:23)

@LuisMacedoKantar
Copy link

@runspired, I just updated to the new version 4.13.0-alpha.6 and also the new warpdrive/build-config 0.0.2, and everything seems to be working now with the setConfig.

@BoussonKarel
Copy link
Contributor

BoussonKarel commented Mar 24, 2025

post.comments.splice(0) does not seem to work correctly on a hasMany array?
It removes one item instead of clearing the whole array.
post.comments.splice(0, post.comments.length) does work

@BoussonKarel
Copy link
Contributor

I had some inflector rules in an initializer:

import Inflector from 'ember-inflector';

export function initialize(/* application */) {
  const inflector = Inflector.inflector;
  inflector.uncountable('price-quote-extra-services');
}

export default {
  name: 'custom-inflector-rules',
  initialize,
};

But this threw errors in my test app where I defined that model:

Image

Image

I ended up just throwing away ember-inflector and used @ember-data/request-utils/string, which was fine for me, but still, a regression.

@runspired
Copy link
Contributor Author

runspired commented Mar 24, 2025

@BoussonKarel see item: ember-inflector support initializer needs to be backported

that said I think if you are on latest 4.13 this has now been done, though @nickschot mentioned it seems the initializer fix only works in the app, not in tests ... which is pretty odd.

@nickschot
Copy link

nickschot commented Mar 24, 2025

@BoussonKarel see item: ember-inflector support initializer needs to be backported

that said I think if you are on latest 4.13 this has now been done, though @nickschot mentioned it seems the initializer fix only works in the app, not in tests ... which is pretty odd.

Yeah seemed like a potential ordering issue. Not entirely clear. Setting up the inflections in app.js works fine for all scenarios as far as i could see.

edit: I've only tried that with ember-inflector v5+ (so v2 addon version).

@BoussonKarel
Copy link
Contributor

that said I think if you are on latest 4.13 this has now been done, though @nickschot mentioned it seems the initializer fix only works in the app, not in tests ... which is pretty odd.

I am on the latest version (4.13.0-alpha.6). The inflections were defined in an initializer and the models were added in a test.

@runspired runspired pinned this issue Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: needs triage
Development

No branches or pull requests

5 participants