Skip to content

[FEATURE] Strict component blueprint support #20862

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

Windvis
Copy link
Contributor

@Windvis Windvis commented Mar 1, 2025

This implements the blueprint work of RFC #779.

I squashed all the work from #20511 into a single commit to make rebases easier.

Closes #20511

Current status:

Should be good to review. I'll clean up the git history once I know if the current approach is fine and I no longer need the option to revert individual commits.

@Windvis

This comment was marked as resolved.

@Windvis

This comment was marked as resolved.

@ef4
Copy link
Contributor

ef4 commented Mar 4, 2025

Naming proposal from the tooling team meeting discussion: can we use the edition setting in package.json to control both component and route blueprint generation?

 "ember": {
    "edition": "polaris" // causes all components and routes to generate with template tag
  },

Also, if separate settings for each feature are also desirable, the value could be "polaris" vs "octane"

// .ember-cli
componentAuthoringFormat = "polaris"
routeAuthoringFormat = "octane"

@Windvis
Copy link
Contributor Author

Windvis commented Mar 4, 2025

Naming proposal from the tooling team meeting discussion: can we use the edition setting in package.json to control both component and route blueprint generation?

@ef4 I think we can use that edition value to flip the defaults, but I wouldn't use it as the only option. The RFC explicitly mentioned a --strict and --loose flag for the component generator.

