Commit graph

43 commits

Author SHA1 Message Date
Saadh Zahid
d99814bbd6 Upgrading brace-expansion package in QuickLayout Docs
Some checks failed
Tests / build-and-test (push) Has been cancelled
Deploy to GitHub Pages / Build Docusaurus (push) Has been cancelled
Deploy to GitHub Pages / Deploy to GitHub Pages (push) Has been cancelled
Summary: Received an alert on a vulenrability in brace-expansion package, upgraded to latest version.

Differential Revision: D101617088

fbshipit-source-id: a7b1e3a4792f49329f8297a206d0dbe505a7d6e6
2026-04-20 04:32:58 -07:00
Saadh Zahid
55cf8c7c72 Upgrading packages for QuickLayout Docs
Summary: Received a pull request attempting to upgrade package dompurify.

Differential Revision: D101169251

fbshipit-source-id: aa699f0fa476aeece77e09328d3ba66738faff87
2026-04-16 09:04:32 -07:00
generatedunixname922712933777714
00162069ab fbsource//fbobjc/Libraries/MobileUI/QuickLayout:QuickLayoutMacroBinary
Differential Revision: D100583060

fbshipit-source-id: 5db9faf4a1c7918fe5eb404a7ab816739cf9bfb0
2026-04-14 05:55:21 -07:00
Xavier Jurado Cristobal
ce2e91db4f Fix QuickLayoutMacro test target
Summary: Fixes https://www.internalfb.com/intern/test/562950263672194?ref_report_id=0

Differential Revision: D98710843

fbshipit-source-id: c8d3f1c6a94db19967789eb58c56baa92d4923e4
2026-03-30 03:20:44 -07:00
generatedunixname1972450797044934
90cf9b88bd fbobjc/Libraries/MobileUI/QuickLayout/QuickLayoutBridge/ViewImplementation/HasBody.swift
Differential Revision: D98281621

fbshipit-source-id: a1f3406f91963d7a530e8ccc91cf74b913ca3113
2026-03-26 08:36:18 -07:00
Paul O'Shannessy
fbdba8d077 Restore files to previous state
Summary:
X-link: https://github.com/meta-pytorch/monarch/pull/3221

These files are shared between projects and were inadvertently modified.

Reviewed By: bigfootjon

Differential Revision: D98217804

fbshipit-source-id: 9d04fdb54bac4c3e46937ad5fae5356fa4264ff5
2026-03-25 17:42:33 -07:00
generatedunixname499836121
2d4fdbf2fc Link to fbsource
Summary:
This is an automatically generated diff to link facebookresearch/tensor-layouts's main branch to fbsource.

<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
diff-train-source-id: f40cb70c521410c9d16a4623514d3fb3a755b33c

Generated by: https://www.internalfb.com/intern/sandcastle/job/2567264638/

GitHub Repo: facebookresearch/tensor-layouts

Reviewed By: jduprat

Differential Revision: D98051566

fbshipit-source-id: 150f0fe4e579896e660a2a2615beddd16e610389
2026-03-24 18:06:28 -07:00
Peng Yunquan
58520c7ab8 Validate array count to avoid access out of range
Summary: {title}

Reviewed By: mattjgalloway

Differential Revision: D97746122

fbshipit-source-id: 979ba120b623c6a3a0c3fe12556683e34df373a4
2026-03-24 11:19:47 -07:00
generatedunixname854319124103827
c059343545 Daily arc lint --take SWIFTFORMAT
Reviewed By: VladimirMakaev

Differential Revision: D97264200

fbshipit-source-id: 349ab71d1da7319782b3c7a9ac5c683eefacce94
2026-03-19 05:37:30 -07:00
Saadh Zahid
cdce72c912 Upgrading package dependencies
Summary: Received an alert of a security vulnerability due to an outdated package. Updated dependency versions

Reviewed By: thisischristoph, constantine-fry

Differential Revision: D96729552

fbshipit-source-id: a015f27c4da32cb5f051c6b3cc12ca59c1f91285
2026-03-17 08:00:27 -07:00
generatedunixname1972450797044934
39b319aabf fbobjc/Libraries/MobileUI/QuickLayout/QuickLayoutCore/AlignmentGuides.swift
Differential Revision: D96746579

