-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build reform #20675
Build reform #20675
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
This babel config governs how Ember gets built for publication. Features that | ||
remain un-transpiled until used by an app are not handled here. | ||
|
||
See babel.test.config.mjs for the extension to this config that governs our | ||
test suite. | ||
*/ | ||
|
||
import { resolve, dirname } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
export default { | ||
plugins: [ | ||
[ | ||
'@babel/plugin-transform-typescript', | ||
{ | ||
allowDeclareFields: true, | ||
}, | ||
], | ||
[ | ||
'module:decorator-transforms', | ||
{ | ||
runEarly: true, | ||
runtime: { import: 'decorator-transforms/runtime' }, | ||
}, | ||
], | ||
[ | ||
'babel-plugin-ember-template-compilation', | ||
{ | ||
compilerPath: resolve( | ||
dirname(fileURLToPath(import.meta.url)), | ||
'./broccoli/glimmer-template-compiler' | ||
), | ||
}, | ||
], | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
This babel config governs Ember's test suite. It transpiles some things that | ||
our published build should not (because those things are left for apps to | ||
decide). | ||
|
||
See babel.config.mjs for the base config that's used for building for | ||
publication. | ||
*/ | ||
|
||
import { createRequire } from 'node:module'; | ||
import vmBabelPlugins from '@glimmer/vm-babel-plugins'; | ||
import baseConfig from './babel.config.mjs'; | ||
|
||
const require = createRequire(import.meta.url); | ||
const buildDebugMacroPlugin = require('./broccoli/build-debug-macro-plugin.js'); | ||
const isProduction = process.env.EMBER_ENV === 'production'; | ||
|
||
export default { | ||
...baseConfig, | ||
|
||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: require('./config/targets.js'), | ||
}, | ||
], | ||
], | ||
|
||
plugins: [ | ||
...baseConfig.plugins, | ||
buildDebugMacroPlugin(!isProduction), | ||
...vmBabelPlugins({ isDebug: !isProduction }), | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
/* eslint-disable */ | ||
|
||
// This file was derived from the output of the classic broccoli-based build of | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My intent for these three Instead, new modules should ship like normal addon modules from treeForAddon. The rationale here is that moving existing modules out of vendor.js is a breaking change. But new modules that have never been in vendor.js can avoid ever going there. This PR doesn't introduce any new modules doing things the new way, but I intend to do that in my next PR. |
||
// ember-template-compiler.js. It's intended to convey exactly how the authored ES modules | ||
// get mapped into backward-compatible AMD defines. | ||
|
||
import d from 'amd-compat-entrypoint-definition'; | ||
|
||
import * as emberinternalsBrowserEnvironmentIndex from '@ember/-internals/browser-environment/index'; | ||
d('@ember/-internals/browser-environment/index', emberinternalsBrowserEnvironmentIndex); | ||
|
||
import * as emberinternalsEnvironmentIndex from '@ember/-internals/environment/index'; | ||
d('@ember/-internals/environment/index', emberinternalsEnvironmentIndex); | ||
|
||
import * as emberinternalsUtilsIndex from '@ember/-internals/utils/index'; | ||
d('@ember/-internals/utils/index', emberinternalsUtilsIndex); | ||
|
||
import * as emberCanaryFeaturesIndex from '@ember/canary-features/index'; | ||
d('@ember/canary-features/index', emberCanaryFeaturesIndex); | ||
|
||
/* | ||
|
||
The classic build included these modules but not their dependencies, so they | ||
never worked. Keeping this comment to document why the list of modules differs in | ||
this way. | ||
|
||
import * as emberDebugContainerDebugAdapter from '@ember/debug/container-debug-adapter'; | ||
d('@ember/debug/container-debug-adapter', emberDebugContainerDebugAdapter); | ||
|
||
import * as emberDebugDataAdapter from '@ember/debug/data-adapter'; | ||
d('@ember/debug/data-adapter', emberDebugDataAdapter); | ||
|
||
*/ | ||
|
||
import * as emberDebugIndex from '@ember/debug/index'; | ||
d('@ember/debug/index', emberDebugIndex); | ||
|
||
import * as emberDebugLibCaptureRenderTree from '@ember/debug/lib/capture-render-tree'; | ||
d('@ember/debug/lib/capture-render-tree', emberDebugLibCaptureRenderTree); | ||
|
||
import * as emberDebugLibDeprecate from '@ember/debug/lib/deprecate'; | ||
d('@ember/debug/lib/deprecate', emberDebugLibDeprecate); | ||
|
||
import * as emberDebugLibHandlers from '@ember/debug/lib/handlers'; | ||
d('@ember/debug/lib/handlers', emberDebugLibHandlers); | ||
|
||
import * as emberDebugLibInspect from '@ember/debug/lib/inspect'; | ||
d('@ember/debug/lib/inspect', emberDebugLibInspect); | ||
|
||
import * as emberDebugLibTesting from '@ember/debug/lib/testing'; | ||
d('@ember/debug/lib/testing', emberDebugLibTesting); | ||
|
||
import * as emberDebugLibWarn from '@ember/debug/lib/warn'; | ||
d('@ember/debug/lib/warn', emberDebugLibWarn); | ||
|
||
import * as emberDeprecatedFeaturesIndex from '@ember/deprecated-features/index'; | ||
d('@ember/deprecated-features/index', emberDeprecatedFeaturesIndex); | ||
|
||
import * as glimmerCompiler from '@glimmer/compiler'; | ||
d('@glimmer/compiler', glimmerCompiler); | ||
|
||
import * as glimmerEnv from '@glimmer/env'; | ||
d('@glimmer/env', glimmerEnv); | ||
|
||
import * as glimmerSyntax from '@glimmer/syntax'; | ||
d('@glimmer/syntax', glimmerSyntax); | ||
|
||
import * as glimmerUtil from '@glimmer/util'; | ||
d('@glimmer/util', glimmerUtil); | ||
|
||
import * as glimmerVm from '@glimmer/vm'; | ||
d('@glimmer/vm', glimmerVm); | ||
|
||
import * as glimmerWireFormat from '@glimmer/wire-format'; | ||
d('@glimmer/wire-format', glimmerWireFormat); | ||
|
||
import * as handlebarsParserIndex from '@handlebars/parser'; | ||
d('@handlebars/parser/index', handlebarsParserIndex); | ||
|
||
import * as emberTemplateCompilerIndex from 'ember-template-compiler/index'; | ||
d('ember-template-compiler/index', emberTemplateCompilerIndex); | ||
|
||
import * as emberTemplateCompilerLibPluginsAssertAgainstAttrs from 'ember-template-compiler/lib/plugins/assert-against-attrs'; | ||
d( | ||
'ember-template-compiler/lib/plugins/assert-against-attrs', | ||
emberTemplateCompilerLibPluginsAssertAgainstAttrs | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsAssertAgainstNamedOutlets from 'ember-template-compiler/lib/plugins/assert-against-named-outlets'; | ||
d( | ||
'ember-template-compiler/lib/plugins/assert-against-named-outlets', | ||
emberTemplateCompilerLibPluginsAssertAgainstNamedOutlets | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsAssertInputHelperWithoutBlock from 'ember-template-compiler/lib/plugins/assert-input-helper-without-block'; | ||
d( | ||
'ember-template-compiler/lib/plugins/assert-input-helper-without-block', | ||
emberTemplateCompilerLibPluginsAssertInputHelperWithoutBlock | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsAssertReservedNamedArguments from 'ember-template-compiler/lib/plugins/assert-reserved-named-arguments'; | ||
d( | ||
'ember-template-compiler/lib/plugins/assert-reserved-named-arguments', | ||
emberTemplateCompilerLibPluginsAssertReservedNamedArguments | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsIndex from 'ember-template-compiler/lib/plugins/index'; | ||
d('ember-template-compiler/lib/plugins/index', emberTemplateCompilerLibPluginsIndex); | ||
|
||
import * as emberTemplateCompilerLibPluginsTransformActionSyntax from 'ember-template-compiler/lib/plugins/transform-action-syntax'; | ||
d( | ||
'ember-template-compiler/lib/plugins/transform-action-syntax', | ||
emberTemplateCompilerLibPluginsTransformActionSyntax | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsTransformEachInIntoEach from 'ember-template-compiler/lib/plugins/transform-each-in-into-each'; | ||
d( | ||
'ember-template-compiler/lib/plugins/transform-each-in-into-each', | ||
emberTemplateCompilerLibPluginsTransformEachInIntoEach | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsTransformEachTrackArray from 'ember-template-compiler/lib/plugins/transform-each-track-array'; | ||
d( | ||
'ember-template-compiler/lib/plugins/transform-each-track-array', | ||
emberTemplateCompilerLibPluginsTransformEachTrackArray | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsTransformInElement from 'ember-template-compiler/lib/plugins/transform-in-element'; | ||
d( | ||
'ember-template-compiler/lib/plugins/transform-in-element', | ||
emberTemplateCompilerLibPluginsTransformInElement | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsTransformQuotedBindingsIntoJustBindings from 'ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings'; | ||
d( | ||
'ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings', | ||
emberTemplateCompilerLibPluginsTransformQuotedBindingsIntoJustBindings | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsTransformResolutions from 'ember-template-compiler/lib/plugins/transform-resolutions'; | ||
d( | ||
'ember-template-compiler/lib/plugins/transform-resolutions', | ||
emberTemplateCompilerLibPluginsTransformResolutions | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsTransformWrapMountAndOutlet from 'ember-template-compiler/lib/plugins/transform-wrap-mount-and-outlet'; | ||
d( | ||
'ember-template-compiler/lib/plugins/transform-wrap-mount-and-outlet', | ||
emberTemplateCompilerLibPluginsTransformWrapMountAndOutlet | ||
); | ||
|
||
import * as emberTemplateCompilerLibPluginsUtils from 'ember-template-compiler/lib/plugins/utils'; | ||
d('ember-template-compiler/lib/plugins/utils', emberTemplateCompilerLibPluginsUtils); | ||
|
||
import * as emberTemplateCompilerLibPublicApi from 'ember-template-compiler/lib/public-api'; | ||
d('ember-template-compiler/lib/public-api', emberTemplateCompilerLibPublicApi); | ||
|
||
import * as emberTemplateCompilerLibSystemBootstrap from 'ember-template-compiler/lib/system/bootstrap'; | ||
d('ember-template-compiler/lib/system/bootstrap', emberTemplateCompilerLibSystemBootstrap); | ||
|
||
import * as emberTemplateCompilerLibSystemCalculateLocationDisplay from 'ember-template-compiler/lib/system/calculate-location-display'; | ||
d( | ||
'ember-template-compiler/lib/system/calculate-location-display', | ||
emberTemplateCompilerLibSystemCalculateLocationDisplay | ||
); | ||
|
||
import * as emberTemplateCompilerLibSystemCompileOptions from 'ember-template-compiler/lib/system/compile-options'; | ||
d( | ||
'ember-template-compiler/lib/system/compile-options', | ||
emberTemplateCompilerLibSystemCompileOptions | ||
); | ||
|
||
import * as emberTemplateCompilerLibSystemCompile from 'ember-template-compiler/lib/system/compile'; | ||
d('ember-template-compiler/lib/system/compile', emberTemplateCompilerLibSystemCompile); | ||
|
||
import * as emberTemplateCompilerLibSystemDasherizeComponentName from 'ember-template-compiler/lib/system/dasherize-component-name'; | ||
d( | ||
'ember-template-compiler/lib/system/dasherize-component-name', | ||
emberTemplateCompilerLibSystemDasherizeComponentName | ||
); | ||
|
||
import * as emberTemplateCompilerLibSystemInitializer from 'ember-template-compiler/lib/system/initializer'; | ||
d('ember-template-compiler/lib/system/initializer', emberTemplateCompilerLibSystemInitializer); | ||
|
||
import * as emberTemplateCompilerLibSystemPrecompile from 'ember-template-compiler/lib/system/precompile'; | ||
d('ember-template-compiler/lib/system/precompile', emberTemplateCompilerLibSystemPrecompile); | ||
|
||
import * as emberTemplateCompilerLibTypes from 'ember-template-compiler/lib/types'; | ||
d('ember-template-compiler/lib/types', emberTemplateCompilerLibTypes); | ||
|
||
import * as emberTemplateCompilerMinimal from 'ember-template-compiler/minimal'; | ||
d('ember-template-compiler/minimal', emberTemplateCompilerMinimal); | ||
|
||
import * as emberVersion from 'ember/version'; | ||
d('ember/version', emberVersion); | ||
|
||
import * as simpleHtmlTokenizer from 'simple-html-tokenizer'; | ||
d('simple-html-tokenizer', simpleHtmlTokenizer); | ||
|
||
if (typeof module === 'object' && module.exports) { | ||
module.exports = emberTemplateCompilerIndex; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This concept stops being useful in this PR. It was very specific to the old optimization where sometimes ember would use a prebuilt bundle and other times it wouldn't.