Skip to content
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

Add minimal app template #2205

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Add minimal app template #2205

wants to merge 5 commits into from

Conversation

NullVoxPopuli
Copy link
Collaborator

@NullVoxPopuli NullVoxPopuli commented Dec 10, 2024

  1. first commit: copy the app-template
  2. remove everything related to compat
  3. ???
  4. tests pass?

Outstanding issues

ember-qunit pulls on ember-cli-test-loader

✘ [ERROR] Could not resolve "ember-cli-test-loader/test-support/index.json" [plugin embroider-esbuild-resolver]

    ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-qunit/dist/test-loader.js:2:60:
      2 │ import AbstractTestLoader, { addModuleIncludeMatcher } from 'ember-cli-test-loader/test-support/index';
        ╵                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

importing v2 addons fails in esbuild - repo

Error: Build failed with 1 error:
  
node_modules/.pnpm/[email protected]/node_modules/typescript-memoize/dist/memoize-decorator.js:132:51: 
  ERROR: [plugin: embroider-esbuild-resolver] 
    <.pnpm>/[email protected]/node_modules/ember-welcome-page/dist/components/welcome-page.js: 
      this.config.activePackageRules is not iterable
    at failureErrorWithLog (<.pnpm>/[email protected]/node_modules/esbuild/lib/main.js:1472:15)
    at <.pnpm>/[email protected]/node_modules/esbuild/lib/main.js:945:25
    at <repo>/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1353:9
full error, regarding `@ember/test-helpers` (a v2 addon)
  ➜  press h + enter to show help
✘ [ERROR] <.pnpm>/@[email protected]_@[email protected][email protected]/node_modules/@ember/test-helpers/dist/setup-rendering-context.js: this.config.activePackageRules is not iterable [plugin embroider-esbuild-resolver]

    ../../node_modules/.pnpm/[email protected]/node_modules/typescript-memoize/dist/memoize-decorator.js:132:51:
      132 │                     returnedValue = originalMethod.apply(this, args);
          ╵                                                    ^

    at get rules (<repo>/packages/compat/src/resolver-transform.js:447:38)
    at TemplateResolver.<anonymous> (<.pnpm>/[email protected]/node_modules/typescript-memoize/dist/memoize-decorator.js:132:52)
    at TemplateResolver.findRules (<repo>/packages/compat/src/resolver-transform.js:488:30)
    at enter (<repo>/packages/compat/src/resolver-transform.js:99:42)
    at visitNode (<.pnpm>/[email protected]_@[email protected]/node_modules/ember-source/dist/ember-template-compiler.js:9012:139)
    at traverse (<.pnpm>/[email protected]_@[email protected]/node_modules/ember-source/dist/ember-template-compiler.js:9075:13)
    at preprocess (<.pnpm>/[email protected]_@[email protected]/node_modules/ember-source/dist/ember-template-compiler.js:10765:85)
    at normalize (<.pnpm>/[email protected]_@[email protected]/node_modules/ember-source/dist/ember-template-compiler.js:11870:23)
    at precompileJSON (<.pnpm>/[email protected]_@[email protected]/node_modules/ember-source/dist/ember-template-compiler.js:15566:31)
    at precompile$1 (<.pnpm>/[email protected]_@[email protected]/node_modules/ember-source/dist/ember-template-compiler.js:15605:41)
    at Module.precompile (<.pnpm>/[email protected]_@[email protected]/node_modules/ember-source/dist/ember-template-compiler.js:16450:20)
    at insertCompiledTemplate (<.pnpm>/[email protected]/node_modules/babel-plugin-ember-template-compilation/src/plugin.js:277:48)
    at PluginPass.CallExpression (<.pnpm>/[email protected]/node_modules/babel-plugin-ember-template-compilation/src/plugin.js:158:25)
    at NodePath._call (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/context.js:49:20)
    at NodePath.call (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/context.js:39:18)
    at NodePath.visit (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/context.js:88:31)
    at TraversalContext.visitQueue (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:90:16)
    at TraversalContext.visitSingle (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:66:19)
    at TraversalContext.visit (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:113:19)
    at traverseNode (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/traverse-node.js:22:17)
    at NodePath.visit (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/context.js:94:52)
    at TraversalContext.visitQueue (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:90:16)
    at TraversalContext.visitMultiple (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:62:17)
    at TraversalContext.visit (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:111:19)
    at traverseNode (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/traverse-node.js:22:17)
    at NodePath.visit (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/context.js:94:52)
    at TraversalContext.visitQueue (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:90:16)
    at TraversalContext.visitMultiple (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:62:17)
    at TraversalContext.visit (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:111:19)
    at traverseNode (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/traverse-node.js:22:17)
    at NodePath.visit (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/context.js:94:52)
    at TraversalContext.visitQueue (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:90:16)
    at TraversalContext.visitSingle (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:66:19)
    at TraversalContext.visit (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/context.js:113:19)
    at traverseNode (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/traverse-node.js:22:17)
    at Object.traverse (<.pnpm>/@[email protected][email protected]/node_modules/@babel/traverse/lib/index.js:53:34)
    at PluginPass.pre (<.pnpm>/[email protected]/node_modules/babel-plugin-ember-template-compilation/src/plugin.js:170:23)
    at PluginPass.async (<.pnpm>/@[email protected]/node_modules/@babel/core/lib/gensync-utils/async.js:35:33)
    at PluginPass.async (<.pnpm>/[email protected]/node_modules/gensync/index.js:186:15)
    at PluginPass.<anonymous> (<.pnpm>/[email protected]/node_modules/gensync/index.js:216:13)
    at Generator.next (<anonymous>)
    at transformFile (<.pnpm>/@[email protected]/node_modules/@babel/core/lib/transformation/index.js:75:19)
    at transformFile.next (<anonymous>)
    at run (<.pnpm>/@[email protected]/node_modules/@babel/core/lib/transformation/index.js:25:12)
    at run.next (<anonymous>)
    at transform (<.pnpm>/@[email protected]/node_modules/@babel/core/lib/transform.js:22:33)
    at transform.next (<anonymous>)
    at step (<.pnpm>/[email protected]/node_modules/gensync/index.js:269:25)
    at <.pnpm>/[email protected]/node_modules/gensync/index.js:273:13
    at async.call.result.err.err (<.pnpm>/[email protected]/node_modules/gensync/index.js:223:11)

  This error came from the "onLoad" callback registered here:

    ../../node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file://<repo>/packages/vite/src/esbuild-resolver.js:135:19)
    at handlePlugins (<.pnpm>/[email protected]/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (<.pnpm>/[email protected]/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (<.pnpm>/[email protected]/node_modules/esbuild/lib/main.js:699:5)
    at <.pnpm>/[email protected]/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (<.pnpm>/[email protected]/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (<.pnpm>/[email protected]/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file://<.pnpm>/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:50924:33)

  The plugin "embroider-esbuild-resolver" was triggered by this import

    ../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@ember/test-helpers/dist/index.js:6:70:
      6 │ export { clearRender, render, default as setupRenderingContext } from './setup-rendering-context.js';
        ╵                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Something is still looking for an env:

[vite] Internal server error: ENOENT: 
  no such file or directory, lstat 
    '<repo>/tests/app-template-minimal/node_modules/.embroider/ember-env.json'
      at Object.lstatSync (node:fs:1633:25)
      at <.pnpm>/[email protected]/node_modules/graceful-fs/polyfills.js:319:16
      at getVendor (<repo>/packages/core/src/virtual-vendor.js:26:35)
      at renderVendor (<repo>/packages/core/src/virtual-vendor.js:20:19)

import Resolver from 'ember-resolver';
import config from './config/environment';

const templates = import.meta.glob(`templates/**/*`, { eager: true });
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't exactly what I'd want to do in a personal app, but if no components are in the templates folder, it seems ok -- probably wouldn't be compat with route splitting

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can probably do a new feature of @embroider/router that lets you configure the route splitting directly in your app/router.js, and that code would directly do the corresponding import.meta.globs.

But also, even v2 addons can put things into @embroider/virtual/compat-modules, so maybe continuing to use that here makes sense.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, that's a good point -- services are the obvious annoying-to-do-manually thing.
maybe this has gone too minimal!

@ef4
Copy link
Contributor

ef4 commented Dec 11, 2024

There's lots more to delete, but that can happen after you have passing tests.

@mansona mansona force-pushed the minimal-app-template branch from 4d0779a to 6ea29c2 Compare December 19, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants