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

modernize addon: moved from webuniversum to appuniversum, converted to glimmer components #4

Merged
merged 13 commits into from Aug 30, 2021

Conversation

nvdk
Copy link
Member

@nvdk nvdk commented Jul 29, 2021

  • upgraded to ember 3.27, which should become a LTS release soon.
  • converted components to glimmer components
  • added missing dependency on ember-fetch

did some basic testing in the dummy app and in GN (switching was only tested in the dummy app).

fixes #3

@claire-lovisa
Copy link
Contributor

Hey Niels ! I tried to review but I seem to have issues running the addon in Loket / Toezicht / ... . I was suspecting an issue with the Ember version we use (3.20) so I tried it out on Loket 3.24. It worked at some point, then when I removed and re-installed the modules it broke again. I wasn't able to find what to update to fix it.
I'm dropping here the error I encounter, if someone else has it and fixes it don't hesitate to give me a hint on how ! :)

Error: Could not find module `@ember/component` imported from `@lblod/ember-acmidm-login/components/acmidm-switch`

addon/authenticators/torii.js Outdated Show resolved Hide resolved
addon/torii-providers/acmidm-oauth2.js Outdated Show resolved Hide resolved
addon/torii-providers/acmidm-oauth2.js Show resolved Hide resolved
@@ -0,0 +1,6 @@
<AuButton @loading={{this.isAuthenticating}} @disabled={{this.isAuthenticating}} {{on "click" this.login}}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using (and depending on) Appuniversum, it might be nice to keep these components styling agnostic?

I think this can easily be achieved by yielding state instead of outputting html. That way projects can decide which components to use.

Depending on appuniversum will also create an extra maintenance burden since it will need to be bumped from time to time (especially since it's a 0.x release).

Copy link
Contributor

@Windvis Windvis Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most projects also seem to implement a "compact" version (which duplicates the logic) of this component for the main header. That would then no longer be needed either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a great idea, but would keep this for backwards compatibility. perhaps adding a deprecation warning in the constructor?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the data-table we took the approach of a styling agnostic addon and another addon that extends it with Appuniversum, but that results in a heavier maintentance burden I must admit (and still makes it a breaking change for this addon atm).

I'm pro the deprecation warning in this PR. It paves the way to a styling agnostic version and thus a breaking release in the future. But I would implement that in a separate PR and not lump it on this one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only see now that there is a PR #5 already 🙈

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I created a follow-up PR as a quick POC of what a styling agnostic version could look like. I don't think the deprecation warnings should be added here since there are no alternatives yet, but I can add them to that PR as well.

@@ -1,5 +1,7 @@
<button ...attributes {{on "click" this.logout}}>
Copy link
Contributor

@Windvis Windvis Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this component is really needed since it's just a button wrapper for ember-simple-auth's session invalidation logic (which is not really related to acm/idm either)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I just wanted to get the conversation started. If this is a wanted change we can deprecate the component first in a separate PR)

These components are styling independant so apps can use them if the default button components don't cover the needed use cases.
@nvdk
Copy link
Member Author

nvdk commented Aug 27, 2021

Hey Niels ! I tried to review but I seem to have issues running the addon in Loket / Toezicht / ... . I was suspecting an issue with the Ember version we use (3.20) so I tried it out on Loket 3.24. It worked at some point, then when I removed and re-installed the modules it broke again. I wasn't able to find what to update to fix it.
I'm dropping here the error I encounter, if someone else has it and fixes it don't hesitate to give me a hint on how ! :)

Error: Could not find module `@ember/component` imported from `@lblod/ember-acmidm-login/components/acmidm-switch`

odd, dieter reported this as well. should look into it

@erikap
Copy link
Member

erikap commented Aug 28, 2021

Hey Niels ! I tried to review but I seem to have issues running the addon in Loket / Toezicht / ... . I was suspecting an issue with the Ember version we use (3.20) so I tried it out on Loket 3.24. It worked at some point, then when I removed and re-installed the modules it broke again. I wasn't able to find what to update to fix it.
I'm dropping here the error I encounter, if someone else has it and fixes it don't hesitate to give me a hint on how ! :)

Error: Could not find module `@ember/component` imported from `@lblod/ember-acmidm-login/components/acmidm-switch`

odd, dieter reported this as well. should look into it

Also encountering this error on the acmidm-login component when using the addon in an Ember v3.25 app, but only when using npm link. Using the Github URL as dependency in package.json seems to work fine.
Landed on emberjs/ember-cli-babel#402 but not sure whether it's related.

@erikap
Copy link
Member

erikap commented Aug 28, 2021

Found a bug ticket reporting the same error Could not find module @ember/component when NPM linking a v3.27 addon in a < v3.27 app.

Going to push some additional changes and test those using Github dependency instead of NPM linking.

Refactor to native class fails because of deprecation warning on
computed properties baseUrl/scope/redirectUri being overwritten.
@nvdk nvdk merged commit 1057ef1 into master Aug 30, 2021
@nvdk nvdk deleted the chore/modernize-code branch August 30, 2021 09:26
@nvdk nvdk added bug Something isn't working internal labels Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

depends on webuniversum
5 participants