Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Complete macro implementation from rfc #397

Open
ef4 opened this issue Feb 26, 2020 · 4 comments
Open

Complete macro implementation from rfc #397

ef4 opened this issue Feb 26, 2020 · 4 comments

Comments

@ef4
Copy link
Contributor

ef4 commented Feb 26, 2020

This tracks bringing @embroider/macros up to date with RFC 507.

Here's a table to track progress.

  • "implemented macro" means that the build-time implementation is done and matches the RFC. Some of the unchecked ones may have implementations but need review to compare against the latest RFC
  • "implemented types & runtime" means that the run-time implementation is done and matches the RFC. This also provides the typescript types that users of the macros will see.
name type implemented macro implemented types & runtime documented
dependencySatisfies js ✔️ ✔️ (build-time only)
hbs ✔️ n/a
each js ✔️ ✔️
hbs n/a n/a n/a
failBuild js ✔️ ✔️ (build-time only)
hbs ✔️ n/a
getConfig js ✔️ ✔️
hbs ✔️
getOwnConfig js ✔️ ✔️
hbs ✔️
importSync js ✔️ ✔️ (build-time only)
hbs n/a n/a n/a
macroCondition js ✔️ ✔️
hbs ✔️
moduleExists js ✔️
hbs n/a n/a n/a
maybeAttrs js n/a n/a n/a
hbs ✔️
@simonihmig
Copy link
Collaborator

Here's a first attempt at updating the hbs macros: #404

@rwjblue
Copy link
Collaborator

rwjblue commented Mar 29, 2020

The grid probably needs tweaking now that #404 was landed.

@simonihmig
Copy link
Collaborator

The grid probably needs tweaking now that #404 was landed.

Yes. As said before I wanted to do that, but was a bit unsure if I missed anything from the RFC. Assuming this is not the case, I updated the grid now!

@simonihmig
Copy link
Collaborator

simonihmig commented Mar 31, 2020

I updated the grid further with what my understanding is of the runtime implementations, but please double check!

  • Babel:
    • failBuild, dependencySatisfies, importSync don't have a run-time implementation (other than a TS stub that throws)
    • getConfig, getOwnConfig, each and macroCondition have a run-time implementation already
    • moduleExists is still missing, which should also be a stub that throws, right? PR: Add missing moduleExists run-time macro export + exports tests #416
  • Glimmer:
    • no runtime implementations yet at all
    • macroDependencySatisfies and macroFailBuild will be build-time only, and as such not have any run-time implementation

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

No branches or pull requests

3 participants