feat(babel): async resolvers (fixes #888 and a lot of more) #1001
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
From the beginning, Linaria worked in synchronous mode. That was the reason, why we could not directly support resolvers provided by bundlers (because all of them are async).
Summary
This PR introduces a completely new Linaria, that was rewritten from scratch in order to support async mode. Now Linaria natively supports Rollup, Vite, esbuild and webpack. You don't even need to configure
babel-plugin-module-resolver
for aliases if your bundler already supports them. Such a big change means, that it can not be released under 3.0 branch. It also means, that the first beta of 4.0 will be pretty unstable, but only during the build stage. If your project is successfully built under 4.0, everything will be fine in production.Test plan
A lot of new tests were written. Examples for Rollup, Vite, esbuild and webpack 4/5 were added.