Skip to content

Use ES format for JS#8171

Merged
javierjulio merged 5 commits into
masterfrom
js-es-build
Dec 14, 2023
Merged

Use ES format for JS#8171
javierjulio merged 5 commits into
masterfrom
js-es-build

Conversation

@javierjulio

@javierjulio javierjulio commented Dec 14, 2023

Copy link
Copy Markdown
Member

Since the host app will compile assets, no need to build JS manually anymore so Rollup can be removed. We'll only serve the ES format. Since host app will be expected to use cssbundling-rails and jsbundling-rails, they can build JS using esbuild. Although they should be able to use other libraries like shakapacker, webpack, etc. This removes the vendor based Flowbite script as it's no longer necessary. Our dev and test builds are working with this new setup.

@javierjulio javierjulio changed the title Js es build Switch to ES based JS Dec 14, 2023
@javierjulio javierjulio force-pushed the js-es-build branch 2 times, most recently from 0e7dacd to 0a42ee7 Compare December 14, 2023 08:33
@codecov

codecov Bot commented Dec 14, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4f57564) 99.01% compared to head (049d4eb) 99.03%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8171      +/-   ##
==========================================
+ Coverage   99.01%   99.03%   +0.02%     
==========================================
  Files         162      162              
  Lines        4450     4458       +8     
==========================================
+ Hits         4406     4415       +9     
+ Misses         44       43       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@javierjulio javierjulio changed the title Switch to ES based JS Use ES format for JS Dec 14, 2023
This now supports a cssbundling-rails and jsbundling-rails setup, where the latter we'll use esbuild. This way the host app can customize the JS on their side.

Discovered an issue in CI when generating the test app. Due to soft_generate method, in either condition, we need to run yarn install at both levels (root and generated app) and build both CSS and JS. The latter is just for running tests. In dev, since we've run yarn install already it's why we didn't discover any issue until running CI. That's why we always want to run yarn install at both project root and generated test app since the generated app will require files from the project root.
This is no longer needed since we now have a working dev and test setup with the NPM package with ES output format so we'll use cssbundling-rails and jsbundling-rails by default.
We no longer build JS but instead host app will compile it using jsbundling-rails with esbuild.
@javierjulio javierjulio merged commit 320cb34 into master Dec 14, 2023
@javierjulio javierjulio deleted the js-es-build branch December 14, 2023 16:55
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.

1 participant