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

feat(ember-simple-auth): implement internal EventTarget #2887

Merged
merged 1 commit into from
Dec 28, 2024

Conversation

BobrImperator
Copy link
Collaborator

@BobrImperator BobrImperator commented Dec 28, 2024

  • Reimplements Remove Evented mixin. Use native EventTarget.  #2875
    The previous PR removed Evented mixin that was used by the classes directly - which is a nice improvement and allows full conversion to native classes.
  • Changes test app to refer to ember-simple-auth as workspace:* instead of a version.
  • Refactors ember runloop inline bind when providing methods to event listeners, to decorating methods directly

Unfortunately extending from the native EventTarget such as class MyClass extends EventTarget fails under fastboot and presumably when typescript's involved too. The #2875 seemed to work fine unless typescript was involved.
The issue isn't related to the typescript-event-target package that was introduced instead of Evented.

Maybe our Fastboot & Typescript herald @mansona would know more?

Some error details after running pnpm -F test-app test:one ember-4.0 on exp branch which still contains changes from #2875 and introduces Typescript to a test-app project.
master...exp

Built project successfully. Stored in "/tmp/tests-dist-20241128-528226-paejhx.luctg".
webpack://ember_auto_import/../ember-simple-auth/dist/index-B7bj3ruc.js?:5
var e=class extends EventTarget{dispatchTypedEvent(s,t){return super.dispatchEvent(t);}};
^

ReferenceError: EventTarget is not defined
at eval (webpack://ember_auto_import/../ember-simple-auth/dist/index-B7bj3ruc.js?:5:7)
at Module.../ember-simple-auth/dist/index-B7bj3ruc.js (/tmp/tests-dist-20241128-528226-paejhx.luctg/assets/chunk.tmp_broccoli-528226IU5dTQgKbam2_cache-370-webpack_bundler_ember_auto_import_webpack_app_cjs-t-c22a03.d212ee7a3f9e690f2962.js:84:1)
at webpack_require (/tmp/tests-dist-20241128-528226-paejhx.luctg/assets/chunk.app.77ba3811edadbb926032.js:164:42)
at eval (webpack://ember_auto_import/../ember-simple-auth/dist/session-stores/base.js?:8:76)
at Module.../ember-simple-auth/dist/session-stores/base.js (/tmp/tests-dist-20241128-528226-paejhx.luctg/assets/chunk.tmp_broccoli-528226IU5dTQgKbam2_cache-370-webpack_bundler_ember_auto_import_webpack_app_cjs-t-c22a03.d212ee7a3f9e690f2962.js:139:1)
at webpack_require (/tmp/tests-dist-20241128-528226-paejhx.luctg/assets/chunk.app.77ba3811edadbb926032.js:164:42)
at eval (webpack://ember_auto_import/../ember-simple-auth/dist/session-stores/ephemeral.js?:6:66)
at Module.../ember-simple-auth/dist/session-stores/ephemeral.js (/tmp/tests-dist-20241128-528226-paejhx.luctg/assets/chunk.tmp_broccoli-528226IU5dTQgKbam2_cache-370-webpack_bundler_ember_auto_import_webpack_app_cjs-t-c22a03.d212ee7a3f9e690f2962.js:161:1)
at webpack_require (/tmp/tests-dist-20241128-528226-paejhx.luctg/assets/chunk.app.77ba3811edadbb926032.js:164:42)
at eval (webpack://ember_auto_import/../ember-simple-auth/dist/initializers/setup-session.js?:15:86)
at Module.../ember-simple-auth/dist/initializers/setup-session.js (/tmp/tests-dist-20241128-528226-paejhx.luctg/assets/chunk.tmp_broccoli-528226IU5dTQgKbam2_cache-370-webpack_bundler_ember_auto_import_webpack_app_cjs-t-c22a03.d212ee7a3f9e690f2962.js:106:1)

@BobrImperator BobrImperator force-pushed the implement-our-event-target branch 4 times, most recently from e919c1b to b1d91e2 Compare December 28, 2024 02:05
@BobrImperator BobrImperator force-pushed the implement-our-event-target branch from b1d91e2 to f5c3b6e Compare December 28, 2024 02:09
Copy link

github-actions bot commented Dec 28, 2024

Some tests with 'continue-on-error: true' have failed:

  • test-app test:one ember-beta

  • test-app test:one ember-canary

  • classic-test-app test:one ember-canary

  • classic-test-app test:one ember-beta

    Created by continue-on-error-comment

@BobrImperator BobrImperator merged commit 414c082 into master Dec 28, 2024
40 of 42 checks passed
@BobrImperator BobrImperator deleted the implement-our-event-target branch December 28, 2024 08:41
@github-actions github-actions bot mentioned this pull request Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant