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

embroider support #2228

Open
RobbieTheWagner opened this issue Sep 12, 2021 · 5 comments
Open

embroider support #2228

RobbieTheWagner opened this issue Sep 12, 2021 · 5 comments
Labels

Comments

@RobbieTheWagner
Copy link

Feature request

I think mirage has some issues in embroider. Should we update to the latest addon blueprint and test against embroider here? Things I am seeing are:

WARNING in ../../node_modules/ember-cli-mirage/db-collection.js 1:0-52
export '_dbCollection' (reexported as 'default') was not found in 'miragejs' (possible exports: ActiveModelSerializer, Collection, Factory, IdentityManager, JSONAPISerializer, Model, Response, RestSerializer, Serializer, Server, _Db, _DbCollection, _RouteHandler, _SerializerRegistry, _assert, _ormAssociationsAssociation, _ormAssociationsBelongsTo, _ormAssociationsHasMany, _ormPolymorphicCollection, _ormSchema, _routeHandlersBase, _routeHandlersFunction, _routeHandlersObject, _routeHandlersShorthandsBase, _routeHandlersShorthandsDelete, _routeHandlersShorthandsGet, _routeHandlersShorthandsHead, _routeHandlersShorthandsPost, _routeHandlersShorthandsPut, _utilsExtend, _utilsInflectorCamelize, _utilsInflectorCapitalize, _utilsInflectorDasherize, _utilsInflectorUnderscore, _utilsIsAssociation, _utilsReferenceSort, _utilsUuid, association, belongsTo, createServer, default, defaultPassthroughs, hasMany, trait)

and

Build Error (PackagerRunner) in ../../../../../home/runner/work/ember-cli-addon-docs/ember-cli-addon-docs/node_modules/pretender/dist/pretender.es.js

Module not found: Error: Can't resolve 'ember-source/route-recognizer/index.js' in '/home/runner/work/ember-cli-addon-docs/ember-cli-addon-docs/node_modules/pretender/dist/pretender.es.js'
@cah-brian-gantzler
Copy link
Collaborator

Ember-cli-mirage does need updated to remove the re-export of things that are in MirageJS proper to more clearly indicate what this addon is and is not providing (This re-export was done for backward compatibility as it would be a breaking change). The first item you listed is one that would be fixed with that effort. (It appears that Mirage has renamed this to _DbCollection)

The second is one that does not effect the addon itself but the addons docs website. I believe this needs updates in ember-cli-addon-docs not this addon.

@RobbieTheWagner
Copy link
Author

RobbieTheWagner commented Sep 12, 2021

@cah-briangantzler I don't think ember-cli-addon-docs uses pretender, that I know of. I believe it is a dependency of mirage, so I am pretty sure it all needs to be fixed here.

From yarn.lock:

miragejs@^0.1.31:
  version "0.1.41"
  resolved "https://registry.yarnpkg.com/miragejs/-/miragejs-0.1.41.tgz#1b06a2d2d9de65624f5bb1cee7ebb4a208f554d0"
  integrity sha512-ur8x7sBskgey64vdzKGVCVC3hgKXWl2Cg5lZbxd6OmKrhr9LCCP/Bv7qh4wsQxIMHZnENxybFATXnrQ+rzSOWQ==
  dependencies:
    "@miragejs/pretender-node-polyfill" "^0.1.0"
    inflected "^2.0.4"
    lodash.assign "^4.2.0"
    lodash.camelcase "^4.3.0"
    lodash.clonedeep "^4.5.0"
    lodash.compact "^3.0.1"
    lodash.find "^4.6.0"
    lodash.flatten "^4.4.0"
    lodash.forin "^4.4.0"
    lodash.get "^4.4.2"
    lodash.has "^4.5.2"
    lodash.invokemap "^4.6.0"
    lodash.isempty "^4.4.0"
    lodash.isequal "^4.5.0"
    lodash.isfunction "^3.0.9"
    lodash.isinteger "^4.0.4"
    lodash.isplainobject "^4.0.6"
    lodash.lowerfirst "^4.3.1"
    lodash.map "^4.6.0"
    lodash.mapvalues "^4.6.0"
    lodash.pick "^4.4.0"
    lodash.snakecase "^4.1.1"
    lodash.uniq "^4.5.0"
    lodash.uniqby "^4.7.0"
    lodash.values "^4.3.0"
    pretender "^3.4.3"

@cah-brian-gantzler
Copy link
Collaborator

I agree. Was just going off the path that the error reported seems to imply that pretender is under the directory of ember-cli-addon-docs.

From what I can tell the errors embroider is getting (I was experimenting with these a few months ago) is not errors in the addon itself but errors in the test environment (which technically doesnt have to be embroider compatible). Im curious how the embroider team will separate that concern.

@RobbieTheWagner
Copy link
Author

I agree. Was just going off the path that the error reported seems to imply that pretender is under the directory of ember-cli-addon-docs.

That's just because everything gets merged into the consuming app/addon's namespace I think. The error with pretender is definitely here.

From what I can tell the errors embroider is getting (I was experimenting with these a few months ago) is not errors in the addon itself but errors in the test environment (which technically doesnt have to be embroider compatible). Im curious how the embroider team will separate that concern.

Yes, it is annoying that test/dummy apps must also be embroider compatible, but I suspect they will not separate these concerns, as it's best practice to make it all compatible.

@esbanarango
Copy link

Build Error (PackagerRunner) in ../../../../../home/runner/work/ember-cli-addon-docs/ember-cli-addon-docs/node_modules/pretender/dist/pretender.es.js

Module not found: Error: Can't resolve 'ember-source/route-recognizer/index.js' in '/home/runner/work/ember-cli-addon-docs/ember-cli-addon-docs/node_modules/pretender/dist/pretender.es.js'

Has been already solved in:

    "@embroider/compat": "0.44.2",
    "@embroider/core": "0.44.2",
    "@embroider/webpack": "0.44.2",

I still see the WARNING in ./node_modules/ember-cli-mirage/db-collection.js 1:0-52 tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants