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

Migration to native javascript classes - remove the @classic decorator #909

Open
svogt0511 opened this issue Nov 12, 2024 · 0 comments
Open
Assignees

Comments

@svogt0511
Copy link
Contributor

svogt0511 commented Nov 12, 2024

After running the ember upgrade command, on 'yarn start', then on page display, there are complaints that look like they are caused by using the @classic decorator. We need to remove the @classic decorator from all classes and instead use native javascript classes, which is part of the 'classic' => 'octane' migration, and I think was ok up until ember 5.0. Complaints such as:

yarn start
yarn run v1.22.22
$ ./node_modules/.bin/ember serve
WARNING: Ember CLI v5.0.0 is not tested against Node v20.18.0. See "https://github.com/ember-cli/ember-cli/blob/master/docs/node-support.md" to find out which version of Node is best to use.
⠏ building... [ember-auto-import-analyzer]Warning: ignoring input sourcemap for vendor/fake-xml-http-request/fake_xml_http_request.js because ENOENT: no such file or directory, open '/tmp/broccoli-3255127G1cOSL94pLSz/out-753-broccoli_debug_debug_6_vendor_js/vendor/fake-xml-http-request/fake_xml_http_request.js.map'
Build successful (24272ms) – Serving on http://localhost:4200/
Slowest Nodes (totalTime >= 5%)                                                           | Total (avg)           
------------------------------------------------------------------------------------------+-----------------------
ember-auto-import-webpack (1)                                                             | 16618ms               
App is being served by FastBoot
/tmp/broccoli-3255127G1cOSL94pLSz/out-789-broccoli_merge_trees/assets/vendor.js:60884
  IS_PERMA_CLASSIC.set(_Ember.Location, false);
                   ^
TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at /tmp/broccoli-3255127G1cOSL94pLSz/out-789-broccoli_merge_trees/assets/vendor/classic-decorator/index.js:25:1
    at /tmp/broccoli-3255127G1cOSL94pLSz/out-789-broccoli_merge_trees/assets/vendor/classic-decorator/index.js:191:1
    at Script.runInContext (node:vm:149:12)
    at Sandbox.runScript (/home/suzanne/__WORK_WHIRLWIND/DATACITE/git/bracco/node_modules/fastboot/src/sandbox.js:57:12)
    at EmberApp.buildApp (/home/suzanne/__WORK_WHIRLWIND/DATACITE/git/bracco/node_modules/fastboot/src/ember-app.js:162:15)
    at /home/suzanne/__WORK_WHIRLWIND/DATACITE/git/bracco/node_modules/fastboot/src/ember-app.js:143:22
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at EmberApp.getNewApplicationInstance (/home/suzanne/__WORK_WHIRLWIND/DATACITE/git/bracco/node_modules/fastboot/src/ember-app.js:213:17)
    at EmberApp._visit (/home/suzanne/__WORK_WHIRLWIND/DATACITE/git/bracco/node_modules/fastboot/src/ember-app.js:244:9)
    at EmberApp.visit (/home/suzanne/__WORK_WHIRLWIND/DATACITE/git/bracco/node_modules/fastboot/src/ember-app.js:329:7)
    at FastBoot.visit (/home/suzanne/__WORK_WHIRLWIND/DATACITE/git/bracco/node_modules/fastboot/src/index.js:86:18)
    at /home/suzanne/__WORK_WHIRLWIND/DATACITE/git/bracco/node_modules/fastboot-express-middleware/src/index.js:33:20

seem to be caused by the @classic decorator. 2 things to do to get past this:

  • Make sure all classes are native javascript
  • Update the linter and run it to help verify all classes have been converted to native javascript.

Resources:

Also see the Technical Spec and Implementation Notes.

@svogt0511 svogt0511 self-assigned this Nov 12, 2024
@svogt0511 svogt0511 changed the title Debug the Build/Runtime - remove the classic decorator Migration to native javascript classes - remove the classic decorator Nov 18, 2024
@svogt0511 svogt0511 changed the title Migration to native javascript classes - remove the classic decorator Migration to native javascript classes - remove the @classic decorator Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant