Fix and improve configuration for Djblets JavaScript/TypeScript.

Review Request #12793 — Created Jan. 20, 2023 and submitted

Information

Djblets
release-4.x

Reviewers

This makes a few adjustments and improvements to our recently-added
configuration:

  • Decorators are now available. This uses Babel's "legacy" decorators,
    which just wrap the decorated item in a function call, as that's
    actually what TC39 recommends currently (the modern specs are too much
    in flux). This will be needed for Spina.

  • Improved our "globals" configuration for imports so that an import
    from, say, "jquery" will transpile to just using the $ namespace.
    This exists for all the modules we have registered as globals. This
    allows us to either import from the modules (recommended) or access
    the namespaces directly (allowed but should be legacy).

  • The TypeScript compiler no longer emits JavaScript or declaration
    files. This was polluting our tree. We'll eventually want to enable
    type declaration files, but not today.

  • Several TypeScript options were turned on to enable better Babel
    interoperability.

Our dependency on @beanbag/frontend-buildkit has been bumped to 1.1
for a couple new plugins (a TypeScript .d.ts bundler plugin for
rollup, and a plugin needed for experimental decorators).

Along with this, a package-lock.json has been added to the repository.

Installed the new dependencies and built static media. All media built
successfully.

Tested these configuration updates with some test changes for Spina
(coming in the next change).

Summary ID
Fix and improve configuration for Djblets JavaScript/TypeScript.
This makes a few adjustments and improvements to our recently-added configuration: * Decorators are now available. This uses Babel's "legacy" decorators, which just wrap the decorated item in a function call, as that's actually what TC39 recommends currently (the modern specs are too much in flux). This will be needed for Spina. * Improved our "globals" configuration for imports so that an import from, say, "jquery" will transpile to just using the `$` namespace. This exists for all the modules we have registered as globals. This allows us to either import from the modules (recommended) or access the namespaces directly (allowed but should be legacy). * The TypeScript compiler no longer emits JavaScript or declaration files. This was polluting our tree. We'll eventually want to enable type declaration files, but not today. * Several TypeScript options were turned on to enable better Babel interoperability. Our dependency on `@beanbag/frontend-buildkit` has been bumped to 1.1 for a couple new plugins (a TypeScript `.d.ts` bundler plugin for rollup, and a plugin needed for experimental decorators). Along with this, a `package-lock.json` has been added to the repository.
1abfcb49204962bedfb2cd013b0aeab98ecb6d3b
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.x (aeb85b4)
Loading...