fbshipit-source-id: 58c2a4d5aeabc22163a00feb0660fbf131ec532e
2026-03-16 15:01:19 -07:00
Constantine Fry
b6039ce36c Add constrainedSize modifier
Summary:
Adds a new constrainedSize(maxWidth:maxHeight:) modifier to QuickLayout that clamps the parent's proposed size before measuring the child.

Unlike .frame(maxWidth:maxHeight:) (FlexibleFrame), this modifier does not create an invisible frame around the child or reposition it with alignment. It simply constrains the proposed size passed to the child and reports the child's actual size as its own. This makes it useful when you want to limit how much space a child is offered without introducing extra layout space around it.

The new ConstrainedSizeElement is modeled after FixedFrameElement but differs in three key ways:

Reports the child's actual size rather than the frame's size
Delegates flexibility to the child instead of reporting .fixedSize
Does not perform alignment positioning — the child is placed at the origin

Reviewed By: xavierjurado

Differential Revision: D94706249

fbshipit-source-id: 26f6a505c64a65964478d2c915962b9bc37c1b6c
2026-03-11 11:53:09 -07:00
Mark Davis
e7caec9ab2 Fix UILabel.proxy stale paragraph style causing incorrect sizing
Summary:
Both `UILabel.proxy` variants (text-based and attributed-text-based) shared a single static `sizingLabel`. When the attributed text variant set an `NSAttributedString` carrying paragraph style properties like `minimumLineHeight` (e.g. from `BCNAttributedString`), UIKit retained those properties internally on the label — even after subsequent text-based proxy calls set `attributedText = nil` and reassigned `text` + `font`. This caused stale paragraph style properties to inflate subsequent text-based proxy measurements. For example, a stale `minimumLineHeight` of 25pt (from a 20pt bold header) would cause a 13pt label (natural height ~15.67pt) to be measured at 25pt.

The fix: use a dedicated `attributedSizingLabel` for the attributed text proxy, so the two code paths never share state and paragraph style properties can't leak between them.

Reviewed By: constantine-fry

Differential Revision: D96003413

fbshipit-source-id: 02378a04cb2dd86679053b1608bef5b2e2fdfe3d
2026-03-11 10:42:13 -07:00
Luca Meghnagi
56da492d1e Add visionOS support (#22)
Summary: Pull Request resolved: https://github.com/facebookincubator/QuickLayout/pull/22

Reviewed By: xavierjurado

Differential Revision: D93882203

Pulled By: constantine-fry

fbshipit-source-id: e7765931fed7cd31610612aa6d315cff4fc028ab
2026-02-27 11:19:52 -08:00
Nolan O'Brien
cb1d3f60fc Migrate Group B UIColor(hex:) definitions and callers
Summary: Remove local UIColor init(hex:) definitions from 21 files that contained both the definition and callers. Each file's callers are migrated to UIColor(rgb:) for integer hex literals or UIColor(argbHexString:) for dynamic strings. Files that needed METAUIColorSwift were given the appropriate import. BUCK files updated where needed to add the METAUIColorSwift dependency.

Reviewed By: adamjernst

Differential Revision: D93524996

fbshipit-source-id: 0e77cb4befbf973520aa60054e345a519940806f
2026-02-18 00:30:00 -08:00
Constantine Fry
da7a356241 Fixing error: 'Flexibility' is ambiguous for type lookup in this context
Summary: Fixing an issue reported here https://fb.workplace.com/groups/quicklayout/posts/1553369622400413/

Reviewed By: xavierjurado

Differential Revision: D93416350

fbshipit-source-id: f9d6672a1fd81413a002e3751b04339fd1ef4f95
2026-02-16 09:22:58 -08:00
Constantine Fry
b9fa4f4a89 Update Package file to allow mac catalyst platform
Summary:
Allow QuickLayout compile for Mac Catalyst.
It's a support question on the github page: https://github.com/facebookincubator/QuickLayout/issues/21
I don't see any blocker against doing that.

Reviewed By: xavierjurado

Differential Revision: D92951983

fbshipit-source-id: 5ba71518eaf3d4dcbea93d4a896895774b23f3fc
2026-02-11 07:42:41 -08:00
Saadh Zahid
5249ba6987 Fix webpack dependency vulnerability in QuickLayout Docs
Summary: A security vulnerability alert was triggered for QuickLayout in github for the webpack dependency. Upgraded all dependencies to resolve this.

Reviewed By: adamjernst

Differential Revision: D92711271

fbshipit-source-id: 651e890cae0d39524e7dd1330d79e429181f9d28
2026-02-09 12:06:54 -08:00
Daniel Rodríguez
dcf5ffcbe4 Fix default expression in argument with inferred type
Summary:
The default argument associated with `tolerance` using a floating literal cannot
be used in Swift, but because of a bug in versions previous to 6.3, the
diagnostic was not emitted in methods. In Swift 6.3 this becomes a warning, and
will become an error in future versions of Swift, but it is an fatal error if
one enables `-warnings-as-errors`.

Instead of using a float literal, change the tolerances to accept an optional
and default to `nil`. Only in the actual `compare`, use the calculation
equivalent to `0.0001` if user did not override the default. The calculation has
to be done like `1.0/10000.0` because the protocol `FloatingPoint` cannot be
initialized from `FloatLiteralType` in a generic way.

Reviewed By: xavierjurado

Differential Revision: D92412465

fbshipit-source-id: 06b40b960b3f760f6672a37af720cd85b293c5c6
2026-02-06 14:03:07 -08:00
Lluís Ulzurrun de Asanza Sàez
d1151e5648 Fix typo in example code (#19)
Summary:
The original code used a `leading` symbol that doesn't exist. The right one is `.leading`.

Pull Request resolved: https://github.com/facebookincubator/QuickLayout/pull/19

Reviewed By: yannickl

Differential Revision: D92039987

Pulled By: constantine-fry

fbshipit-source-id: 7d975c1fa082680b6cf2f8887cffa2e036961bd6
2026-02-03 08:03:48 -08:00
Constantine Fry
ac6a40b9e3 Add banner
Summary:
Added the following banner into static docs and README file.
{F1984818606}

Reviewed By: saadhzahid

Differential Revision: D91141068

fbshipit-source-id: 54c7743a9243befe98043bae66a96bf1ae07eb6e
2026-01-21 10:21:16 -08:00
Constantine Fry
c29025477d Update swift-syntax package link
Summary:
Thanks to lucamegh for suggesting this update!

{F1984803554}

Reviewed By: D3migod

Differential Revision: D91118033

fbshipit-source-id: 178ba5bf9c25295186eefb4e9d05dd4cdb6daf3f
2026-01-21 04:19:16 -08:00
heoblitz
2f7287c28b Improve swift-syntax version compatibility (#11)
Summary:
## Description

Improves compatibility with other swift-syntax dependent libraries by specifying a version range.

## Changes

- Update swift-syntax dependency from open-ended from: "600.0.0" to explicit range "600.0.0"..<"603.0.0"
- Allow using the highest possible swift-syntax version (602.0.0)
- Reduce dependency resolution conflicts with other packages

## Reference

[Being a Good Citizen in the Land of SwiftSyntax - Point-Free](https://www.pointfree.co/blog/posts/116-being-a-good-citizen-in-the-land-of-swiftsyntax)

Pull Request resolved: https://github.com/facebookincubator/QuickLayout/pull/11

Reviewed By: D3migod

Differential Revision: D91116306

Pulled By: constantine-fry

fbshipit-source-id: 47fe4e651834f87e86dff4d9ea4f9251016e06a9
2026-01-21 03:52:25 -08:00
mlch911
1dfb89f4c6 Run test (#4)
Summary:
Be able to run test. https://github.com/facebookincubator/QuickLayout/issues/2

Pull Request resolved: https://github.com/facebookincubator/QuickLayout/pull/4

Reviewed By: saadhzahid

Differential Revision: D88258295

Pulled By: constantine-fry

fbshipit-source-id: 42fb707a4299bf22e20310d5d79368950ddb42d2
2026-01-20 06:43:47 -08:00
nuomi1
bb0f8bbcbf Add Animations and List showcase (#13)
Summary: Pull Request resolved: https://github.com/facebookincubator/QuickLayout/pull/13

Reviewed By: saadhzahid

Differential Revision: D90382201

Pulled By: constantine-fry

fbshipit-source-id: 6726c6b6ee9c473b3a2a43880c9acf65e4f40ae9
2026-01-19 10:00:19 -08:00
Constantine Fry
54c78ef52b Update Demo xcodeproject to enable complete concurrency checks and treat warnings as errors
Summary: ditto

Reviewed By: saadhzahid

Differential Revision: D90978203

fbshipit-source-id: 866c7e9092b7ad4d43c4b142dd597255454b25a7
2026-01-19 04:59:49 -08:00
Chaoshuai Lyu
ef2e6dcbba Make LazyView conform to LeafElement too
Summary:
This diff makes `LazyView` conform to `LeafElement` as long as `ViewType` is a `LeafElement`.

This way so that we can pass `LazyView` to `LeftElement` directly, instead of having to call `.loadIfNeeded`.

Differential Revision: D90431927

fbshipit-source-id: d891d1ee736889f6d4ec26b9a111994c6c57c13b
2026-01-12 11:02:38 -08:00
Chaoshuai Lyu
94eea8d748 Add unit tests for LazyView
Summary: Added unit tests to `LazyView` so that we have more coverage.

Differential Revision: D90432337

fbshipit-source-id: 83701ef8b15fc7b457945d41cc385f992ab0c4b7
2026-01-12 11:02:38 -08:00
Nick Sidiropulo
db8536b648 Full quick layout
Summary: Rendering everything using quick layout, stop using viewDidLayoutSubviews extensively

Differential Revision: D90290072

fbshipit-source-id: 1d88d585c2995e21fa97f59d029eb50d67bc9a74
2026-01-08 11:06:51 -08:00
Saadh Zahid
0408b8eb69 Fixing typos in snapshot tests file names
Summary: Some of the test files have typos, fixed.

Reviewed By: D3migod

Differential Revision: D89725386

fbshipit-source-id: d19e008a6aa49a81da6aedcfc8c02e1d07e44b2d
2026-01-05 08:43:34 -08:00
Jaxtyn
a9a87bedf1 Fix typo in defaultAlignmentIDs (#14)
Summary:
- Fixed a typo in a constant name.
- No behavior changes.

Pull Request resolved: https://github.com/facebookincubator/QuickLayout/pull/14

Differential Revision: D90108619

Pulled By: constantine-fry

fbshipit-source-id: db0070950aecc527ca5aa216db3a1f8d28739c24
2026-01-05 06:23:01 -08:00
Constantine Fry
62310c0a7f Change the wording about QuickLayout usage in IG
Summary: The previous description may have implied that QuickLayout is already widely adopted throughout Instagram, which isn't accurate. The updated wording provides a clearer and more honest message: QuickLayout is the recommended approach moving forward, but it does not exaggerate its current usage. This helps set realistic expectations: QuickLayout is the preferred solution, yet, due to the scale of Instagram’s codebase, a complete migration will take time.

Reviewed By: minmkim, saadhzahid

Differential Revision: D88381324

fbshipit-source-id: c0d2c6e0b743417f18f85e9018bb05d02de6a8a9
2025-12-06 06:33:57 -08:00
nuomi1
edf9ed03d8 Fix bodyContainerView with UITableViewHeaderFooterView and UIVisualEf… (#9)
Summary:
…fectView

Pull Request resolved: https://github.com/facebookincubator/QuickLayout/pull/9

Reviewed By: fabiomassimo

Differential Revision: D88369945

Pulled By: constantine-fry

fbshipit-source-id: 7a72f2be4a7ebc430013b49e244337c4b87d3343
2025-12-04 07:38:42 -08:00
Constantine Fry
21f38de88a Add another sample for view controllers.
Reviewed By: saadhzahid

Differential Revision: D88157540

fbshipit-source-id: 2271517051f30ca8d048046ec86e664b9b95c731
2025-12-02 15:30:47 -08:00
JonyFang
f723e5aac2 Downgrade swift-tools-version to 6.0 for broader compatibility (#3)
Summary:
This PR makes QuickLayout accessible to developers using stable Xcode versions by downgrading the Swift tools version requirement.

## Changes

- Downgrade `swift-tools-version` from 6.2 to 6.0
- Update `swift-syntax` dependency from 602.0.0 to 600.0.0
- Fix Demo project iOS deployment target from 26.0 to 15.0

## Rationale

- **Swift 6.2 requires Xcode 16.5 Beta**, which most developers don't have access to. Swift 6.0 (Xcode 16.0+) is widely available.
- **swift-syntax version must match the Swift tools version** (600.x for Swift 6.0).
- **iOS 26.0 does not exist** - this was a configuration error. Changed to 15.0 to match the `platforms` declaration in Package.swift.

## Verification

- [x] `swift package resolve` succeeds
- [x] `xcodebuild -scheme QuickLayout -destination 'platform=iOS Simulator,name=iPhone 16' build` succeeds
- [x] Demo project builds successfully

Pull Request resolved: https://github.com/facebookincubator/QuickLayout/pull/3

Reviewed By: tumtumtum

Differential Revision: D88010997

Pulled By: constantine-fry

fbshipit-source-id: 751cfb12ccdae289dae222a383aeff3962e14bb2
2025-11-28 10:34:35 -08:00
Constantine Fry
ae0d031581 Expand the docs around @QuickLayout usage and the manual integration
Summary: People have reported to me that Devmate often uses .applyFrame when using QuickLayout. However, it's against the recommendation. I updated the docs so that it's even more clear.

Differential Revision: D87983350

fbshipit-source-id: f7dd2c18a5e4de9c8b671447c9b845cadeaba4d1
2025-11-27 09:39:03 -08:00
Saadh Zahid
64ea1d62fe Fixing mistake in docs
Summary: I noticed there was a mismatch between the diagrams and the code samples--Resolved.

Differential Revision: D87924557

fbshipit-source-id: e49c7fc633891a6d340808eca1a375f95e83616f
2025-11-26 06:43:46 -08:00
Constantine Fry
38ee8fb461 Add github link and fix dark theme
Summary: {F1983762567} {F1983762568}

Reviewed By: saadhzahid

Differential Revision: D87784658

fbshipit-source-id: 920a78c27134a6df86233245b46f8e077c5a1567
2025-11-24 09:41:15 -08:00
Constantine Fry
f1bab1da4a Add a sample for CollectionViewCell
Summary: ditto

Reviewed By: saadhzahid

Differential Revision: D87453439

fbshipit-source-id: 526adb4d0ab79bdfaf18524e8a89687767c99210
2025-11-19 10:09:40 -08:00
Xavier Jurado Cristobal
0c1ab2a79e Fix vulnerability in js-yaml by upgrading to 4.1.1
Summary:
Updated the `js-yaml` dependency from version 4.1.0 to ^4.1.1 to address a known security vulnerability. The package was added as a direct dependency to ensure explicit control over the version and allow future patch and minor version updates.

This change affects the QuickLayout documentation site which uses Docusaurus. The semver range (^4.1.1) ensures that future patch versions (4.1.2, 4.1.3, etc.) and minor versions (4.2.0, 4.3.0, etc.) will be automatically picked up while preventing breaking changes from major version updates.

Reviewed By: saadhzahid

Differential Revision: D87346632

fbshipit-source-id: 0ba9971a8386264b6ef8cf4fb3c2c0cf06f8e8c1
2025-11-19 03:17:30 -08:00
Tushar Sabale
67ca636f7d Upgrade dom-iterator from 1.0.0 to 1.0.2
Summary:
The 3P Library Vulnerability Remediation Team is dedicated to remediating high-risk external libraries at Meta using both manual and automated processes. Older versions of this library have been identified as risky, and this diff stack is intended to upgrade the library to a recommended version.
We kindly request your help with the diff review. Please commandeer this diff stack if specific merges need to be added or if there are any build or dependency failures.

Asset Name: asset://code.third_party_library/fbsource/fbobjc%2FLibraries%2FMobileUI%2FQuickLayout%2Fdocs%2Fyarn.lock%23pkg:npm%2Fdom-iterator@1.0.0
Asset Version: 1.0.0
Asset Vulnerabilities:
CVE-2024-21541, CWEs: Improper Control of Generation of Code ('Code Injection')
Version to upgrade to: 1.0.1

Additional Info: This diff contains updated yarn files and changes to update vulnerable package. As a part of this diff performed below steps
update resolutions section with recommended version
run yarn install
revert changes in resolutions section
run yarn install

Reviewed By: ide-2

Differential Revision: D87274669

fbshipit-source-id: ed5fff58404052f259cedddb9a9b8f09b158aa5f
2025-11-18 12:48:19 -08:00
Constantine Fry
47ffabdb3b Update docusaurus dependencies
Reviewed By: saadhzahid

Differential Revision: D87326662

fbshipit-source-id: 70c7d927e590287b2fe89c3070b17622d0fd7255
2025-11-18 06:50:33 -08:00
facebook-github-bot
cf25689181 Initial commit
fbshipit-source-id: ac9cb65f0bb8a29acff5b6664ede5c4ce7a1a632
2025-11-14 14:11:10 -08:00