Make container queries that harness the power of Ember
MIT License
Bot releases are hidden (Show)
Published by ijlee2 over 1 year ago
Thanks to @buschtoens.
I introduced embroider-css-modules
to docs-app
, in order to show that ember-container-query
is (has long been) compatible with the strictest settings for Embroider.
Published by ijlee2 over 1 year ago
I separated documentation from testing so that the ember-canary
and embroider-optimized
scenarios run in continuous integration (CI).
It's my aim to run the docs-app on the strictest settings for Embroider, so that end-developers can feel confident about using ember-container-query
in their projects. (Currently, staticAddonTrees
and staticComponents
are turned off, not because of ember-container-query
, but due to another addon.)
Published by ijlee2 over 1 year ago
ember-test-selectors
from dependencies1
1. See #163 for explanation.
If an end-developer consumed the test selector data-test-container-query
directly for their tests, they will need to write the test selector explicitly:
{{! Before }}
<ContainerQuery
@features={{hash ... }}
as |CQ|
>
...
</ContainerQuery>
{{! After }}
<ContainerQuery
@features={{hash ... }}
data-test-container-query
as |CQ|
>
...
</ContainerQuery>
However, testing the <ContainerQuery>
component in the consuming project is not recommended. The migration shown above happens to work because of splattributes, which were to be used only for accessibility and styling. It's best if the consuming project trusts the component.
Published by ijlee2 over 1 year ago
ember-modifier
to v4
1
1. Your project may continue to depend on [email protected]
. Note, ember-container-query@v4
assumes that ember-modifier@v4
is present (because it already requires ember-auto-import@v2
), so there won't likely be a major release when the support for ember-modifier@v3
is dropped.
ember-canary
and embroider-optimized
Published by ijlee2 over 1 year ago
Published by ijlee2 over 1 year ago
ember-container-query
to v2 addon formatember-auto-import@v2
.{{cq-aspect-ratio}}
, {{cq-height}}
, and {{cq-width}}
have been removed. Please use {{aspect-ratio}}
, {{height}}
, and {{width}}
instead.ember-modifier
to v4
(or widen the support by including ^3.2.7
)ember-canary
and embroider-optimized
Published by ijlee2 almost 2 years ago
If your project allows strict mode (files with the extension .gjs
or .gts
), you can use the import path 'ember-container-query'
(rather than the "true" path) to consume the addon. Thanks to @NullVoxPopuli for adding this feature.
// Component
import { ContainerQuery } from 'ember-container-query';
// Helpers
import { aspectRatio, height, width } from 'ember-container-query';
// Modifier
import { containerQuery } from 'ember-container-query';
If the project also supports Glint, you will benefit from the addon's types.
In #146, the helpers were renamed in order to minimize the difference in names (syntax) between *.hbs
and *.{gjs,gts}
files. Please update the helper names in your templates (e.g. use find-and-replace-all).
Step | Find | Replace with |
---|---|---|
1 | cq-aspect-ratio |
aspect-ratio |
2 | cq-height |
height |
3 | cq-width |
width |
The old helpers {{cq-aspect-ratio}}
, {{cq-height}}
, and {{cq-width}}
will be removed in v4.0.0
.
Published by ijlee2 almost 2 years ago
The types for ember-container-query
and the demo app have been updated to support Glint.
⚠️ To consume the provided signatures, your project will need @glimmer/component
with version 1.1.2
or higher. See Version Requirements for more information. (The version requirements do not apply for non-Glint users.)
Special thanks to @NullVoxPopuli for suggesting the feature and @denisclark, @gossi, and @buschtoens for helping me figure out how to narrow the QueryResults
type.
Published by ijlee2 almost 2 years ago
v2
@ember/render-modifiers
with ember-modifier
{{container-query}}
modifier (allows you to query a container how you see fit)@dataAttributePrefix
or @features
would result in stale data attributesPublished by ijlee2 almost 2 years ago
Plan for v3.0.0
release includes:
@ember/render-modifiers
with ember-modifier
Published by ijlee2 almost 2 years ago
The <ContainerQuery>
component now relies on packages that will likely be maintained in the future (namely, ember-modifier
).
From v1.0.0
to v2.1.0
, updating @dataAttributePrefix
or @features
(both are uncommon use cases) would result in stale data attributes. This bug has been fixed.
Please note, v2.1.1
will be the last release version that supports Node 12 and Ember 3.24 LTS.
Published by ijlee2 over 2 years ago
A rare minor release. 🎉 I have introduced TypeScript to start documenting the <ContainerQuery>
component and {{cq-*}}
helpers. In addition, the code for the demo app has been typed and refactored.
Finally, ember-on-resize-modifer
has been updated to v1.1.0
. This will remove deprecation messages that had appeared in v1.0.0
.
Published by ijlee2 over 2 years ago
Many thanks to @bertdeblock for prompt feedback.
Installing this patch release will fix the warning messages that you might have seen in an Embroider app:
WARNING in ./helpers/cq-aspect-ratio.js 1:0-103
export 'cqAspectRatio' (reexported as 'cqAspectRatio') was not found in '../node_modules/ember-container-query/helpers/cq-aspect-ratio' (possible exports: default)
@ ./assets/build-time-monitor.js 155:13-53
WARNING in ./helpers/cq-height.js 1:0-92
export 'cqHeight' (reexported as 'cqHeight') was not found in '../node_modules/ember-container-query/helpers/cq-height' (possible exports: default)
@ ./assets/build-time-monitor.js 158:13-47
WARNING in ./helpers/cq-width.js 1:0-90
export 'cqWidth' (reexported as 'cqWidth') was not found in '../node_modules/ember-container-query/helpers/cq-width' (possible exports: default)
@ ./assets/build-time-monitor.js 161:13-46
The risk in upgrading ember-container-query
from v2.0.1
to v2.0.2
should be between none and small.
Published by ijlee2 over 2 years ago
Installing this patch release will fix the warning messages that you might have seen in an Embroider app:
WARNING in ./helpers/cq-aspect-ratio.js 1:0-103
export 'cqAspectRatio' (reexported as 'cqAspectRatio') was not found in '../node_modules/ember-container-query/helpers/cq-aspect-ratio' (possible exports: default)
@ ./assets/build-time-monitor.js 155:13-53
WARNING in ./helpers/cq-height.js 1:0-92
export 'cqHeight' (reexported as 'cqHeight') was not found in '../node_modules/ember-container-query/helpers/cq-height' (possible exports: default)
@ ./assets/build-time-monitor.js 158:13-47
WARNING in ./helpers/cq-width.js 1:0-90
export 'cqWidth' (reexported as 'cqWidth') was not found in '../node_modules/ember-container-query/helpers/cq-width' (possible exports: default)
@ ./assets/build-time-monitor.js 161:13-46
ember-element-helper
has also been updated from v0.6.0
to v0.6.1
.
The risk in upgrading ember-container-query
from v2.0.0
to v2.0.1
should be between none and small.
Published by ijlee2 over 2 years ago
Hi, everyone. You can expect the following changes in v2.0.0
:
ember-did-resize-modifier
to ember-on-resize-modifier
embroider-safe
workflow in CIPublished by ijlee2 almost 3 years ago
Current plan for v2.0.0
release includes:
ember-did-resize-modifier
with ember-on-resize-modifier
embroider-safe
workflow in CIThe release of v2.0.0-alpha.0
will help me (and hopefully you) test backwards compatibility.
Published by ijlee2 about 3 years ago
The patch release updates several development dependencies, including ember-source
, to their latest version. It's planned to be the last 1.x release that allows supporting Node 10 and Ember 3.16 LTS.
Published by ijlee2 over 3 years ago
This patch release updates ember-element-helper
to v0.5.0 and checks in CI that ember-container-query
is Embroider Safe. (Hopefully, the demo app for CI can pass Optimized Embroider Safe soon.)
The risk in upgrading ember-container-query
from v1.1.7 to v1.1.8 should be between none and small.
Published by ijlee2 over 3 years ago
Apologies for letting the weekly scheduled CI fail for 3 months... 😓 I fixed a couple of tests so that CI can pass once again. I'm hoping for a less brittle way to test container queries.
In this patch release, I made the following updates:
ember-source
to v3.25.4
ember-qunit
to v5.1.4
ember-try
scenarioNote: Ember 3.16 LTS has been unsupported since March 17, 2021. Since there may be developers who work on an app that is 3.16 or earlier, I will continue to include Ember 3.16 LTS in ember-try
scenarios for some additional time. Please do take time now to update Ember in your app. 👍🏼
Published by ijlee2 almost 4 years ago
I made a few changes in this patch release:
ember-source
to v3.23.1
ember-element-helper
to v0.3.2
ember-canary
test scenario and upgraded percy/exec-action
to v0.3.1
)The risk in upgrading ember-container-query from v1.1.5
to v1.1.6
should be between none and small.