Skip to content

[heft] [feature-request] Possibility to (optionally) remove front-end build tooling? #2548

Closed

Description

@prescience-data

Summary

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.

https://github.com/microsoft/rushstack/tree/master/apps/heft

Standard questions

Question Answer
@rushstack/heft version? Current
Would you consider contributing a PR? Yes, with some deeper study of the Heft package required.
Node.js version (node -v)? 14+

Activity

  1. octogonz commented on Mar 12, 2021

    @octogonz
    Collaborator

    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)

  2. iclanton commented on Mar 15, 2021

    @iclanton
    Member

    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?

  3. dmichon-msft commented on Mar 15, 2021

    @dmichon-msft
    Contributor

    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.

  4. prescience-data commented on Mar 15, 2021

    @prescience-data
    Author

    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.)

  5. prescience-data commented on Mar 29, 2021

    @prescience-data
    Author

    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

  6. Niek commented on Apr 28, 2021

    @Niek
    Contributor

    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

  7. prescience-data commented on Apr 29, 2021

    @prescience-data
    Author

    Yeah will be nice to roll to the new LTS (16) and off 14

  8. jonasb commented on Jul 18, 2021

    @jonasb
    Contributor

    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?

  9. jonasb commented on Aug 2, 2021

    @jonasb
    Contributor

    pd (@prescience-data) Heft 0.35 is released now which extracts Sass to a separate plugin. Does it cover this feature request?

  10. GongT commented on Jul 19, 2023

    @GongT
    Contributor

    good news: this is resolved 🎉

  11. octogonz commented on Jul 19, 2023

    @octogonz
    Collaborator

    初绎 (@GongT) thanks for pointing that out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions