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

Replace require with importSync to play nice with Embroider #486

Conversation

achambers
Copy link
Contributor

@achambers achambers commented Nov 13, 2023

This PR removes the use of require as a means of deciding whether to import a package or not and replaces with the the @embroider/macros provided dependencySatisfies and importSync. These functions are backwards compatible and therefore will work in both Classic and Embroider builds.

@achambers achambers changed the title Add ember-data-model-fragments as an optional peer depdendency Replace require with importSync to play nice with Embroider Nov 13, 2023
@achambers achambers force-pushed the ac/feature/make-embroider-friendly branch from a27d7f8 to 55365ce Compare November 13, 2023 12:29
@achambers achambers marked this pull request as ready for review November 13, 2023 13:04
Copy link
Contributor

@mansona mansona left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 it would probably be good to get someone more familiar with the code to take a look too but if tests are passing I guess we could just merge it 🤷

@achambers achambers force-pushed the ac/feature/make-embroider-friendly branch 2 times, most recently from 71ef079 to 96c2771 Compare November 13, 2023 15:20
@achambers achambers force-pushed the ac/feature/make-embroider-friendly branch from 96c2771 to 481aa6a Compare November 14, 2023 09:09
@patocallaghan patocallaghan merged commit 965d76d into adopted-ember-addons:master Nov 14, 2023
7 of 10 checks passed
patocallaghan pushed a commit that referenced this pull request Nov 14, 2023
* Add ember-data-model-fragments as an optional peer depdendency

* Introduce @embroider/macros

* Replace require with importSync to make it Embroider friendly
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.

3 participants