Skip to content

Commit 3b760c0

Browse files
committed
Add new framework: ember
1 parent 19d4896 commit 3b760c0

28 files changed

+30849
-0
lines changed

frameworks/keyed/ember/.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.hbs]
16+
insert_final_newline = false
17+
18+
[*.{diff,md}]
19+
trim_trailing_whitespace = false

frameworks/keyed/ember/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# compiled output
2+
/dist/
3+
/declarations/
4+
5+
6+
# dependencies
7+
/node_modules/
8+
9+
# misc
10+
/.env*
11+
/.pnp*
12+
/.eslintcache
13+
/coverage/
14+
/npm-debug.log*
15+
/testem.log
16+
/yarn-error.log
17+
18+
# ember-try
19+
/.node_modules.ember-try/
20+
/npm-shrinkwrap.json.ember-try
21+
/package.json.ember-try
22+
/package-lock.json.ember-try
23+
/yarn.lock.ember-try
24+
25+
# broccoli-debug
26+
/DEBUG/

frameworks/keyed/ember/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Have to do this because npm doesn't handle >= correctly with pre-releases.
2+
force=true
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Prettier is wrong HTML
2+
*.html
3+
4+
# Unneeded
5+
*.yaml
6+
*.yml
7+
*.md
8+
9+
# unconventional js
10+
/blueprints/*/files/
11+
12+
# compiled output
13+
/dist/
14+
15+
# misc
16+
/coverage/
17+
!.*
18+
.*/
19+
20+
# ember-try
21+
/.node_modules.ember-try/
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
module.exports = {
4+
plugins: ['prettier-plugin-ember-template-tag'],
5+
singleQuote: true,
6+
overrides: [
7+
{
8+
files: ['*.js', '*.ts', '*.cjs', '.mjs', '.cts', '.mts', '.cts'],
9+
options: {
10+
trailingComma: 'es5',
11+
},
12+
},
13+
{
14+
files: ['*.html'],
15+
options: {
16+
singleQuote: false,
17+
},
18+
},
19+
{
20+
files: ['*.json'],
21+
options: {
22+
singleQuote: false,
23+
},
24+
},
25+
{
26+
files: ['*.hbs'],
27+
options: {
28+
singleQuote: false,
29+
},
30+
},
31+
{
32+
files: ['*.gjs', '*.gts'],
33+
options: {
34+
templateSingleQuote: false,
35+
trailingComma: 'es5',
36+
},
37+
},
38+
],
39+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
module.exports = {
4+
extends: 'recommended',
5+
rules: {
6+
'no-forbidden-elements': false,
7+
'no-inline-styles': false,
8+
'style-concatenation': false,
9+
},
10+
};

frameworks/keyed/ember/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ember + js-framework-benchmark
2+
3+
4+
Deviations from the standard vite blueprint
5+
- js-framework-benchmark does not allow us to have a dev-time index.html in the project root. So I disabled hashing on files, and the root index.html is now a static thing that points at the dist directory
6+
- an extra route had to be added to match on explicit `index.html`. No frontend framework wants index.html in the URL, so this is a goofy choice for jsfb.
7+
- this is a _minimal_ project, no compatibility with legacy libraries
8+
- no use of decorators, or the babel decorators transform -- this is because decorators incur a runtime cost, and we use so few of them, the ergonomic wins of decorators are not worth it atm. Once browsers ship native decorators, we can add them back.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const { babelCompatSupport } = require('@embroider/compat/babel');
2+
3+
module.exports = {
4+
plugins: [
5+
[
6+
'babel-plugin-ember-template-compilation',
7+
{
8+
compilerPath: 'ember-source/dist/ember-template-compiler.js',
9+
enableLegacyModules: [
10+
'ember-cli-htmlbars',
11+
'ember-cli-htmlbars-inline-precompile',
12+
'htmlbars-inline-precompile',
13+
],
14+
transforms: [],
15+
},
16+
],
17+
[
18+
'@babel/plugin-transform-runtime',
19+
{
20+
absoluteRuntime: __dirname,
21+
useESModules: true,
22+
regenerator: false,
23+
},
24+
],
25+
// This can leave once
26+
// https://github.com/embroider-build/embroider/pull/2249
27+
// is merged
28+
...babelCompatSupport(),
29+
],
30+
31+
generatorOpts: {
32+
compact: false,
33+
},
34+
};

frameworks/keyed/ember/checks.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env bash
2+
3+
# NOTE: the tooling will not detect us as a benchable implementation
4+
# unless there is a package-lock.json
5+
#
6+
# We're using pnpm to interact with js-framework-benchmark
7+
# instead of npm because pnpm (at least on my machine)
8+
# tends to work better.
9+
# (and is stricter)
10+
#
11+
# At the very least this script documents
12+
# how to interact with the jsfb packages...
13+
# at least in one point in time.
14+
#
15+
#
16+
# Things to do before submitting a PR:
17+
# ./checks.sh setup
18+
# ./checks.sh isKeyed
19+
# ./checks.sh verify
20+
21+
22+
case "$1" in
23+
# 1. Do this first
24+
setup)
25+
# Build ourselves
26+
npm run build-prod
27+
28+
# Build webdriver-ts
29+
cd ../../../webdriver-ts
30+
pnpm install
31+
pnpm rebuild
32+
pnpm compile
33+
34+
cd ../webdriver-ts-results
35+
npm ci
36+
;;
37+
# 2. Start the server (on port 8080)
38+
start)
39+
# https://github.com/krausest/js-framework-benchmark/tree/chrome110?tab=readme-ov-file#22-start-installing
40+
cd ../../../
41+
pnpm install
42+
# They are missing a dependency
43+
pnpm add @esbuild/[email protected]
44+
pnpm rebuild
45+
pnpm start
46+
;;
47+
48+
# 3. Verify
49+
isKeyed)
50+
cd ../../../webdriver-ts
51+
npm run isKeyed keyed/ember
52+
;;
53+
# 4. Run the Bench
54+
bench)
55+
cd ../../../webdriver-ts
56+
npm run bench keyed/ember
57+
;;
58+
verify)
59+
cd ../../..
60+
npm run rebuild-ci keyed/ember
61+
;;
62+
results)
63+
cd ../../../webdriver-ts
64+
npm run results
65+
66+
echo "View: http://localhost:8080/webdriver-ts-results/table.html"
67+
;;
68+
*)
69+
echo "$arg not recognized"
70+
;;
71+
esac
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"schemaVersion": "1.0.0",
3+
"packages": [
4+
{
5+
"name": "@embroider/app-blueprint",
6+
"version": "0.19.0",
7+
"blueprints": [
8+
{
9+
"name": "@embroider/app-blueprint",
10+
"isBaseBlueprint": true,
11+
"options": ["--package-manager pnpm"]
12+
}
13+
]
14+
}
15+
]
16+
}

0 commit comments

Comments
 (0)