Remove need for making qwik libraries noExternal #318
wmertens
started this conversation in
Proposals For Qwik
Replies: 2 comments 1 reply
-
|
This sounds reasonable to me, but this is a lot of steps. Also would this be a breaking change for Qwik libraries? |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Wout, Michal, and I talked this. We agreed that it should be done before 2.0 rc, and the tradeoff being that library authors will be doing the transpilation. In return there is less surface area for potential issues with libraries, and library maintainers will be responsible for upgrading in the case of majors and keeping updated with the current qwik version. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is it about?
Improve DX and dev speed
What's the motivation for this proposal?
There are a few reasons why Qwik libraries need to be transformed during the build:
component$to the equivalent QRL expressionsjsx()to the optimized_jsxSortedand_jsxSplitexpressionsisServeretc to their boolean values, so the code tree-shakes before processing imports inside blocksThat's why these libraries need to be
noExternalandoptimizeDeps.exclude.This means that devs need to add Qwik libraries to these configuration values, and that they get built for every dev build, they can't be preprocessed.
Proposed Solution / Feature
If we eliminate all these reasons, then Qwik libraries can be built ahead of time, and no special configuration is needed.
exportsmap to differentiate betweenbrowserandimportbuilds.getClientManifest()andgetRouterMap()globalThis.__qwikvariable can be used to make sure that multiple Qwik instances are actually the exact same version. On the client, multiple Qwik versions are allowed to co-exist, but on the server, only a single Qwik version and a single server build can co-exist.All these require that the internal API remains the same: _jsxSorted, _jsxSplit, and the various QRL calls.
Conclusion
The needed changes are:
Provided we can guarantee internal API stability and do some small changes, we can eliminate special treatment for Qwik libraries. Build optimizations can be applied, speeding up dev mode and builds.
Links / References
No response
Beta Was this translation helpful? Give feedback.
All reactions