@embroider/core 3.4.20 → 3.5.0
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.
- package/package.json +5 -5
- package/src/options.d.ts +53 -1
- package/src/options.js +0 -3
- package/src/options.js.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@embroider/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.5.0",
|
4
4
|
"private": false,
|
5
5
|
"description": "A build system for EmberJS applications.",
|
6
6
|
"repository": {
|
@@ -40,8 +40,8 @@
|
|
40
40
|
"semver": "^7.3.5",
|
41
41
|
"typescript-memoize": "^1.0.1",
|
42
42
|
"walk-sync": "^3.0.0",
|
43
|
-
"@embroider/
|
44
|
-
"@embroider/
|
43
|
+
"@embroider/macros": "1.16.10",
|
44
|
+
"@embroider/shared-internals": "2.8.1"
|
45
45
|
},
|
46
46
|
"devDependencies": {
|
47
47
|
"@glimmer/syntax": "^0.84.2",
|
@@ -60,8 +60,8 @@
|
|
60
60
|
"fixturify": "^2.1.1",
|
61
61
|
"tmp": "^0.1.0",
|
62
62
|
"typescript": "^5.1.6",
|
63
|
-
"@embroider/
|
64
|
-
"@embroider/
|
63
|
+
"@embroider/test-support": "0.36.0",
|
64
|
+
"@embroider/sample-transforms": "0.0.0"
|
65
65
|
},
|
66
66
|
"engines": {
|
67
67
|
"node": "12.* || 14.* || >= 16"
|
package/src/options.d.ts
CHANGED
@@ -1,7 +1,58 @@
|
|
1
1
|
export default interface Options {
|
2
|
+
/**
|
3
|
+
* When true, we statically resolve all template helpers at build time. This
|
4
|
+
* causes unused helpers to be left out of the build ("tree shaking" of
|
5
|
+
* helpers).
|
6
|
+
*
|
7
|
+
* Defaults to false, which gives you greater compatibility with classic Ember
|
8
|
+
* apps at the cost of bigger builds.
|
9
|
+
*
|
10
|
+
* Enabling this is a prerequisite for route splitting.
|
11
|
+
*
|
12
|
+
* @deprecated use staticInvokables instead
|
13
|
+
*/
|
2
14
|
staticHelpers?: boolean;
|
15
|
+
/**
|
16
|
+
* When true, we statically resolve all modifiers at build time. This
|
17
|
+
* causes unused modifiers to be left out of the build ("tree shaking" of
|
18
|
+
* modifiers).
|
19
|
+
*
|
20
|
+
* Defaults to false, which gives you greater compatibility with classic Ember
|
21
|
+
* apps at the cost of bigger builds.
|
22
|
+
*
|
23
|
+
* Enabling this is a prerequisite for route splitting.
|
24
|
+
*
|
25
|
+
* @deprecated use staticInvokables instead
|
26
|
+
*/
|
3
27
|
staticModifiers?: boolean;
|
28
|
+
/**
|
29
|
+
* When true, we statically resolve all components at build time. This causes
|
30
|
+
* unused components to be left out of the build ("tree shaking" of
|
31
|
+
* components).
|
32
|
+
*
|
33
|
+
* Defaults to false, which gives you greater compatibility with classic Ember
|
34
|
+
* apps at the cost of bigger builds.
|
35
|
+
*
|
36
|
+
* Enabling this is a prerequisite for route splitting.
|
37
|
+
*
|
38
|
+
* @deprecated use staticInvokables instead
|
39
|
+
*/
|
4
40
|
staticComponents?: boolean;
|
41
|
+
/**
|
42
|
+
* When true, we statically resolve all components, modifiers, and helpers (collectively
|
43
|
+
* knows as Invokables) at build time. This causes any unused Invokables to be left out
|
44
|
+
* of the build if they are unused i.e. "tree shaking".
|
45
|
+
*
|
46
|
+
* Defaults to false which gives you greater compatibility with classic Ember apps at the
|
47
|
+
* cost of bigger builds.
|
48
|
+
*
|
49
|
+
* This setting takes over from `staticHelpers`, `staticModifiers`, and `staticComponents`
|
50
|
+
* because the Developer Experience was less than ideal if any of these settings did not
|
51
|
+
* agree i.e. they all needed to be true or they all needed to be false.
|
52
|
+
*
|
53
|
+
* Enabling this is a prerequisite for route splitting.
|
54
|
+
*/
|
55
|
+
staticInvokables?: boolean;
|
5
56
|
splitAtRoutes?: (RegExp | string)[];
|
6
57
|
staticAppPaths?: string[];
|
7
58
|
skipBabel?: {
|
@@ -16,4 +67,5 @@ export default interface Options {
|
|
16
67
|
es: [string, string[]][];
|
17
68
|
};
|
18
69
|
}
|
19
|
-
export
|
70
|
+
export type CoreOptionsType = Required<Omit<Options, 'staticHelpers' | 'staticModifiers' | 'staticComponents' | 'staticInvokables'>> & Pick<Options, 'staticHelpers' | 'staticModifiers' | 'staticComponents' | 'staticInvokables'>;
|
71
|
+
export declare function optionsWithDefaults(options?: Options): CoreOptionsType;
|
package/src/options.js
CHANGED
@@ -3,9 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.optionsWithDefaults = optionsWithDefaults;
|
4
4
|
function optionsWithDefaults(options) {
|
5
5
|
let defaults = {
|
6
|
-
staticHelpers: false,
|
7
|
-
staticModifiers: false,
|
8
|
-
staticComponents: false,
|
9
6
|
splitAtRoutes: [],
|
10
7
|
staticAppPaths: [],
|
11
8
|
skipBabel: [],
|
package/src/options.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";;AA+JA,kDAYC;AAZD,SAAgB,mBAAmB,CAAC,OAAiB;IACnD,IAAI,QAAQ,GAAG;QACb,aAAa,EAAE,EAAE;QACjB,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,EAAE;QACf,gBAAgB,EAAE,KAAc;KACjC,CAAC;IACF,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["export default interface Options {\n /**\n * When true, we statically resolve all template helpers at build time. This\n * causes unused helpers to be left out of the build (\"tree shaking\" of\n * helpers).\n *\n * Defaults to false, which gives you greater compatibility with classic Ember\n * apps at the cost of bigger builds.\n *\n * Enabling this is a prerequisite for route splitting.\n *\n * @deprecated use staticInvokables instead\n */\n staticHelpers?: boolean;\n\n /**\n * When true, we statically resolve all modifiers at build time. This\n * causes unused modifiers to be left out of the build (\"tree shaking\" of\n * modifiers).\n *\n * Defaults to false, which gives you greater compatibility with classic Ember\n * apps at the cost of bigger builds.\n *\n * Enabling this is a prerequisite for route splitting.\n *\n * @deprecated use staticInvokables instead\n */\n staticModifiers?: boolean;\n\n /**\n * When true, we statically resolve all components at build time. This causes\n * unused components to be left out of the build (\"tree shaking\" of\n * components).\n *\n * Defaults to false, which gives you greater compatibility with classic Ember\n * apps at the cost of bigger builds.\n *\n * Enabling this is a prerequisite for route splitting.\n *\n * @deprecated use staticInvokables instead\n */\n staticComponents?: boolean;\n\n /**\n * When true, we statically resolve all components, modifiers, and helpers (collectively\n * knows as Invokables) at build time. This causes any unused Invokables to be left out\n * of the build if they are unused i.e. \"tree shaking\".\n *\n * Defaults to false which gives you greater compatibility with classic Ember apps at the\n * cost of bigger builds.\n *\n * This setting takes over from `staticHelpers`, `staticModifiers`, and `staticComponents`\n * because the Developer Experience was less than ideal if any of these settings did not\n * agree i.e. they all needed to be true or they all needed to be false.\n *\n * Enabling this is a prerequisite for route splitting.\n */\n staticInvokables?: boolean;\n\n // Enables per-route code splitting. Any route names that match these patterns\n // will be split out of the initial app payload. If you use this, you must\n // also add @embroider/router to your app. See [@embroider/router's\n // README](https://github.com/embroider-build/embroider/blob/main/packages/router/README.md)\n splitAtRoutes?: (RegExp | string)[];\n\n // Every file within your application's `app` directory is categorized as a\n // component, helper, modifier, route, route template, controller, or \"other\".\n //\n // This option lets you decide which \"other\" files should be loaded\n // statically. By default, all \"other\" files will be included in the build and\n // registered with Ember's runtime loader, because we can't know if somebody\n // is going to try to access them dynamically via Ember's resolver or AMD\n // runtime `require`.\n //\n // If you know that your files are only ever imported, you can list them here\n // and then they will only be included exactly where they're needed.\n //\n // Provide a list of directories or files relative to `/app`. For example\n //\n // staticAppPaths: ['lib']\n //\n // means that everything under your-project/app/lib will be loaded statically.\n //\n // This option has no effect on components (which are governed by\n // staticComponents), helpers (which are governed by staticHelpers), modifiers\n // (which are governed by staticModifiers) or the route-specific files (routes,\n // route templates, and controllers which are governed by splitAtRoutes).\n staticAppPaths?: string[];\n\n // By default, all modules that get imported into the app go through Babel, so\n // that all code will conform with your Babel targets. This option allows you\n // to turn Babel off for a particular package. You might need this to work\n // around a transpiler bug or you might use this as a build-performance\n // optimization if you've manually verified that a particular package doesn't\n // need transpilation to be safe in your target browsers.\n skipBabel?: { package: string; semverRange?: string }[];\n\n // This is a performance optimization that can help you avoid the \"Your build\n // is slower because some babel plugins are non-serializable\" penalty. If you\n // provide the locations of known non-serializable objects, we can discover\n // them and make them serializable.\n //\n // resolve is a list of paths to resolve, in a chain. This lets you resolve\n // your dependencies' dependencies, like: resolve: ['your-dependency',\n // 'inner-dependency/lib/transform']\n //\n // useMethod optionally lets you pick which property within the module to use.\n // If not provided, we use the module.exports itself.\n pluginHints?: { resolve: string[]; useMethod?: string }[];\n\n // Ember classically used a runtime AMD module loader.\n //\n // Embroider *can* locate the vast majority of modules statically, but when an\n // addon is doing something highly dynamic (like injecting AMD `define()`\n // statements directly into a <script>), we still may not be able to locate\n // them. So Embroider can emit a placeholder shim for the missing module that\n // attempts to locate it at runtime in the classic AMD loader.\n //\n // This shim can be generated as commonJS (cjs) or an ES module (es). The\n // default is cjs.\n //\n // CJS is useful when you're building in an environment that is tolerant of\n // mixed CJS and ES modules (like Webpack), because the set of exported names\n // from the module doesn't need to be known in advance. For this reason, CJS\n // shims are generated on-demand and are fully-automatic. This is the default\n // for maximum backward-compatibility.\n //\n // ES is useful when you're building in a strict ES module environment (like\n // Vite). It's fully spec-defined and doesn't suffer interoperability\n // complexities. The downside is, we can only emit a correct shim for a module\n // if you tell embroider what set of names it exports. Example:\n\n // emberExternals: {\n // es: [\n // // import { first, second } from \"my-library\";\n // ['my-library', ['first', 'second']],\n // // import Example from \"my-library/components/example\";\n // ['my-library/components/example', ['default']]\n // ];\n // }\n\n // It is not recommended to use `es` mode without also using\n // staticEmberSource, because without staticEmberSource ember itself needs\n // many external shims.\n //\n // false means we don't do any external shimming.\n amdCompatibility?:\n | false\n | 'cjs'\n | {\n es: [string, string[]][];\n };\n}\n\nexport type CoreOptionsType = Required<\n Omit<Options, 'staticHelpers' | 'staticModifiers' | 'staticComponents' | 'staticInvokables'>\n> &\n Pick<Options, 'staticHelpers' | 'staticModifiers' | 'staticComponents' | 'staticInvokables'>;\n\nexport function optionsWithDefaults(options?: Options): CoreOptionsType {\n let defaults = {\n splitAtRoutes: [],\n staticAppPaths: [],\n skipBabel: [],\n pluginHints: [],\n amdCompatibility: 'cjs' as const,\n };\n if (options) {\n return Object.assign(defaults, options);\n }\n return defaults;\n}\n"]}
|