@rolldown/browser 1.0.0-beta.9-commit.8371a90 → 1.0.0-beta.9-commit.b174110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/cli.cjs +10 -10
  2. package/dist/cli.mjs +2 -2
  3. package/dist/config.cjs +2 -2
  4. package/dist/config.d.cts +1 -1
  5. package/dist/config.d.mts +1 -1
  6. package/dist/config.mjs +2 -3
  7. package/dist/experimental-index.browser.mjs +1 -1
  8. package/dist/experimental-index.cjs +1 -1
  9. package/dist/experimental-index.d.cts +1 -1
  10. package/dist/experimental-index.d.mts +1 -1
  11. package/dist/experimental-index.mjs +1 -1
  12. package/dist/filter-index.d.cts +1 -1
  13. package/dist/filter-index.d.mts +1 -1
  14. package/dist/filter-index.mjs +1 -5
  15. package/dist/index.browser.mjs +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.cts +2 -2
  18. package/dist/index.d.mts +2 -2
  19. package/dist/index.mjs +1 -1
  20. package/dist/parallel-plugin-worker.cjs +1 -1
  21. package/dist/parallel-plugin-worker.mjs +1 -1
  22. package/dist/parallel-plugin.d.cts +1 -1
  23. package/dist/parallel-plugin.d.mts +1 -1
  24. package/dist/rolldown-binding.wasi-browser.js +1 -0
  25. package/dist/rolldown-binding.wasi.cjs +1 -0
  26. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  27. package/dist/shared/{define-config.d-D11P5huJ.d.cts → define-config.d-D4lKXE9V.d.cts} +23 -33
  28. package/dist/shared/{define-config.d-Sf3K9yNa.d.mts → define-config.d-Dm9iNdt9.d.mts} +23 -33
  29. package/dist/shared/{load-config--4dZSqAQ.mjs → load-config-CV_7wWhH.mjs} +1 -1
  30. package/dist/shared/{load-config-CT3T7nfY.cjs → load-config-DegJq4hI.cjs} +1 -1
  31. package/dist/shared/{src-HTcyNJiS.cjs → src-BDUsoOnL.cjs} +28 -47
  32. package/dist/shared/{src-CXLmg0t5.mjs → src-CJu4NZI4.mjs} +329 -1505
  33. package/dist/{src-CB1SRiRS.js → src-CBsKC-xF.js} +29 -48
  34. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
