You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[heft] [feature-request] Possibility to (optionally) remove front-end build tooling? #2548
Certainly not an urgent concern, but I have moved all my Node projects to Rush which will never require any of the front-end build tooling like webpack, node-sass, postcss and so on.
Additionally, I haven't fully looked into what the Jest components of Heft do yet, but the tests are another one that seems like an easy win to strip given many people are using alternate testing frameworks.
For the sake of efficiency & reducing unnecessary dependency compatibility issues, it would be great to one day have the option to use a version of Heft that is intended solely for CLI / server-type applications. 😁💭
Details
Possible solution:
A thinner version of @rushstack/heft, ie: @rushstack/heft-base / @rushstack/heft-lite(or some similar nomenclature that fits the Rush style guide) which the "full" Heft extends on.
Heft's plugin-based architecture was designed to support this. Initially everything was rolled together purely as a convenience. Jest and Webpack are the biggest dependencies, so it's likely that at least those plugins will get extracted into their own packages somewhat soon.
Yeah we've been talking about doing that. We could probably initially create two plugin packages: one for the browser-targeting plugins (webpack, sass, etc) and one for Jest. That probably actually wouldn't be too hard.
We could borrow the Babel naming convention:
@rushstack/heft-core
@rushstack/heft-preset-web (shorthand for @rushstack/heft-plugin-sass and @rushstack/heft-plugin-webpack)
@rushstack/heft-plugin-jest
Though it might make sense to separate SASS and Webpack, since the latter is sometimes used to target Node, though esbuild seems be gaining favor in that space.
David Michon (@dmichon-msft)
Yeah! ESBuild is incredible, the speed is absolutely absurd! I currently have it jury-rigged to make ESBuild run for the final packaging, but it can also do unbundled "normal" TypeScript builds, but with the speed of multithreading, so it would be absolutely nuts how fast heft would run even on full rush rebuild calls if there was an optional plugin that users could swap out tsc in favour of. (Just re-read the docs and this may not actually be appropriate for most TS cases: https://esbuild.github.io/content-types/#no-type-system) (plus it somehow magically seems to "just work" in situations where rollup and webpack fail on.)
Ian Clanton-Thuon (@iclanton)
As you mentioned the "official" Heft plugins potentially being abstracted out (ie "browser", "jest", etc), given Folio is another Microsoft product it would be cool to see an official Heft package for it one day as well for people working with fixtures-based testing! 🕺
This is relevant again now that Node 16 is out. The package node-sass doesn't work with Node 16 yet (see sass/node-sass#3090) so heft doesn't work on Node 16 yet. See also the previous issue in relation to Node 15 support: #2490
Reacted by pd, Sveinung Tord Røsaker, Camille Louédoc-Eyriès and Reagan Elm
Another vote for breaking moving out at least sass into a separate (optional) plugin.
I'm running on Apple Silicon (M1) and prefer to use ARM binaries for Node. There is only official Node support for Node 16+ and even if node-sass supports Node 16+ in node-sass@6, it doesn't support Apple silicon resulting in this error "Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Node.js 16.x"
I assume there's no official way of disabling the sass functionality?
Activity
octogonz commentedon Mar 12, 2021
Heft's plugin-based architecture was designed to support this. Initially everything was rolled together purely as a convenience. Jest and Webpack are the biggest dependencies, so it's likely that at least those plugins will get extracted into their own packages somewhat soon.
CC Ian Clanton-Thuon (@iclanton)
iclanton commentedon Mar 15, 2021
Yeah we've been talking about doing that. We could probably initially create two plugin packages: one for the browser-targeting plugins (webpack, sass, etc) and one for Jest. That probably actually wouldn't be too hard.
Any opinions on the package names?
dmichon-msft commentedon Mar 15, 2021
We could borrow the Babel naming convention:
@rushstack/heft-core
@rushstack/heft-preset-web (shorthand for @rushstack/heft-plugin-sass and @rushstack/heft-plugin-webpack)
@rushstack/heft-plugin-jest
Though it might make sense to separate SASS and Webpack, since the latter is sometimes used to target Node, though esbuild seems be gaining favor in that space.
prescience-data commentedon Mar 15, 2021
David Michon (@dmichon-msft)
Yeah! ESBuild is incredible, the speed is absolutely absurd! I currently have it jury-rigged to make ESBuild run for the final packaging,
but it can also do unbundled "normal" TypeScript builds, but with the speed of multithreading, so it would be absolutely nuts how fast(Just re-read the docs and this may not actually be appropriate for most TS cases: https://esbuild.github.io/content-types/#no-type-system)heftwould run even on fullrush rebuildcalls if there was an optional plugin that users could swap outtscin favour of.(plus it somehow magically seems to "just work" in situations where
rollupandwebpackfail on.)prescience-data commentedon Mar 29, 2021
Ian Clanton-Thuon (@iclanton)
As you mentioned the "official" Heft plugins potentially being abstracted out (ie "browser", "jest", etc), given Folio is another Microsoft product it would be cool to see an official Heft package for it one day as well for people working with fixtures-based testing! 🕺
https://github.com/microsoft/folio
Niek commentedon Apr 28, 2021
This is relevant again now that Node 16 is out. The package
node-sassdoesn't work with Node 16 yet (see sass/node-sass#3090) so heft doesn't work on Node 16 yet. See also the previous issue in relation to Node 15 support: #2490prescience-data commentedon Apr 29, 2021
Yeah will be nice to roll to the new LTS (16) and off 14
jonasb commentedon Jul 18, 2021
Another vote for breaking moving out at least sass into a separate (optional) plugin.
I'm running on Apple Silicon (M1) and prefer to use ARM binaries for Node. There is only official Node support for Node 16+ and even if
node-sasssupports Node 16+ innode-sass@6, it doesn't support Apple silicon resulting in this error "Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Node.js 16.x"I assume there's no official way of disabling the sass functionality?
jonasb commentedon Aug 2, 2021
pd (@prescience-data) Heft 0.35 is released now which extracts Sass to a separate plugin. Does it cover this feature request?
GongT commentedon Jul 19, 2023
good news: this is resolved 🎉
octogonz commentedon Jul 19, 2023
初绎 (@GongT) thanks for pointing that out!