Closed vstefanovic97 closed 10 months ago
Hmm, this would be a breaking change for the library, so I don't want to jump into this change aggressively. It'd be nice to understand better if there's an alternative that still allows this to work. It's weird that something we're doing in a hook for test support is impacting the prod bundle...
@elwayman02 one way I think we can keep import as is would be to convert addon to v2, but that would also be a breaking change I think? Would you be more open to major release in that case, if we converted the addon to v2?
@vstefanovic97 I think I'd be more amenable to a v2 conversion since that's an expected evolution of Ember addons moving forward. It would be easier to justify the breaking release at that point, given we're aligning with the future of Ember packages.
@elwayman02 @vstefanovic97 I would recommend work on v2 conversion in pieces (convert to monorepo, extracttest app, convert to v2, update import path, etc.) instead of single PR as it makes things simpler to review and grasp.
@elwayman02 would you like to add me as contributor to this addon to spread the maintenance work? I have limited bandwidth but would be happy to help with v2 conversion and some maintenance.
@SergeAstapov sure, I'd be happy to have the contribution!
@elwayman02 @vstefanovic97 just realized we don't need a breaking change for v2 conversion as we even won't need to change import path.
as this addon already depends on ember-auto-import v2, conversion to v2 format is a non-breaking change.
we would then leave import path "as is" as it would be responsibility of ember-auto-import to include this addon to test only bundle as it would be used only in tests and tehre won't be any treeForAddonTestSupport
at all
Even better!
Please test 7.4.0 and let me know if the issue is resolved!
yes it was resolved!
Looks like after bumping
ember-sinon-qunit
from6.0.0
to7.0.0
we are seeingsinon
,qunit
and some other packages getting included in one ofember-auto-import
generated chunks for production builds.I was able to reproduce this https://github.com/vstefanovic97/ember-sinon-qunit-bug-reproduction, repository is new ember app with just
ember-sinon-qunit
added.Steps to reproduce
After build if we inspect
dist/index.html
and chunks included we will see that one of the chunks containssinon
andqunit
code.After investigation it seems that this is the root cause https://github.com/elwayman02/ember-sinon-qunit/blob/master/index.js#L14-L30
Something we are doing here is not sitting well with
ember-auto-import
and because of that it includes test deps in prod bundle. Since preprocessJs is a private method we probably shouldn't be using it in the first place.I propose just removing this code and having users import
setupSinon
as