1
+ import { BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
2
2
  import path from "pathe";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import colors from "ansis";
5
5
 
6
6
  //#region package.json
7
- var version = "1.0.0-beta.9-commit.8371a90";
7
+ var version = "1.0.0-beta.9-commit.b174110";
8
8
 
9
9
  //#endregion
10
10
  //#region src/builtin-plugin/utils.ts
@@ -1602,17 +1602,13 @@ const ModuleTypesSchema = record(string(), union([
1602
1602
  literal("tsx")
1603
1603
  ]));
1604
1604
  const JsxOptionsSchema = strictObject({
1605
+ runtime: pipe(optional(union([literal("classic"), literal("automatic")])), description("Which runtime to use")),
1605
1606
  development: pipe(optional(boolean()), description("Development specific information")),
1606
- factory: pipe(optional(string()), description("Jsx element transformation")),
1607
- fragment: pipe(optional(string()), description("Jsx fragment transformation")),
1607
+ throwIfNamespace: pipe(optional(string()), description("Toggles whether to throw an error when a tag name uses an XML namespace")),
1608
1608
  importSource: pipe(optional(string()), description("Import the factory of element and fragment if mode is classic")),
1609
- jsxImportSource: pipe(optional(string()), description("Import the factory of element and fragment if mode is automatic")),
1610
- mode: pipe(optional(union([
1611
- literal("classic"),
1612
- literal("automatic"),
1613
- literal("preserve")
1614
- ])), description("Jsx transformation mode")),
1615
- refresh: pipe(optional(boolean()), description("React refresh transformation"))
1609
+ pragma: pipe(optional(string()), description("Jsx element transformation")),
1610
+ pragmaFlag: pipe(optional(string()), description("Jsx fragment transformation")),
1611
+ refresh: pipe(optional(boolean()), description("Enable react fast refresh"))
1616
1612
  });
1617
1613
  const HelperModeSchema = union([literal("Runtime"), literal("External")]);
1618
1614
  const DecoratorOptionSchema = object({
@@ -1648,7 +1644,9 @@ const TransformOptionsSchema = object({
1648
1644
  assumptions: optional(AssumptionsSchema),
1649
1645
  typescript: optional(TypescriptSchema),
1650
1646
  helpers: optional(HelpersSchema),
1651
- decorators: optional(DecoratorOptionSchema)
1647
+ decorators: optional(DecoratorOptionSchema),
1648
+ jsx: optional(JsxOptionsSchema),
1649
+ target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment"))
1652
1650
  });
1653
1651
  const WatchOptionsSchema = strictObject({
1654
1652
  chokidar: optional(never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
@@ -1736,13 +1734,12 @@ const InputOptionsSchema = strictObject({
1736
1734
  define: pipe(optional(record(string(), string())), description("Define global variables")),
1737
1735
  inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
1738
1736
  profilerNames: optional(boolean()),
1739
- jsx: optional(union([
1740
- boolean(),
1741
- JsxOptionsSchema,
1742
- string("react"),
1743
- string("react-jsx"),
1744
- string("preserve")
1745
- ])),
1737
+ jsx: pipe(optional(union([
1738
+ literal(false),
1739
+ literal("react"),
1740
+ literal("react-jsx"),
1741
+ literal("preserve")
1742
+ ])), description("Jsx options preset")),
1746
1743
  transform: optional(TransformOptionsSchema),
1747
1744
  watch: optional(union([WatchOptionsSchema, literal(false)])),
1748
1745
  dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
@@ -1754,8 +1751,7 @@ const InputCliOverrideSchema = strictObject({
1754
1751
  input: pipe(optional(array(string())), description("Entry file")),
1755
1752
  external: pipe(optional(array(string())), description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
1756
1753
  inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
1757
- treeshake: pipe(optional(boolean()), description("enable treeshaking")),
1758
- jsx: pipe(optional(JsxOptionsSchema), description("enable jsx"))
1754
+ treeshake: pipe(optional(boolean()), description("enable treeshaking"))
1759
1755
  });
1760
1756
  const InputCliOptionsSchema = omit(strictObject({
1761
1757
  ...InputOptionsSchema.entries,
@@ -1849,7 +1845,6 @@ const OutputOptionsSchema = strictObject({
1849
1845
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
1850
1846
  plugins: optional(custom(() => true)),
1851
1847
  polyfillRequire: pipe(optional(boolean()), description("Disable require polyfill injection")),
1852
- target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
1853
1848
  hoistTransitiveImports: optional(custom((input) => {
1854
1849
  if (input) return false;
1855
1850
  return true;
@@ -1956,7 +1951,7 @@ var NormalizedInputOptionsImpl = class {
1956
1951
 
1957
1952
  //#endregion
1958
1953
  //#region src/types/sourcemap.ts
1959
- function bindingifySourcemap$1(map) {
1954
+ function bindingifySourcemap(map) {
1960
1955
  if (map == null) return;
1961
1956
  return { inner: typeof map === "string" ? map : {
1962
1957
  file: map.file ?? void 0,
@@ -2655,7 +2650,7 @@ function bindingifyTransform(args$1) {
2655
2650
  });
2656
2651
  return {
2657
2652
  code: ret.code,
2658
- map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id$1, code$1, ret.map)),
2653
+ map: bindingifySourcemap(normalizeTransformHookSourcemap(id$1, code$1, ret.map)),
2659
2654
  sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects),
2660
2655
  moduleType: ret.moduleType
2661
2656
  };
@@ -2681,7 +2676,7 @@ function bindingifyLoad(args$1) {
2681
2676
  let map = preProcessSourceMap(ret, id$1);
2682
2677
  return {
2683
2678
  code: ret.code,
2684
- map: bindingifySourcemap$1(map),
2679
+ map: bindingifySourcemap(map),
2685
2680
  moduleType: ret.moduleType,
2686
2681
  sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects)
2687
2682
  };
@@ -2787,7 +2782,7 @@ function bindingifyOutputOptions(outputOptions) {
2787
2782
  format: bindingifyFormat(format),
2788
2783
  exports,
2789
2784
  hashCharacters,
2790
- sourcemap: bindingifySourcemap(sourcemap),
2785
+ sourcemap: bindingifySourcemap$1(sourcemap),
2791
2786
  sourcemapDebugIds,
2792
2787
  sourcemapIgnoreList: bindingifySourcemapIgnoreList(sourcemapIgnoreList),
2793
2788
  sourcemapPathTransform,
@@ -2810,7 +2805,6 @@ function bindingifyOutputOptions(outputOptions) {
2810
2805
  inlineDynamicImports: outputOptions.inlineDynamicImports,
2811
2806
  advancedChunks: outputOptions.advancedChunks,
2812
2807
  polyfillRequire: outputOptions.polyfillRequire,
2813
- target: outputOptions.target,
2814
2808
  sanitizeFileName,
2815
2809
  preserveModules,
2816
2810
  virtualDirname,
@@ -2838,7 +2832,7 @@ function bindingifyFormat(format) {
2838
2832
  default: unimplemented(`output.format: ${format}`);
2839
2833
  }
2840
2834
  }
2841
- function bindingifySourcemap(sourcemap) {
2835
+ function bindingifySourcemap$1(sourcemap) {
2842
2836
  switch (sourcemap) {
2843
2837
  case true: return "file";
2844
2838
  case "inline": return "inline";
@@ -3104,7 +3098,7 @@ function collectChangedBundle(changed, bundle) {
3104
3098
  facadeModuleId: item.facadeModuleId || void 0,
3105
3099
  isDynamicEntry: item.isDynamicEntry,
3106
3100
  moduleIds: item.moduleIds,
3107
- map: bindingifySourcemap$1(item.map),
3101
+ map: bindingifySourcemap(item.map),
3108
3102
  sourcemapFilename: item.sourcemapFileName || void 0,
3109
3103
  preliminaryFilename: item.preliminaryFileName
3110
3104
  });
@@ -3142,7 +3136,7 @@ function bindingifyRenderChunk(args$1) {
3142
3136
  if (!ret.map) return { code: ret.code };
3143
3137
  return {
3144
3138
  code: ret.code,
3145
- map: bindingifySourcemap$1(ret.map)
3139
+ map: bindingifySourcemap(ret.map)
3146
3140
  };
3147
3141
  },
3148
3142
  meta: bindingifyPluginHookMeta(meta),
@@ -3708,25 +3702,12 @@ function bindingifyInput(input) {
3708
3702
  }
3709
3703
  function bindingifyJsx(input) {
3710
3704
  switch (input) {
3711
- case false: return { type: "Disable" };
3712
- case "react": return { type: "React" };
3713
- case "react-jsx": return { type: "ReactJsx" };
3714
- case "preserve": return { type: "Preserve" };
3715
- case void 0: return void 0;
3705
+ case false: return BindingJsx.Disable;
3706
+ case "react": return BindingJsx.React;
3707
+ case "react-jsx": return BindingJsx.ReactJsx;
3708
+ case "preserve": return BindingJsx.Preserve;
3709
+ default: return void 0;
3716
3710
  }
3717
- if (input.mode === "preserve") return { type: "Preserve" };
3718
- const mode = input.mode ?? "automatic";
3719
- return {
3720
- type: "Enable",
3721
- field0: {
3722
- runtime: mode,
3723
- importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0,
3724
- pragma: input.factory,
3725
- pragmaFrag: input.fragment,
3726
- development: input.development,
3727
- refresh: input.refresh
3728
- }
3729
- };
3730
3711
  }
3731
3712
  function bindingifyWatch(watch$1) {
3732
3713
  if (watch$1) return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolldown/browser",
3
- "version": "1.0.0-beta.9-commit.8371a90",
3
+ "version": "1.0.0-beta.9-commit.b174110",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "type": "module",