Skip to content

Commit 53b2de8

Browse files
authored
Merge pull request #20675 from emberjs/build-reform
Build reform
2 parents 3f2f2ef + 16e4385 commit 53b2de8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3625
-4269
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ module.exports = {
144144
// matches all node-land files
145145
files: [
146146
'.eslintrc.js',
147+
'rollup.config.mjs',
148+
'babel.config.mjs',
149+
'babel.test.config.mjs',
147150
'node-tests/**/*.js',
148151
'tests/node/**/*.js',
149152
'blueprints/**/*.js',

.github/workflows/ci.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- uses: actions/checkout@v3
7373
- uses: ./.github/actions/setup
7474
- name: build
75-
run: pnpm ember build
75+
run: pnpm vite build --mode=development
7676
- name: Upload build
7777
uses: actions/upload-artifact@v3
7878
with:
@@ -99,30 +99,27 @@ jobs:
9999
OVERRIDE_DEPRECATION_VERSION: "15.0.0"
100100
ENABLE_OPTIONAL_FEATURES: "true"
101101
- name: "Production build"
102-
BUILD: "-prod"
102+
BUILD: "production"
103103
- name: "Production build, with optional features"
104-
BUILD: "-prod"
104+
BUILD: "production"
105105
ENABLE_OPTIONAL_FEATURES: "true"
106106
- name: "Extend prototypes"
107107
EXTEND_PROTOTYPES: "true"
108108
- name: "Extend prototypes, with optional features"
109109
EXTEND_PROTOTYPES: "true"
110110
ENABLE_OPTIONAL_FEATURES: "true"
111-
- name: "Prebuilt"
112-
PREBUILT: "true"
113111

114112
steps:
115113
- uses: actions/checkout@v3
116114
- uses: ./.github/actions/setup
117115
- name: build
118-
run: pnpm ember build ${{ matrix.BUILD }}
116+
run: pnpm vite build --mode=${{ matrix.BUILD || 'development' }}
119117
- name: test
120118
env:
121119
ALL_DEPRECATIONS_ENABLED: ${{ matrix.ALL_DEPRECATIONS_ENABLED }}
122120
OVERRIDE_DEPRECATION_VERSION: ${{ matrix.OVERRIDE_DEPRECATION_VERSION }}
123121
EXTEND_PROTOTYPES: ${{ matrix.EXTEND_PROTOTYPES }}
124122
ENABLE_OPTIONAL_FEATURES: ${{ matrix.ENABLE_OPTIONAL_FEATURES }}
125-
PREBUIlT: ${{ matrix.PREBUILT }}
126123

127124
run: pnpm test
128125

@@ -135,8 +132,8 @@ jobs:
135132
- uses: ./.github/actions/setup
136133
- name: build
137134
env:
138-
SHOULD_TRANSPILE: true
139-
run: pnpm ember build
135+
ALL_SUPPORTED_BROWSERS: true
136+
run: pnpm vite build --mode=development
140137

141138
- name: Set BrowserStack Local Identifier
142139
if: startsWith(github.ref, 'refs/tags/v')
@@ -163,7 +160,7 @@ jobs:
163160
- uses: actions/checkout@v3
164161
- uses: ./.github/actions/setup
165162
- name: build
166-
run: pnpm ember build -prod
163+
run: pnpm build
167164
- name: test
168165
working-directory: smoke-tests/scenarios
169166
run: |
@@ -179,7 +176,7 @@ jobs:
179176
- name: build
180177
env:
181178
SHOULD_TRANSPILE_FOR_NODE: true
182-
run: pnpm ember build -prod
179+
run: pnpm build
183180
- name: test
184181
run: pnpm test:node
185182

@@ -210,7 +207,7 @@ jobs:
210207
firefox-version: 102.0.1
211208
- run: firefox --version
212209
- name: test
213-
run: pnpm ember test -c testem.ci-browsers.js
210+
run: pnpm ember test --path dist -c testem.ci-browsers.js
214211

215212
deploy-tag:
216213
name: Deploy tags to npm

babel.config.mjs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
This babel config governs how Ember gets built for publication. Features that
3+
remain un-transpiled until used by an app are not handled here.
4+
5+
See babel.test.config.mjs for the extension to this config that governs our
6+
test suite.
7+
*/
8+
9+
import { resolve, dirname } from 'node:path';
10+
import { fileURLToPath } from 'node:url';
11+
12+
export default {
13+
plugins: [
14+
[
15+
'@babel/plugin-transform-typescript',
16+
{
17+
allowDeclareFields: true,
18+
},
19+
],
20+
[
21+
'module:decorator-transforms',
22+
{
23+
runEarly: true,
24+
runtime: { import: 'decorator-transforms/runtime' },
25+
},
26+
],
27+
[
28+
'babel-plugin-ember-template-compilation',
29+
{
30+
compilerPath: resolve(
31+
dirname(fileURLToPath(import.meta.url)),
32+
'./broccoli/glimmer-template-compiler'
33+
),
34+
},
35+
],
36+
],
37+
};

babel.test.config.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
This babel config governs Ember's test suite. It transpiles some things that
3+
our published build should not (because those things are left for apps to
4+
decide).
5+
6+
See babel.config.mjs for the base config that's used for building for
7+
publication.
8+
*/
9+
10+
import { createRequire } from 'node:module';
11+
import vmBabelPlugins from '@glimmer/vm-babel-plugins';
12+
import baseConfig from './babel.config.mjs';
13+
14+
const require = createRequire(import.meta.url);
15+
const buildDebugMacroPlugin = require('./broccoli/build-debug-macro-plugin.js');
16+
const isProduction = process.env.EMBER_ENV === 'production';
17+
18+
export default {
19+
...baseConfig,
20+
21+
presets: [
22+
[
23+
'@babel/preset-env',
24+
{
25+
targets: require('./config/targets.js'),
26+
},
27+
],
28+
],
29+
30+
plugins: [
31+
...baseConfig.plugins,
32+
buildDebugMacroPlugin(!isProduction),
33+
...vmBabelPlugins({ isDebug: !isProduction }),
34+
],
35+
};

bin/run-tests.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ const variants = [
2525
// This enables all canary feature flags for unreleased feature within Ember
2626
// itself.
2727
'ENABLE_OPTIONAL_FEATURES',
28-
29-
// This forces the test suite to run against the prepackaged copy of
30-
// ember.debug.js that publishes in the ember-source NPM package. That copy is
31-
// essentially an optimization if you happen to be doing development under the
32-
// default babel targets.
33-
'PREBUILT',
3428
];
3529

3630
const chalk = require('chalk');
@@ -73,7 +67,7 @@ function run() {
7367
}
7468
}
7569

76-
let url = 'http://localhost:' + PORT + '/tests/?' + queryString;
70+
let url = 'http://localhost:' + PORT + '/?' + queryString;
7771
return runInBrowser(url, 3);
7872
}
7973

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
/* eslint-disable */
2+
3+
// This file was derived from the output of the classic broccoli-based build of
4+
// ember-template-compiler.js. It's intended to convey exactly how the authored ES modules
5+
// get mapped into backward-compatible AMD defines.
6+
7+
import d from 'amd-compat-entrypoint-definition';
8+
9+
import * as emberinternalsBrowserEnvironmentIndex from '@ember/-internals/browser-environment/index';
10+
d('@ember/-internals/browser-environment/index', emberinternalsBrowserEnvironmentIndex);
11+
12+
import * as emberinternalsEnvironmentIndex from '@ember/-internals/environment/index';
13+
d('@ember/-internals/environment/index', emberinternalsEnvironmentIndex);
14+
15+
import * as emberinternalsUtilsIndex from '@ember/-internals/utils/index';
16+
d('@ember/-internals/utils/index', emberinternalsUtilsIndex);
17+
18+
import * as emberCanaryFeaturesIndex from '@ember/canary-features/index';
19+
d('@ember/canary-features/index', emberCanaryFeaturesIndex);
20+
21+
/*
22+
23+
The classic build included these modules but not their dependencies, so they
24+
never worked. Keeping this comment to document why the list of modules differs in
25+
this way.
26+
27+
import * as emberDebugContainerDebugAdapter from '@ember/debug/container-debug-adapter';
28+
d('@ember/debug/container-debug-adapter', emberDebugContainerDebugAdapter);
29+
30+
import * as emberDebugDataAdapter from '@ember/debug/data-adapter';
31+
d('@ember/debug/data-adapter', emberDebugDataAdapter);
32+
33+
*/
34+
35+
import * as emberDebugIndex from '@ember/debug/index';
36+
d('@ember/debug/index', emberDebugIndex);
37+
38+
import * as emberDebugLibCaptureRenderTree from '@ember/debug/lib/capture-render-tree';
39+
d('@ember/debug/lib/capture-render-tree', emberDebugLibCaptureRenderTree);
40+
41+
import * as emberDebugLibDeprecate from '@ember/debug/lib/deprecate';
42+
d('@ember/debug/lib/deprecate', emberDebugLibDeprecate);
43+
44+
import * as emberDebugLibHandlers from '@ember/debug/lib/handlers';
45+
d('@ember/debug/lib/handlers', emberDebugLibHandlers);
46+
47+
import * as emberDebugLibInspect from '@ember/debug/lib/inspect';
48+
d('@ember/debug/lib/inspect', emberDebugLibInspect);
49+
50+
import * as emberDebugLibTesting from '@ember/debug/lib/testing';
51+
d('@ember/debug/lib/testing', emberDebugLibTesting);
52+
53+
import * as emberDebugLibWarn from '@ember/debug/lib/warn';
54+
d('@ember/debug/lib/warn', emberDebugLibWarn);
55+
56+
import * as emberDeprecatedFeaturesIndex from '@ember/deprecated-features/index';
57+
d('@ember/deprecated-features/index', emberDeprecatedFeaturesIndex);
58+
59+
import * as glimmerCompiler from '@glimmer/compiler';
60+
d('@glimmer/compiler', glimmerCompiler);
61+
62+
import * as glimmerEnv from '@glimmer/env';
63+
d('@glimmer/env', glimmerEnv);
64+
65+
import * as glimmerSyntax from '@glimmer/syntax';
66+
d('@glimmer/syntax', glimmerSyntax);
67+
68+
import * as glimmerUtil from '@glimmer/util';
69+
d('@glimmer/util', glimmerUtil);
70+
71+
import * as glimmerVm from '@glimmer/vm';
72+
d('@glimmer/vm', glimmerVm);
73+
74+
import * as glimmerWireFormat from '@glimmer/wire-format';
75+
d('@glimmer/wire-format', glimmerWireFormat);
76+
77+
import * as handlebarsParserIndex from '@handlebars/parser';
78+
d('@handlebars/parser/index', handlebarsParserIndex);
79+
80+
import * as emberTemplateCompilerIndex from 'ember-template-compiler/index';
81+
d('ember-template-compiler/index', emberTemplateCompilerIndex);
82+
83+
import * as emberTemplateCompilerLibPluginsAssertAgainstAttrs from 'ember-template-compiler/lib/plugins/assert-against-attrs';
84+
d(
85+
'ember-template-compiler/lib/plugins/assert-against-attrs',
86+
emberTemplateCompilerLibPluginsAssertAgainstAttrs
87+
);
88+
89+
import * as emberTemplateCompilerLibPluginsAssertAgainstNamedOutlets from 'ember-template-compiler/lib/plugins/assert-against-named-outlets';
90+
d(
91+
'ember-template-compiler/lib/plugins/assert-against-named-outlets',
92+
emberTemplateCompilerLibPluginsAssertAgainstNamedOutlets
93+
);
94+
95+
import * as emberTemplateCompilerLibPluginsAssertInputHelperWithoutBlock from 'ember-template-compiler/lib/plugins/assert-input-helper-without-block';
96+
d(
97+
'ember-template-compiler/lib/plugins/assert-input-helper-without-block',
98+
emberTemplateCompilerLibPluginsAssertInputHelperWithoutBlock
99+
);
100+
101+
import * as emberTemplateCompilerLibPluginsAssertReservedNamedArguments from 'ember-template-compiler/lib/plugins/assert-reserved-named-arguments';
102+
d(
103+
'ember-template-compiler/lib/plugins/assert-reserved-named-arguments',
104+
emberTemplateCompilerLibPluginsAssertReservedNamedArguments
105+
);
106+
107+
import * as emberTemplateCompilerLibPluginsIndex from 'ember-template-compiler/lib/plugins/index';
108+
d('ember-template-compiler/lib/plugins/index', emberTemplateCompilerLibPluginsIndex);
109+
110+
import * as emberTemplateCompilerLibPluginsTransformActionSyntax from 'ember-template-compiler/lib/plugins/transform-action-syntax';
111+
d(
112+
'ember-template-compiler/lib/plugins/transform-action-syntax',
113+
emberTemplateCompilerLibPluginsTransformActionSyntax
114+
);
115+
116+
import * as emberTemplateCompilerLibPluginsTransformEachInIntoEach from 'ember-template-compiler/lib/plugins/transform-each-in-into-each';
117+
d(
118+
'ember-template-compiler/lib/plugins/transform-each-in-into-each',
119+
emberTemplateCompilerLibPluginsTransformEachInIntoEach
120+
);
121+
122+
import * as emberTemplateCompilerLibPluginsTransformEachTrackArray from 'ember-template-compiler/lib/plugins/transform-each-track-array';
123+
d(
124+
'ember-template-compiler/lib/plugins/transform-each-track-array',
125+
emberTemplateCompilerLibPluginsTransformEachTrackArray
126+
);
127+
128+
import * as emberTemplateCompilerLibPluginsTransformInElement from 'ember-template-compiler/lib/plugins/transform-in-element';
129+
d(
130+
'ember-template-compiler/lib/plugins/transform-in-element',
131+
emberTemplateCompilerLibPluginsTransformInElement
132+
);
133+
134+
import * as emberTemplateCompilerLibPluginsTransformQuotedBindingsIntoJustBindings from 'ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings';
135+
d(
136+
'ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings',
137+
emberTemplateCompilerLibPluginsTransformQuotedBindingsIntoJustBindings
138+
);
139+
140+
import * as emberTemplateCompilerLibPluginsTransformResolutions from 'ember-template-compiler/lib/plugins/transform-resolutions';
141+
d(
142+
'ember-template-compiler/lib/plugins/transform-resolutions',
143+
emberTemplateCompilerLibPluginsTransformResolutions
144+
);
145+
146+
import * as emberTemplateCompilerLibPluginsTransformWrapMountAndOutlet from 'ember-template-compiler/lib/plugins/transform-wrap-mount-and-outlet';
147+
d(
148+
'ember-template-compiler/lib/plugins/transform-wrap-mount-and-outlet',
149+
emberTemplateCompilerLibPluginsTransformWrapMountAndOutlet
150+
);
151+
152+
import * as emberTemplateCompilerLibPluginsUtils from 'ember-template-compiler/lib/plugins/utils';
153+
d('ember-template-compiler/lib/plugins/utils', emberTemplateCompilerLibPluginsUtils);
154+
155+
import * as emberTemplateCompilerLibPublicApi from 'ember-template-compiler/lib/public-api';
156+
d('ember-template-compiler/lib/public-api', emberTemplateCompilerLibPublicApi);
157+
158+
import * as emberTemplateCompilerLibSystemBootstrap from 'ember-template-compiler/lib/system/bootstrap';
159+
d('ember-template-compiler/lib/system/bootstrap', emberTemplateCompilerLibSystemBootstrap);
160+
161+
import * as emberTemplateCompilerLibSystemCalculateLocationDisplay from 'ember-template-compiler/lib/system/calculate-location-display';
162+
d(
163+
'ember-template-compiler/lib/system/calculate-location-display',
164+
emberTemplateCompilerLibSystemCalculateLocationDisplay
165+
);
166+
167+
import * as emberTemplateCompilerLibSystemCompileOptions from 'ember-template-compiler/lib/system/compile-options';
168+
d(
169+
'ember-template-compiler/lib/system/compile-options',
170+
emberTemplateCompilerLibSystemCompileOptions
171+
);
172+
173+
import * as emberTemplateCompilerLibSystemCompile from 'ember-template-compiler/lib/system/compile';
174+
d('ember-template-compiler/lib/system/compile', emberTemplateCompilerLibSystemCompile);
175+
176+
import * as emberTemplateCompilerLibSystemDasherizeComponentName from 'ember-template-compiler/lib/system/dasherize-component-name';
177+
d(
178+
'ember-template-compiler/lib/system/dasherize-component-name',
179+
emberTemplateCompilerLibSystemDasherizeComponentName
180+
);
181+
182+
import * as emberTemplateCompilerLibSystemInitializer from 'ember-template-compiler/lib/system/initializer';
183+
d('ember-template-compiler/lib/system/initializer', emberTemplateCompilerLibSystemInitializer);
184+
185+
import * as emberTemplateCompilerLibSystemPrecompile from 'ember-template-compiler/lib/system/precompile';
186+
d('ember-template-compiler/lib/system/precompile', emberTemplateCompilerLibSystemPrecompile);
187+
188+
import * as emberTemplateCompilerLibTypes from 'ember-template-compiler/lib/types';
189+
d('ember-template-compiler/lib/types', emberTemplateCompilerLibTypes);
190+
191+
import * as emberTemplateCompilerMinimal from 'ember-template-compiler/minimal';
192+
d('ember-template-compiler/minimal', emberTemplateCompilerMinimal);
193+
194+
import * as emberVersion from 'ember/version';
195+
d('ember/version', emberVersion);
196+
197+
import * as simpleHtmlTokenizer from 'simple-html-tokenizer';
198+
d('simple-html-tokenizer', simpleHtmlTokenizer);
199+
200+
if (typeof module === 'object' && module.exports) {
201+
module.exports = emberTemplateCompilerIndex;
202+
}

0 commit comments

Comments
 (0)