Skip to content

Enable preprocessing or pre-js/post-js files  #21226

Closed

Description

@sbc100

There are time when we it would be really nice to use the preprocessor in pre/post-js files.

I enabled this in #18525, but it got reverted in #19006 because not all JS files are pre-processor safe. For example, it turns out that using private JS fields confuses the pre-processor because they start with hash symbol (#). You can also imagine JS files that have {{{ or # embedded in strings.

So, we need to find a way to enable the pre-processor, but perhaps not by default? Some kind of opt-in mechansim.

Options:

  1. A new set of arguments such as --pre-js-processed= / --post-js-processed=?
  2. Some kind of marker at the top of the file? Something like use strict;? e.g. use preprocessor;?
  3. Based on file extension
  4. Some other option.

So far I'm leaning towards (2).

Activity

  1. added 8 commits that reference this issue on Jan 31, 2024
    205e4c0
    23c0f2f
    f809f9e
    6cc710d
    d0c4006
    8f5ac8d
    1cb7fe4
    4f90a4b
  2. added a commit that references this issue on Feb 3, 2024
    d73ad54
  3. added a commit that references this issue on Apr 12, 2024
    baa07c9
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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions