-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Completion roadmap for [email protected] #5024
Comments
To summarize the existing changes and the above proposed changes: v2 Features
Features removed from v2
|
This list looks good! One ask I have, with "Compiling node_modules to support packages using newer language features", can we get support for dynamic imports in |
I am curious about the Monorepo support via |
The plan (@Timer correct me if I'm wrong) is that we'll support putting CRA in a monorepo but we won't attempt to compile any code outside the project folder (e.g. JSX). You can compile it with tools like |
I've got a working monorepo with a I'd be happy to share what I've discovered with someone if they wanted to reach out to me. Unfortunately, I don't have the time to directly contribute on documentation at this time, but I do have time for a quick chat and knowledge share. |
"Parallelization of webpack builds to speed up compilation" What does this mean? That a single build will have webpack tasks spread across the various CPU cores? Or that multiple build configurations will run in parallel? |
That a single build will have webpack tasks spread across the various CPU cores. re @bjankord: Dan and I spoke, we will support dynamic import ( |
@Timer I'm asking ya'll what you mean by that statement. I don't know what it means, and I'm asking for clarification. I proposed some speculations. |
Sorry @tbranyen, I didn't mean to leave the question mark -- your speculation was correct. I edited my comment to reflect this. Processing files through ESLint, Babel, and Minification all happen in worker processes. It'll use all but 1 available cores. |
I would love to see CRA v2 consider referencing create-react-library as a mature sister project for solving the monorepo use case of defining reusable component libraries, especially if this is just going to be a docs update. Nothing against (note that I am the maintainer of |
Nice that v2 will finally be released! Sad about the drop of monorepo support. |
Just adding 2 cents on this. UglifyJS itself is still maintained (from what I know), it is UglifyES that got discontinued and it's the one that is now maintained by Fabio as Terser. UglifyJS should still be a good enough choice for CRA (at this point in time) as from what I read you plan to output es5 for now and that is exactly what is supported by UglifyJS. |
We only plan on outputting es5 for the short term. We want to add a modern mode that outputs ESNext. Sorry I didn't get the semantics quite right, I'll edit for clarity! |
is there any possibility to also make it Server side rendered app? |
No problem, that is an easy mistake to make. I'm not involved in those projects, but felt that this could be clarified in the post. Cheers! |
Maybe we could land support for modern browsers (#4964) in v2? I would do whatever it takes to make it happen. |
Great! |
Re: modern browsers please don't miss this in the original post:
|
Does #4772 not give the desired vendor chunking behavior? I don't think creating a vendor chunk per application chunk should be the goal. The point for the vendor chunk is to contain a lot of the commonly-used dependencies so each application chunk does not have to load them (things like react etc). |
Sorry, but this is out of scope at this time. Please consider something like Next.js in the meantime.
Sorry, I didn't see that PR -- but that PR uses the default behavior which names chunks via what's included (instead of numbering them) causing unnecessary cache invalidations. |
No worries; glad to have it fixed! |
While I've downgraded to 1.x, my issue with 2.x beta was that it's memory exploded and it couldn't build a project that 1.x could build without issues. The app had the following dependencies:
I understand that these imports could be optimised and separated or partially loaded from CDN, like plotly.js, but just wanted to show a use case where 2.x couldn't build something what 1.x could. |
Can you please share a reproducing project of something that can't build but built with v1 please, @hyperknot? |
@Timer I cannot share the project I'm working on, but maybe I can just create a new app and import these ones to repro. |
That'd be helpful! I'm not sure if it requires some to be dynamic imports, etc. Please make it as close to your app as possible. :-) |
@Timer it was all ES imports, but I'll try to create a repro case. |
Understandable that the monorepo support was dropped for now, any chance it will be considered for a future 2.x release? Adding another tooling layer to compile internal monorepo packages that do not need to be published is less than ideal. |
We might consider it but it needs to be a more concrete proposal and ideally there would be some consensus between different tools on how to do it. |
The final beta has been released! Please see issue #5103. |
Hey, sorry if this is already documented, I can't find it:
Can you point me to the documentation on how to import transpiled JS that is outside the CRA /src folder? Or am I misunderstanding? |
@mdavid88 that is under the "removed features" section. It did not ship with v2, maybe with v3! |
@Timer Hey thanks. I was unclear. I get that it's been removed, but it sounds like the functionality still exists to do what I want:
I have a shared-components directory as a sibling to the CRA directory, with built components using nwb. Is there a way to |
Sure, that behavior should "just work" assuming your package.json is configured correctly to point at compiled sources and not original source. Can we file a new issue for continued discussion? I don't want to make more noise on this closed issue. Thanks! |
Hey everyone! We know progress on
[email protected]
has been stagnating for a while.We put together a lofty set of goals when we first started v2.
The scope of these changes have proven themselves to be too large to effectively polish everything and create a stable build.
To remediate this, we're going to reduce the scope of v2, polish completed features, and release v2 as stable within the next two (2) weeks.
Action Plan
Our proposed plan of action is as follows (in no particular order):
✅ Fix vendor chunking (Case against enabling
AutomaticCommonsChunksPlugin
in webpack by default #4977, react-scripts v2 webpack 4 splitChunks name setting should use the default #4769, An explanation of my magically shrinking build size with subsequent alpha builds #4633, Make chunking toggleable #4632)✅ Switch to Terser (Cannot turn off es5 compile #4948, @next runs out of memory on build, throws JS stacktracke #4902, Consider switching to terser #4711, disable reduce_vars in uglify-es due to bug in code generation #4692, CRA generating invalid sourcemaps? #4683, CRA 2 browserslist build can generate invalid code #4665, Reconsider whether it's safe to rely on recent Uglify versions #4329, Preserve Licenses #4116, String is modified in the production build #4100)
✅ Revert monoreport support (Add support for yarn and lerna monorepos. #3741, Use yarn when running inside yarn workspace. #3997, Add support for new yarn workspaces config format #4001) because there's too many issues (react-scripts 2.0 breaks some monorepos #4569, jest runs all tests found in monorepo [email protected] #4410, next@b2fd8db8 throws if monorepo with nwb modules #4249, RFC: Source Packages #4092, Require monorepo source workspace packages to be opted in via glob. #4570, Can't use a CRA project inside Yarn Workspaces #3031, Support running create-react-app inside a monorepo. #3967)
nwb
and provide excellent documentation on how to do so. This is arguably the best way.✅ Fix edge-cases for compiling
node_modules
and polish Babel 7 upgradenode_modules
has surfaced some issues, particularly aroundasync
/await
andregenerator
.✅ Remove
mjs
supportmjs
support and we're going to remove support to fix complex edge cases with resolving modules. There are alternative resolve orders based on source file and supported features which are concepts Jest does not have support for yet.✅ Drop advanced proxy configuration and replace it with
express
middlewareexpress
app instance. You can attach any middleware or routes to thisexpress
app that you'd like.✅ Remove support for targeting newer browsers
node_modules
, so you can consume any package using newer syntax without worry.How can I help?
Please let us know your thoughts and if we missed anything.
We'll be more than happy to explain our rationale around these decisions if there's any further questions.
If there's anything you (and the community) feel strongly about but is not found on this list, please make an effort to send a PR!
We'll be more than happy to accept contributions.
Cheers, everyone!
The text was updated successfully, but these errors were encountered: