From 00df807dfc47d6a01861994886e6ddbaf85b172d Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Mon, 3 Jun 2024 16:39:00 +0200 Subject: [PATCH] Drop support for Ember < 4.12 --- .github/workflows/ci.yml | 5 +- README.md | 5 +- ember-stargate/README.md | 144 ----------------------------------- test-app/config/ember-try.js | 20 ++++- 4 files changed, 24 insertions(+), 150 deletions(-) delete mode 100644 ember-stargate/README.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03c939a2..c1222ddc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,8 +55,9 @@ jobs: fail-fast: false matrix: try-scenario: - - ember-lts-3.28 - - ember-lts-4.4 + - ember-lts-4.12 + - ember-lts-5.4 + - ember-lts-5.8 - ember-release - ember-beta - ember-canary diff --git a/README.md b/README.md index a77d13ab..9c3a822f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ but without its caveats. ## Compatibility -- Ember.js v3.28 or above +- Ember.js v4.12 or above - Embroider or ember-auto-import v2 ## Installation @@ -127,7 +127,8 @@ import '@glint/environment-ember-loose'; import type StargateRegistry from 'ember-stargate/template-registry'; declare module '@glint/environment-ember-loose/registry' { - export default interface Registry extends StargateRegistry, /* other addon registries */ { + export default interface Registry + extends StargateRegistry /* other addon registries */ { // local entries } } diff --git a/ember-stargate/README.md b/ember-stargate/README.md deleted file mode 100644 index a77d13ab..00000000 --- a/ember-stargate/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# ember-stargate - -[![CI](https://github.com/kaliber5/ember-stargate/actions/workflows/ci.yml/badge.svg)](https://github.com/kaliber5/ember-stargate/actions/workflows/ci.yml) -[![Ember Observer Score](https://emberobserver.com/badges/ember-stargate.svg)](https://emberobserver.com/addons/ember-stargate) - -A modern take on using so-called "portals" to render things in a -different place of the DOM tree than they are logically defined in the app. - -Implemented using lightweight Glimmer components and Ember's new `{{in-element}}`, -but without its caveats. - -## Compatibility - -- Ember.js v3.28 or above -- Embroider or ember-auto-import v2 - -## Installation - -``` -ember install ember-stargate -``` - -## Why this addon? - -There are a number of existing solutions in the Ember ecosystem for the same -problem, so why this addon you may ask? - -Let's see how it compares to some of those... - -#### ember-wormhole - -The first addon to make portals popular in Ember uses proprietary implementation -tricks, that make it potentially less stable. Also defining portal targets in your -app is less flexible. - -#### ember-elsewhere - -While using only public Ember APIs, due to its requirement to use Ember's -`component` helper it comes with some caveats: - -- you cannot send arbitrary content though the portal, it must be a single component -- you cannot use a [component in block form](https://github.com/ef4/ember-elsewhere/issues/2) -- the component helper does not support passing HTML attributes (as in regular angle bracket invocation) - -#### in-element - -While Ember starting with 3.20 (or earlier using [ember-in-element-polyfill](https://github.com/ember-polyfills/ember-in-element-polyfill) -has a built-in primitive with `{{in-element}}`, due to its (intentional) low-level nature it is suitable -more for usage in addons (for things like modals, tooltips, dropdowns), but using it in apps is not very ergonomic: - -- it requires you to pass a reference to the target DOM element, which is less ergonomic than a CSS selector or some other - higher-level way to define the target (e.g. a target component) -- that DOM element has to _exist_ already before using `{{in-element}}`, so it's sensitive to rendering timings - -Other than that, `{{in-element}}` is a very useful primitive, and in fact this addon uses it under the hood, -with just some simple higher-level abstractions on top of it! - -## Usage - -You need two things to make a portal work: define the content that should be sent through the portal using -``, and the target - identified by its name - where it should be rendered to -using ``. - -Let's take an example where we want to render a sticky footer inside `application.hbs`, as it will be used -across routes, but the actual content (left and right sections for action buttons etc. and a title) needs -to be defined within the actual routes; - -step1.hbs: - -```hbs -Step 1 - - - Back - - - - - -``` - -application.hbs: - -```hbs -{{outlet}} - - -``` - -Note that although the footer will be rendered _after_ the portals, as it comes after the `{{outlet}}` at the -bottom of the DOM, this poses no problem for this addon as it explicitly supports this case: a portal's content -will not be rendered until its target is available, but then the target will immediately show the portal's content. - -## API - -### Portal - -- `@target`: required argument to specify the name of the target -- `@fallback`: by default the portal's content will not render until the target is available. - With `@fallback="inplace"` the content will be rendered in place as long as the target is not available. -- `@renderInPlace`: if `true` the portal is effectively disabled, and the content is rendered in place. - -### PortalTarget - -- `@name`: required argument that identifies the target -- `@multiple`: by default if multiple portals refer to the same target, they will replace each other - (in the order of rendering). With `@multiple={{true}}` the portal's content will be appended (again in the order of rendering). -- `@onChange`: whenever a portal is rendered to or removed from the target, this action will be called. It will receive - the current portal count of this target as an argument. - -## TypeScript usage - -All components have proper [Glint](https://github.com/typed-ember/glint) types, which allow you when using TypeScript to get strict type checking in your templates. - -Unless you are using [strict mode](http://emberjs.github.io/rfcs/0496-handlebars-strict-mode.html) templates (via [first class component templates](http://emberjs.github.io/rfcs/0779-first-class-component-templates.html)), -you need to import the addon's Glint template registry entries as described in the [Using Addons](https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons#using-glint-enabled-addons) documentation: - -```ts -// e.g. types/glint.d.ts -import '@glint/environment-ember-loose'; -import type StargateRegistry from 'ember-stargate/template-registry'; - -declare module '@glint/environment-ember-loose/registry' { - export default interface Registry extends StargateRegistry, /* other addon registries */ { - // local entries - } -} -``` - -> Note that Glint itself is still under active development, and as such breaking changes might occur. Therefore, Glint support by this addon is also considered experimental, and not covered by our SemVer contract! - -## Contributing - -See the [Contributing](CONTRIBUTING.md) guide for details. - -## License - -This project is licensed under the [MIT License](LICENSE.md). diff --git a/test-app/config/ember-try.js b/test-app/config/ember-try.js index 8919e147..6488aa28 100644 --- a/test-app/config/ember-try.js +++ b/test-app/config/ember-try.js @@ -8,10 +8,26 @@ module.exports = async function () { useYarn: true, scenarios: [ { - name: 'ember-lts-3.28', + name: 'ember-lts-4.12', npm: { devDependencies: { - 'ember-source': '~3.28.0', + 'ember-source': '~4.12.0', + }, + }, + }, + { + name: 'ember-lts-5.4', + npm: { + devDependencies: { + 'ember-source': '~5.4.0', + }, + }, + }, + { + name: 'ember-lts-5.8', + npm: { + devDependencies: { + 'ember-source': '~5.8.0', }, }, },