Skip to content

Commit 3c971e2

Browse files
committed
update build-targets
1 parent 95d694e commit 3c971e2

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

.local.dic

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BelongsTo
2222
blockquote
2323
blogPost
2424
bookmarklet
25-
Browserlist
25+
Browserslist
2626
callouts
2727
camelize
2828
centric
@@ -179,6 +179,7 @@ rerender
179179
rerendering
180180
rerenders
181181
RequestManager
182+
Rollup
182183
routable
183184
RunDOC
184185
runnable
@@ -218,6 +219,7 @@ templating
218219
TextMate
219220
todo
220221
todos
222+
toolchain
221223
tooltip
222224
tooltips
223225
trackable

guides/release/configuring-ember/build-targets.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
By default, Ember apps are built with Vite. The toolchain uses Babel (alongside modern compilers like esbuild/Rollup) so you can write current-generation JavaScript and TypeScript with confidence.
1+
By default, Ember apps are built with Vite. The toolchain uses Babel, esbuild, and Rollup so you can write current-generation JavaScript and TypeScript while still allowing your application to work with older browsers.
22

33
Rather than always compiling everything down to legacy syntax, Ember determines what—if anything—needs to be transformed based on the browsers you target. With today’s defaults aimed at evergreen browsers, many features (ES modules, classes, arrow functions, async/await, etc.) ship largely as-is.
44

5-
Why does this matter? Over-transpiling to very old JavaScript increases bundle size and slows parsing. As the web platform has advanced and legacy browsers have faded, Ember’s defaults avoid unnecessary transforms to keep apps smaller and faster.
5+
Why does this matter? Over-transpiling to very old JavaScript increases bundle size, slows parsing, and in some cases can slow down the execution of your JavaScript code. As the Web platform has advanced and percentage of users on legacy browsers have decreased, Ember’s default targets avoid unnecessary transforms to keep apps smaller and faster.
66

7-
That’s why the build respects your browser targets: set the targets for your app and the compiler applies only the minimal transforms and polyfills required for those browsers.
7+
If you need to update the defaults for any reason (i.e. need to target a very legacy browser), you can set the targets for your app and the compiler applies only the minimal transforms and polyfills required for those browsers.
88

99
If you open `config/targets.js`, you will find the following code:
1010

@@ -22,7 +22,7 @@ module.exports = {
2222
};
2323
```
2424

25-
If you inspect the compiled code, youll see many modern features (like arrow functions and async/await) preserved when your targets support them.
25+
If you inspect your compiled code after running a build with `npm run build`, you'll see that many modern features (like arrow functions and async/await) preserved when your targets support them.
2626

2727
This feature is backed by [Browserslist](https://github.com/ai/browserslist) and [Can I Use](https://caniuse.com/).
2828
These websites track usage stats of browsers, so you can use complex queries based on the user base of every browser.
@@ -37,9 +37,3 @@ module.exports = {
3737
```
3838

3939
It is very important that you properly configure the targets of your app so you get the smallest and fastest code possible.
40-
41-
Build targets can also be leveraged in other ways.
42-
43-
Some addons might conditionally include polyfills only if needed.
44-
Some linters may emit warnings when using features not yet fully supported in your targets.
45-
Some addons may even automatically prefix unsupported CSS properties.

0 commit comments

Comments
 (0)