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

[core] Use exports instead of aliases where possible #25799

Closed
wants to merge 5 commits into from

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Apr 16, 2021

Based on #25795

We have this kind of dangerous stack of technical debt that is pinning us down:

  1. Can't use exports with webpack 4
    1. Can't use webpack 5 because of inline loader not migrateable to webpack 5 when used in require.context webpack/webpack#12900
      1. Can't resolve inline loader not migrateable to webpack 5 when used in require.context webpack/webpack#12900 with getStaticProps because of getStaticProps on _app vercel/next.js#10949
    2. Can't use webpack 5 because Bundle is invalid when used in an existing repository codymikol/karma-webpack#505
      1. Can't drop karma because there's no alternative (I have no idea how one would use browserstack)
  2. Can't use exports because of Support for package.json exports and imports ? import-js/eslint-plugin-import#1868 (arguably the easiest since we should just be able to drop import/resolve)

@eps1lon eps1lon added the core Infrastructure work going on behind the scenes label Apr 16, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Apr 16, 2021

Bundle size will be reported once Azure build #26190 finishes.

Generated by 🚫 dangerJS against 7b5ca03

@eps1lon eps1lon force-pushed the core/exports-resolution branch from 1b24a81 to 17d2c4b Compare April 16, 2021 16:51
@eps1lon eps1lon force-pushed the core/exports-resolution branch from 124d0a2 to 2cda086 Compare April 17, 2021 08:01
@eps1lon eps1lon force-pushed the core/exports-resolution branch from 2cda086 to 7b5ca03 Compare April 17, 2021 08:02
"exports": {
".": "./src/index.js",
"./es/*": "./src/*/index.js",
"./*": "./src/*/index.js"
Copy link
Member Author

Choose a reason for hiding this comment

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

Would be nice but breaks down in packages where we mix index.ts and index.js. Since these are just files that define the public interface via import/export we should convert them to TypeScript anyway.

But there are some moving parts that need to be solved first. Considering we can't get rid of custom aliasing solutions anyway (see PR description) I'm closing until we can migrate completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inline loader not migrateable to webpack 5 when used in require.context
2 participants