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

feat: add ember starter #19564

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

Conversation

NullVoxPopuli
Copy link

@NullVoxPopuli NullVoxPopuli commented Mar 3, 2025

Current Blockers for "Ready for Review":

All things on the ember side:

  • Can we make something even more minimal? (we have plans for a new "resolver")
  • Bug in our project generation - is not dropping in to interactive mode with the custom blueprint option -- this is fixed either by fixing the bug, or changing the default blueprint -- we should probably fix the bug tho lol
  • The currently specified blueprint is very out of date compared to what we want, and we should update it
  • stable release of build deps (and ember-source)

Description

This PR adds Ember (and Ember + TS) to the list of starter templates.

Some key differences from the other starter templates atm
  • we use babel (for now)
  • we have a custom build macros plugin (via babel) because import.meta.ENV.* isn't a standard (maybe one day soon? 🤞 ) -- we don't want macros-code to change between packaging systems (webpack, vite, our old legacy thing, etc)
Some key differences from a more normal ember-generated project
  • no linting / formatting is configured (aligns with the other starter templates)
  • no testing is configured
  • some default libraries are removed
  • we're using a src folder instead of app folder

To generate a more normal ember project, folks should use this option:
image

old notes, no longer relevant

These notes are no longer relevant, because I've made the ember-vite templates as minimal as they currently can be, which more aligns with the other vite templates.

With the option to create a production-ready app by deferring to ember-ecosystem project generation, we can regain some of this:

  • a small README is present
  • we have a watchman config for ignoring the output directory (an assumption due to the prevalence of macos in JS Dev, and how you kinda have to use watchman to dev on a mac)
  • some additional runtime dependencies are present, because we use separate packages as a means of showing folks how to do certain things with our low-level apis (they also provide very common utilities that folks use) -- there are tradeoffs to this that we're discussing right now -- mainly to address feelings of import fatigue
  • a test framework is pre-configured / wired up, as testing is fundamental to all ember development, and at the moment, we don't have compatibility with every test framework out there, so there isn't really a choice to be made with regards to testing.
  • we have a deprecation system for communicating progress of the framework

Here is our official "v2 app" blueprint / template: https://github.com/embroider-build/app-blueprint

which is notably different from the minimal template PR'd here:
embroider-build/embroider#2301 (this is what this PR to vite is using)

If testing is desired to be removed, we can delete:

  • tests/
  • deps:
    • ember-cli
    • ember-qunit
    • qunit
    • qunit-dom
    • @ember/test-helpers

My Todos

  • Add ember-template-ts
  • Add the deprecation system boilerplate

PR Checklist

  • Read the Contributing Guidelines at https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md.
  • Check that there isn't already a PR that solves the problem the same way. If you find a duplicate, please help us reviewing it.
  • Update the corresponding documentation if needed.
  • Include relevant tests that fail without this PR but pass with it.

@NullVoxPopuli NullVoxPopuli changed the title Add Ember Starter feat: Add Ember Starter Mar 3, 2025
@NullVoxPopuli NullVoxPopuli changed the title feat: Add Ember Starter feat: add ember starter Mar 3, 2025
@patak-dev
Copy link
Member

I tried to run it locally, and I got these errors:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/ember-source
npm ERR!   dev ember-source@"6.4.0-alpha.4" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer ember-source@">= 4.0.0" from @ember/[email protected]
npm ERR! node_modules/@ember/test-helpers
npm ERR!   dev @ember/test-helpers@"^5.0.0" from the root project

The templates in create-vite are as minimal as possible because they dual as bug reproduction starters, and they are intended to be used to learn vite more than to create a production app. For Vue, you would use create-vue for that for example. We can't also maintain up to dates templates for all frameworks.

So we would need to remove the testing infra for example. My take for ember is that it would be better for you and for us to avoid having these simplified templates in create-vite as they may end up harming new users more than helping. Instead, we could add the ember option and have an external launcher to your scaffolder CLI. Same as we do with Nuxt, React Router, SvelteKit, etc.

@NullVoxPopuli
Copy link
Author

I tried to run it locally, and I got these errors:

Yeah, npm doesn't work at all with resolving prerelease versions as peers. :(

Gotta use pnpm until the stable release

and they are intended to be used to learn vite more than to create a production app.

Gotcha, i must have missed this purpose in the docs or something

Instead, we could add the ember option and have an external launcher to your scaffolder CLI. Same as we do with Nuxt, React Router, SvelteKit, etc.

Ahh! Neat! I will explore this, thank you!!

@NullVoxPopuli
Copy link
Author

we could add the ember option and have an external launcher to your scaffolder CLI

Done!
Tho, in doing this, I found some bugs with the external CLI behavior (and output) that I want to fix

they are intended to be used to learn vite more than to create a production app.

updated!

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.

2 participants