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

[Bugfix release] allow class-based helpers to work in strict-mode #19878

Merged

Conversation

NullVoxPopuli
Copy link
Contributor

Resolves #19877

module('tests/integration/components/gjs', function (hooks) {
setupRenderingTest(hooks);

test('it works with ember helpers', async function (assert) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a whole app for just this tset because I couldn't find any other place where I'd have access to all the thing that this test requires.

If such a place exists, I'm happy to move this test there.
I think having a full app though to make sure things are roughly still wired up ok is good

NullVoxPopuli added a commit to NullVoxPopuli/limber that referenced this pull request Dec 18, 2021
@@ -179,7 +179,7 @@ class ClassicHelperManager implements HelperManager<ClassicHelperStateBucket> {
}

getDebugName(definition: ClassHelperFactory) {
return getDebugName!(definition.class!['prototype']);
return getDebugName!((definition.class || definition)!['prototype']);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

when a class-based helper is used in strict mode, there is no class property

@patricklx
Copy link
Contributor

might this be related? #19518

@NullVoxPopuli
Copy link
Contributor Author

@patricklx I think it might be!! yeah!

@mixonic
Copy link
Member

mixonic commented Dec 18, 2021

This fix is probably ok, but I would like it tested in the existing test harness and not an entirely new suite. Adding a whole new kind of smoke test should a) be decoupled into its own PR and b) does not preclude ensuring regressions have coverage added in the internal non-smoke test suite.

That is the main blocker I see here. Is this a bugfix-release? Bugfix-lts?

@NullVoxPopuli
Copy link
Contributor Author

Is this a bugfix-release? Bugfix-lts?

It's a bug on 4.0+, afaict (I haven't checked earlier) -- so, bugfix-release?

but I would like it tested in the existing test harness

where would a test like this go?

a) be decoupled into its own PR

can do!

@NullVoxPopuli NullVoxPopuli changed the title [Bugfix] allow class-based helpers to work in strict-mode [Bugfix release] allow class-based helpers to work in strict-mode Dec 18, 2021
@NullVoxPopuli
Copy link
Contributor Author

I'm having issues with the test. any help is much appreciated <3

@kategengler kategengler merged commit ef2ad15 into emberjs:master Jan 7, 2022
@kategengler
Copy link
Member

Merging on approvals from #19884

ef4 added a commit to embroider-build/embroider that referenced this pull request Nov 16, 2022
I thought we could take first-class helper support for granted since it was supposed to be introduced before 3.28 (our oldest supported ember), but due to:

emberjs/ember.js#19878

we can't rely on it until ember 4.2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] class-based helpers throw weird error in strict mode (getDebugName)
4 participants