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

Reducing internal usage of AMD loader #20582

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Reducing internal usage of AMD loader #20582

merged 1 commit into from
Dec 1, 2023

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Nov 30, 2023

(This PR is re-opened from #20581. I merged that one prematurely and immediately force-pushed to revert it.)

There are several places where ember-source depends unnecessarily on details of the AMD loader:

optionally loading the ember-testing implementation
optionally loading the runtime template compiler
This PR replaces them with more direct forms of coordination via module-scoped state.

My overarching goal here is to eliminate all usage of require inside the actual ES module packages so they are true ES modules.

In contrast, the traditional ember.js, ember-testing.js, and ember-template-compiler.js bundles will still use require as their implementation to maintain backward compatibility. Where we need to patch over the weirdness of this (from the perspective of actual compliant ES modules), we do so entirely within the build that produces the bundles.

This is a step toward the proposed strict-es-modules optional feature. This implementation cleanup is happening before advancing that RFC because this cleanup is good either way and does not make any public API changes.

@ef4
Copy link
Contributor Author

ef4 commented Nov 30, 2023

@kategengler do you have an opinion about how to tag this commit? It's internal refactor.

@kategengler
Copy link
Member

If it is an internal refactor, would you even want it mentioned in the changelog?

@ef4
Copy link
Contributor Author

ef4 commented Nov 30, 2023

No, but I was thinking you rely on these to help with the cherry-picking release process. If it's not important for release, we don't need any label.

@kategengler
Copy link
Member

Yeah we wouldn't typically backport an internal refactor

@chancancode
Copy link
Member

[CLEANUP] or [CLEANUP canary] probably?

…mentation

don't use AMD loader to coordinate optional runtime template compiler

update Ember reexports

legacy bundle linkage

move legacy bundle-specific boostrapping out of the esm packages

move the weird _Ember reexport logic

moving conditional support for compile()

move globals template compiler (lol)

remove last use of `require` in test suite

lint against re-introducing require

clarifying conditional usage
@ef4
Copy link
Contributor Author

ef4 commented Dec 1, 2023

This is ready to go.

@ef4
Copy link
Contributor Author

ef4 commented Dec 1, 2023

(This already got code reviewed in #20581)

@ef4 ef4 merged commit c737bbc into main Dec 1, 2023
18 checks passed
@ef4 ef4 deleted the internal-coordination branch December 1, 2023 19:08
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.

None yet

3 participants