Checking the edition value feels a bit out of scope for this PR though, since it would require other code changes (and the merge of #20863). The wider ecosystem might also not be ready yet for a value other than octane so I don't think we can recommend people to update that edition value in their package.json files until we actually are closer to shipping it?

My preference would be to stick with the --component-authoring-format="strict" with --strict and --loose aliases, as currently implemented, get it merged, and follow up with a PR that adds support for setting edition: "polaris" where needed.

My question about the argument name wasn't for this PR, but the route one 😄, but using route-authoring-format makes sense so I can go for that, and make it match the setup here.

@bertdeblock bertdeblock reopened this Mar 11, 2025
@Windvis Windvis force-pushed the strict-component-blueprint-support branch from 002d101 to 3c84d82 Compare March 14, 2025 14:47
@Windvis Windvis changed the title Strict component blueprint support [FEATURE] Strict component blueprint support Mar 14, 2025
@Windvis

This comment was marked as resolved.

ignace and others added 8 commits March 22, 2025 09:12
Add failing test for strict flag

Add file name mapping for strict flag

Add gjs template blueprint

Filter files depending on loose/strict flag

Add gjs test fixture

fix component import path

Add component-test strict blueprint

filter blueprint files for component-test

Add strict component test test (no typo)

Add component test strict fixture

Use authoringFormat option instead of explicit flags

Use authoringFormat option instead of flags in component

Revert explicit fileMapTokens for strict format

Only log skippedJsFiles in loose mode

Don't store filteresJsFiles for authoring format

do not log skippedJsFiles in component-test either

fix afterInstall param location

Fix blueprint closing tags

Remove log

fix: add components to import path

Add yield to template-only gjs

Make component blueprint ts by default

Add js blueprints

Move test to outside of pod

remove default template test gjs

check rfc fixture

fix: nested component invocation

remove log

feat: add template tag aliasses

chore: rename param to component-authoring-format

fix: remove assert on test

chore: update test doc comments to reflect new test waiter api

chore: update doc help
ember-cli is used in the tests, and some tests need the newer features to work as expected.
We also need a version that uses the `babel-remove-types` package that includes the fixes for .gts detyping to work.

Because of this update, some slight adjustments are needed to some pod related tests. The `usePods` option of ember-cli-blueprint-test-helpers' `setupPodConfig` util isn't compatible with newer ember-cli versions. As a workaround we use the `--pod` argument when generating files.
This applies the same changes as ember-cli/ember-cli#10659 so we don't need to wait for a new ember-cli release.
- add gts
- make the gjs consistent.
6.3.0 hasn't been released yet, but we need the content-tag v3 dependency to fix an issue when detyping the blueprint files.
Windvis added 4 commits March 22, 2025 19:21
The .gts type removal is buggy at the moment, and causes this PR to be blocked. We now add .gjs blueprints and strip the version we don't need, which bypasses the detyping problems.
We no longer need it since we don't depend on the type removal feature.
The component-test.js file was using the old, ember-cli-qunit based setup and we didn't add the new test files there.
@Windvis Windvis force-pushed the strict-component-blueprint-support branch from 48a8940 to e9ba9d4 Compare March 22, 2025 18:36
That folder is no longer used.
@Windvis Windvis marked this pull request as ready for review March 22, 2025 19:02
This is in line with the PR that cleans up ember-cli-qunit tests
@Windvis
Copy link
Contributor Author

Windvis commented Mar 22, 2025

I decided to work around all the different .gts detyping issues by simply adding .gjs blueprint files and selecting the correct one based on the host project. This allows us to drop all the workarounds and also means we are no longer blocked by the ember-cli backport PR.

I think this is the best way forward, and we can always refactor later if needed.

We now use the addon name instead of the modulePrefix.
Copy link

github-actions bot commented Apr 5, 2025

Development Assets

Diff

Details

This PRmain
Dev
 2.2M └─┬ .
1015K   ├─┬ @ember
 205K   │ ├─┬ -internals
  69K   │ │ ├─┬ views
  64K   │ │ │ └─┬ lib
  23K   │ │ │   ├── mixins
  22K   │ │ │   ├── system
  10K   │ │ │   ├── views
 4.3K   │ │ │   └── compat
  35K   │ │ ├─┬ runtime
  30K   │ │ │ └─┬ lib
  21K   │ │ │   ├── mixins
 5.7K   │ │ │   └── ext
  26K   │ │ ├─┬ meta
  21K   │ │ │ └── lib
  11K   │ │ ├── owner
 9.4K   │ │ ├── deprecations
 7.4K   │ │ ├── metal
 7.0K   │ │ ├── string
 5.1K   │ │ ├── glimmer
 4.9K   │ │ ├── utils
 4.9K   │ │ ├── routing
 4.5K   │ │ ├── error-handling
 4.5K   │ │ ├── utility-types
 4.2K   │ │ ├── container
 4.2K   │ │ ├── browser-environment
 4.1K   │ │ └── environment
 183K   │ ├─┬ routing
  28K   │ │ └── lib
 149K   │ ├─┬ object
  66K   │ │ └─┬ lib
  62K   │ │   └── computed
 114K   │ ├─┬ template-compiler
 109K   │ │ └─┬ lib
  20K   │ │   ├── plugins
 4.6K   │ │   ├── system
 4.1K   │ │   └── -internal
  66K   │ ├─┬ application
 5.6K   │ │ └── lib
  52K   │ ├─┬ debug
  21K   │ │ └── lib
  38K   │ ├─┬ array
 4.9K   │ │ └── lib
  31K   │ ├─┬ engine
 4.7K   │ │ └── lib
  27K   │ ├── runloop
  22K   │ ├─┬ utils
  18K   │ │ └── lib
  20K   │ ├── helper
  11K   │ ├── destroyable
 9.8K   │ ├── instrumentation
 9.4K   │ ├── controller
 7.4K   │ ├── service
 7.2K   │ ├── owner
 6.2K   │ ├── component
 5.6K   │ ├── canary-features
 5.5K   │ ├── modifier
 5.1K   │ ├── template-compilation
 5.0K   │ ├── enumerable
 5.0K   │ ├── test
 4.4K   │ ├── template
 4.4K   │ ├── renderer
 4.2K   │ ├── deprecated-features
 4.1K   │ ├── template-factory
 4.1K   │ └── version
 709K   ├── shared-chunks
 384K   ├─┬ @glimmer
 166K   │ ├── runtime
  60K   │ ├── opcode-compiler
  30K   │ ├── manager
  22K   │ ├── validator
  14K   │ ├── program
  12K   │ ├── reference
  11K   │ ├── destroyable
  10K   │ ├─┬ tracking
 4.4K   │ │ └── primitives
  10K   │ ├── util
 8.1K   │ ├── node
 7.3K   │ ├── global-context
 6.4K   │ ├── wire-format
 5.0K   │ ├── vm
 4.9K   │ ├── encoder
 4.6K   │ ├── owner
 4.1K   │ └── env
  60K   ├─┬ ember-testing
  56K   │ └─┬ lib
  14K   │   ├── test
  14K   │   ├── helpers
  10K   │   ├── ext
 6.5K   │   └── adapters
  31K   ├── backburner.js
  25K   ├── ember
  24K   ├── route-recognizer
  18K   ├─┬ @simple-dom
  14K   │ └── document
 9.2K   ├── dag-map
 4.3K   ├── rsvp
 4.3K   └── router_js
 2.2M └─┬ .
1015K   ├─┬ @ember
 205K   │ ├─┬ -internals
  69K   │ │ ├─┬ views
  64K   │ │ │ └─┬ lib
  23K   │ │ │   ├── mixins
  22K   │ │ │   ├── system
  10K   │ │ │   ├── views
 4.3K   │ │ │   └── compat
  35K   │ │ ├─┬ runtime
  30K   │ │ │ └─┬ lib
  21K   │ │ │   ├── mixins
 5.7K   │ │ │   └── ext
  26K   │ │ ├─┬ meta
  21K   │ │ │ └── lib
  11K   │ │ ├── owner
 9.4K   │ │ ├── deprecations
 7.4K   │ │ ├── metal
 7.0K   │ │ ├── string
 5.1K   │ │ ├── glimmer
 4.9K   │ │ ├── utils
 4.9K   │ │ ├── routing
 4.5K   │ │ ├── error-handling
 4.5K   │ │ ├── utility-types
 4.2K   │ │ ├── container
 4.2K   │ │ ├── browser-environment
 4.1K   │ │ └── environment
 183K   │ ├─┬ routing
  28K   │ │ └── lib
 149K   │ ├─┬ object
  66K   │ │ └─┬ lib
  62K   │ │   └── computed
 114K   │ ├─┬ template-compiler
 109K   │ │ └─┬ lib
  20K   │ │   ├── plugins
 4.6K   │ │   ├── system
 4.1K   │ │   └── -internal
  66K   │ ├─┬ application
 5.6K   │ │ └── lib
  52K   │ ├─┬ debug
  21K   │ │ └── lib
  38K   │ ├─┬ array
 4.9K   │ │ └── lib
  31K   │ ├─┬ engine
 4.7K   │ │ └── lib
  27K   │ ├── runloop
  22K   │ ├─┬ utils
  18K   │ │ └── lib
  20K   │ ├── helper
  11K   │ ├── destroyable
 9.8K   │ ├── instrumentation
 9.4K   │ ├── controller
 7.4K   │ ├── service
 7.2K   │ ├── owner
 6.2K   │ ├── component
 5.6K   │ ├── canary-features
 5.5K   │ ├── modifier
 5.1K   │ ├── template-compilation
 5.0K   │ ├── enumerable
 5.0K   │ ├── test
 4.4K   │ ├── template
 4.4K   │ ├── renderer
 4.2K   │ ├── deprecated-features
 4.1K   │ ├── template-factory
 4.1K   │ └── version
 709K   ├── shared-chunks
 384K   ├─┬ @glimmer
 166K   │ ├── runtime
  60K   │ ├── opcode-compiler
  30K   │ ├── manager
  22K   │ ├── validator
  14K   │ ├── program
  12K   │ ├── reference
  11K   │ ├── destroyable
  10K   │ ├─┬ tracking
 4.4K   │ │ └── primitives
  10K   │ ├── util
 8.1K   │ ├── node
 7.3K   │ ├── global-context
 6.4K   │ ├── wire-format
 5.0K   │ ├── vm
 4.9K   │ ├── encoder
 4.6K   │ ├── owner
 4.1K   │ └── env
  60K   ├─┬ ember-testing
  56K   │ └─┬ lib
  14K   │   ├── test
  14K   │   ├── helpers
  10K   │   ├── ext
 6.5K   │   └── adapters
  31K   ├── backburner.js
  25K   ├── ember
  24K   ├── route-recognizer
  18K   ├─┬ @simple-dom
  14K   │ └── document
 9.2K   ├── dag-map
 4.3K   ├── rsvp
 4.3K   └── router_js

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.

5 participants