কম্পোজ রানটাইম
androidx.compose.runtime সম্পর্কে
androidx.compose.runtime.rxjava2 সম্পর্কে
androidx.compose.runtime.rxjava3 সম্পর্কে
androidx.compose.runtime.saveable সম্পর্কে
androidx.compose.runtime.snapshots সম্পর্কে
( সমস্ত কম্পোজ প্যাকেজের জন্য API রেফারেন্স ডক্স দেখুন )
| সর্বশেষ আপডেট | স্থিতিশীল রিলিজ | রিলিজ প্রার্থী | বিটা রিলিজ | আলফা রিলিজ |
|---|---|---|---|---|
| ২২ অক্টোবর, ২০২৫ | ১.৯.৪ | - | ১.১০.০-বিটা০১ | - |
গঠন
কম্পোজ হল androidx মধ্যে ৭টি Maven গ্রুপ আইডির সমন্বয়। প্রতিটি গ্রুপে কার্যকারিতার একটি লক্ষ্যবস্তু উপসেট থাকে, প্রতিটির নিজস্ব রিলিজ নোটের সেট থাকে।
এই টেবিলে প্রতিটি রিলিজ নোটের গ্রুপ এবং লিঙ্কগুলি ব্যাখ্যা করা হয়েছে।
| গ্রুপ | বিবরণ |
|---|---|
| রচনা.অ্যানিমেশন | ব্যবহারকারীর অভিজ্ঞতা সমৃদ্ধ করতে তাদের জেটপ্যাক কম্পোজ অ্যাপ্লিকেশনগুলিতে অ্যানিমেশন তৈরি করুন। |
| কম্পোজ.কম্পাইলার | @Composable ফাংশন রূপান্তর করুন এবং একটি Kotlin কম্পাইলার প্লাগইন দিয়ে অপ্টিমাইজেশন সক্ষম করুন। |
| রচনা.ভিত্তি | ব্যবহারের জন্য প্রস্তুত বিল্ডিং ব্লক সহ জেটপ্যাক কম্পোজ অ্যাপ্লিকেশন লিখুন এবং আপনার নিজস্ব ডিজাইন সিস্টেমের টুকরো তৈরি করতে ভিত্তি প্রসারিত করুন। |
| রচনা.উপাদান | ব্যবহারের জন্য প্রস্তুত মেটেরিয়াল ডিজাইন কম্পোনেন্ট দিয়ে জেটপ্যাক কম্পোজ UI তৈরি করুন। এটি কম্পোজের উচ্চ স্তরের এন্ট্রি পয়েন্ট, যা www.material.io-তে বর্ণিত উপাদানগুলির সাথে মেলে এমন উপাদান সরবরাহ করার জন্য ডিজাইন করা হয়েছে। |
| রচনা.উপাদান৩ | মেটেরিয়াল ডিজাইনের পরবর্তী বিবর্তন, মেটেরিয়াল ডিজাইন 3 কম্পোনেন্ট দিয়ে জেটপ্যাক কম্পোজ UI তৈরি করুন। মেটেরিয়াল 3-তে আপডেটেড থিমিং এবং কম্পোনেন্ট এবং মেটেরিয়াল ইউ পার্সোনালাইজেশন বৈশিষ্ট্য যেমন ডায়নামিক কালার অন্তর্ভুক্ত রয়েছে এবং এটি নতুন অ্যান্ড্রয়েড 12 ভিজ্যুয়াল স্টাইল এবং সিস্টেম UI-এর সাথে সামঞ্জস্যপূর্ণ হওয়ার জন্য ডিজাইন করা হয়েছে। |
| রচনা.রানটাইম | কম্পোজের প্রোগ্রামিং মডেল এবং স্টেট ম্যানেজমেন্টের মৌলিক বিল্ডিং ব্লক, এবং কম্পোজ কম্পাইলার প্লাগইনকে লক্ষ্য করার জন্য মূল রানটাইম। |
| কম্পোজ.ইউআই | ডিভাইসের সাথে ইন্টারঅ্যাক্ট করার জন্য কম্পোজ UI এর মৌলিক উপাদানগুলির প্রয়োজন, যার মধ্যে রয়েছে লেআউট, অঙ্কন এবং ইনপুট। |
নির্ভরতা ঘোষণা করা
কম্পোজের উপর নির্ভরতা যোগ করতে, আপনার প্রোজেক্টে গুগল ম্যাভেন রিপোজিটরি যোগ করতে হবে। আরও তথ্যের জন্য গুগলের ম্যাভেন রিপোজিটরি পড়ুন।
আপনার অ্যাপ বা মডিউলের জন্য build.gradle ফাইলে আপনার প্রয়োজনীয় আর্টিফ্যাক্টের জন্য নির্ভরতা যোগ করুন:
গ্রোভি
dependencies { implementation "androidx.compose.runtime:runtime:1.9.4" implementation "androidx.compose.runtime:runtime-livedata:1.9.4" implementation "androidx.compose.runtime:runtime-rxjava2:1.9.4" } android { buildFeatures { compose true } composeOptions { kotlinCompilerExtensionVersion = "1.5.15" } kotlinOptions { jvmTarget = "1.8" } }
কোটলিন
dependencies { implementation("androidx.compose.runtime:runtime:1.9.4") implementation("androidx.compose.runtime:runtime-livedata:1.9.4") implementation("androidx.compose.runtime:runtime-rxjava2:1.9.4") } android { buildFeatures { compose = true } composeOptions { kotlinCompilerExtensionVersion = "1.5.15" } kotlinOptions { jvmTarget = "1.8" } }
নির্ভরতা সম্পর্কে আরও তথ্যের জন্য, বিল্ড নির্ভরতা যোগ করুন দেখুন।
প্রতিক্রিয়া
আপনার মতামত জেটপ্যাককে আরও উন্নত করতে সাহায্য করবে। আপনি যদি নতুন সমস্যা আবিষ্কার করেন অথবা এই লাইব্রেরি উন্নত করার জন্য কোন ধারণা থাকে তাহলে আমাদের জানান। নতুন একটি তৈরি করার আগে দয়া করে এই লাইব্রেরিতে বিদ্যমান সমস্যাগুলি একবার দেখে নিন। আপনি তারকা বোতামে ক্লিক করে বিদ্যমান সমস্যাটিতে আপনার ভোট যোগ করতে পারেন।
আরও তথ্যের জন্য ইস্যু ট্র্যাকার ডকুমেন্টেশন দেখুন।
রানটাইম ট্রেসিং সংস্করণ 1.7
সংস্করণ 1.7.0-rc01
১৮ সেপ্টেম্বর, ২০২৪
androidx.compose.runtime:runtime-tracing:1.7.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-rc01-এ এই কমিটগুলি রয়েছে।
রানটাইম ট্রেসিং সংস্করণ 1.0
সংস্করণ 1.0.0-beta01
২৯ নভেম্বর, ২০২৩
androidx.compose.runtime:runtime-tracing:1.0.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.0.0-beta01-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.0.0-alpha05
১৫ নভেম্বর, ২০২৩
androidx.compose.runtime:runtime-tracing:1.0.0-alpha05 প্রকাশিত হয়েছে। সংস্করণ 1.0.0-alpha05-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- সর্বনিম্ন সমর্থিত স্থিতিশীল সংস্করণগুলিতে (যেমন compose-runtime এবং tracing-perfetto) পিন করা নির্ভরতা - এমন একটি সমস্যা সমাধান করা যেখানে compose-runtime-tracing অ্যাপে compose-runtime এর একটি নতুন সংস্করণ আনবে।
সংস্করণ 1.0.0-alpha04
২৩ আগস্ট, ২০২৩
androidx.compose.runtime:runtime-tracing:1.0.0-alpha04 প্রকাশিত হয়েছে। সংস্করণ 1.0.0-alpha04-এ এই কমিটগুলি রয়েছে।
নতুন বৈশিষ্ট্য
- বেঞ্চমার্ক এবং ট্রেসিং পারফেটোর সর্বশেষ সংস্করণগুলির সাথে সামঞ্জস্যপূর্ণ, অ্যাপ স্টার্টআপে (কোল্ড স্টার্ট) কম্পোজিশন ট্রেসিংয়ের জন্য সমর্থন সক্ষম করে, যেমন অ্যান্ড্রয়েডএক্স বেঞ্চমার্ক এবং অ্যান্ড্রয়েড স্টুডিওতে (হেজহগ বিটা 2 থেকে শুরু করে)।
API পরিবর্তনগুলি
-
androidx.tracing.perfetto.Traceনাম পরিবর্তন করেandroidx.tracing.perfetto.PerfettoSdkTraceকরা হয়েছে। ( I44af8 ) -
android.os.Traceএর সাথে সামঞ্জস্যপূর্ণ ট্রেসিং পারফেটো SDK API তৈরি করা। ( I73ba0 , b/282199917 ) - অ্যাপ স্টার্টআপে ট্রেসিংয়ের পূর্বশর্ত। ( Iad890 )
- পরীক্ষামূলক এবং সর্বজনীন API ফাইলগুলি একত্রিত করা হয়েছে ( I0f2e1 , b/278769092 )
সংস্করণ 1.0.0-alpha02
৮ ফেব্রুয়ারী, ২০২৩
androidx.compose.runtime:runtime-tracing:1.0.0-alpha02 প্রকাশিত হয়েছে। সংস্করণ 1.0.0-alpha02-এ এই কমিটগুলি রয়েছে।
নতুন বৈশিষ্ট্য
- কোনও কার্যকরী পরিবর্তন নেই। ডাউনস্ট্রিম নির্ভরতাগুলিতে একাধিক কর্মক্ষমতা অপ্টিমাইজেশন
androidx.tracing:tracing-perfetto*।
সংস্করণ 1.0.0-alpha01
৭ সেপ্টেম্বর, ২০২২
androidx.compose.runtime:runtime-tracing:1.0.0-alpha01 প্রকাশিত হয়েছে। সংস্করণ 1.0.0-alpha01-এ এই কমিটগুলি রয়েছে।
নতুন বৈশিষ্ট্য
-
androidx.compose.runtime:runtime-tracingহল একটি লাইব্রেরি যা - এটি সমর্থনকারী টুলিং এর উপস্থিতিতে (শীঘ্রই আসছে) - একটি Compose অ্যাপে বর্ধিত ট্রেসিংয়ের অনুমতি দেয়। এই প্রাথমিক প্রকাশটি 1.0.0-alpha01।
সংস্করণ 1.10
সংস্করণ 1.10.0-beta01
২২ অক্টোবর, ২০২৫
androidx.compose.runtime:runtime-*:1.10.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.10.0-beta01-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
-
RetainedValuesStore.getExitedValueOrDefaultএর নাম পরিবর্তন করেRetainedValuesStore.getExitedValueOrElseরাখা হয়েছে ( If9653 , b/452340613 ) -
isKeepingExitedValuesনাম পরিবর্তন করেisRetainingExitedValuesরাখা হয়েছে ( I660bf , b/437095756 ) -
RetainScopeনাম পরিবর্তন করেRetainedValuesStoreরাখা হয়েছে।RetainScopeHolderনাম পরিবর্তন করেRetainedValuesStoreRegistryরাখা হয়েছে।RetainScopeHolder.RetainScopeProviderএর নাম পরিবর্তন করেRetainedValuesStoreRegistry.ProvideChildRetainedValuesStoreরাখা হয়েছে। ( Idf23a , b/437095756 )
বাগ ফিক্স
-
SaveableStateRegistryতেSavedStateএর প্রথম ব্যবহার পর্যন্ত বিলম্বিত আরম্ভ। ( Ic0a93 )
সংস্করণ 1.10.0-alpha05
৮ অক্টোবর, ২০২৫
androidx.compose.runtime:runtime-*:1.10.0-alpha05 প্রকাশিত হয়েছে। সংস্করণ 1.10.0-alpha05-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- রিলিজ মোডে
DiagnosticComposeExceptionএর জন্য স্ট্যাক ট্রেস পূরণ করুন। ( Ib76cb ) - স্ন্যাপশট স্টেটের একটি সমস্যা সমাধান করা হয়েছে যেখানে, কোনও ধরণের জন্য মার্জ নীতি ব্যবহার করার ফলে পূর্ববর্তী মানটি ভুলভাবে গণনা করা হতে পারে যা পূর্ববর্তী মানের পরিবর্তে ভবিষ্যতের মানটি ফেরত দেবে। এটি তখন ঘটবে যখন দুটির বেশি পরিবর্তনযোগ্য স্ন্যাপশট মুলতুবি থাকে এবং প্রয়োগ করা মানগুলির মধ্যে কমপক্ষে একটিতে মার্জ নীতি থাকে। ( I527b5 , b/442791065 )
সংস্করণ 1.10.0-alpha04
২৪ সেপ্টেম্বর, ২০২৫
androidx.compose.runtime:runtime-*:1.10.0-alpha04 প্রকাশিত হয়েছে। সংস্করণ 1.10.0-alpha04-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
-
RetainScopesএর সংগ্রহ পরিচালনা করার জন্যRetainScopeHolderAPI যোগ করা হয়েছে। এটি বিভিন্ন রিটেনশন লাইফস্প্যান সহ অনেক শিশু তৈরি করে এমন কন্টেইনার এবং নেভিগেশন হোস্টের জন্য রিটেনশন বাস্তবায়নের জন্য ব্যবহার করা যেতে পারে। ( I10e0f ) -
RetainedContentHostএবংretainControlledRetainScopeAPI যোগ করা হয়েছে, যা স্বয়ংক্রিয়ভাবে পরিচালিতRetainScopesতৈরি করতে ব্যবহার করা যেতে পারে যাতে করে কলাপসিং প্যানের মতো অদৃশ্য হয়ে যাওয়া কন্টেন্ট তৈরি করা যায় ( If81f6 ) -
Updater#setএর ইনলাইন ওভারলোড বন্ধ করা হয়েছে কারণ এটি প্রদত্ত মানটি অনেকবার বক্স করছিল।Updater#initএর একটি ওভারলোড যোগ করা হয়েছে যা একটি প্যারামিটার নেয় যা ল্যাম্বডা ক্যাপচার করার প্রয়োজন এড়ায়। ( Id679e ) -
RetainedEffectপ্রবর্তন করে, যাDisposableEffectঅনুরূপ একটি পার্শ্ব-প্রতিক্রিয়া API যা কম্পোজিশন জীবনচক্রের পরিবর্তে ধরে রাখার জীবনচক্র অনুসরণ করে। এই APIটি অন্য কোনও বস্তুর ধরে রাখার সাথে সম্পর্কিত প্রভাবগুলির জন্য ব্যবহার করার উদ্দেশ্যে তৈরি করা হয়েছে যাRetainObserverবাস্তবায়ন করে না বা করতে পারে না। ( I1c61f , b/177562901 ) -
RetainObserver.onRetainedএর ডকুমেন্টেশন সংশোধন করা হয়েছে এবংRetainObserver.onUnusedযোগ করা হয়েছে, যাRememberObserver.onAbandoned( Ia6fc5 ) কে প্রতিফলিত করে।
বাগ ফিক্স
- কোনও ফাংশনের প্রথম গ্রুপের পরে (যেমন একটি কম্পোজেবল কল) এবং এমন একটি গ্রুপের আগে স্থির প্রেরণ মনে রাখা যা সরানো যেতে পারে (যেমন একটি
ifস্টেটমেন্ট) যা ভুল ক্রমেonForgottenপ্রেরণ করতে পারে। ( I453f6 , b/346821372 ) -
LaunchedEffectআরম্ভ করার সময় coroutine কনটেক্সট ট্র্যাভার্সাল এড়িয়ে চলুন। ( I8d2c3b )
সংস্করণ 1.10.0-alpha03
১০ সেপ্টেম্বর, ২০২৫
androidx.compose.runtime:runtime-*:1.10.0-alpha03 প্রকাশিত হয়েছে। সংস্করণ 1.10.0-alpha03-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
- গ্রুপ কী ভিত্তিক কম্পোজ স্ট্যাক ট্রেস প্রবর্তন করে যা সমস্ত মিনিফাই করা অ্যাপের জন্য ডিফল্টরূপে সক্রিয় থাকে। এই ট্রেসগুলির জন্য প্রোগার্ড ম্যাপিং কোটলিন 2.3.0 থেকে শুরু করে কম্পোজ কম্পাইলার গ্রেডল প্লাগইন দ্বারা তৈরি করা হবে। ( Ifbcb5 )
- ইন্টারফেস যোগ করুন: টুলিংয়ের জন্য
IdentifiableRecomposeScope( Idd5e0 , b/434194620 ) -
CompositionLocalContexts ( I3fa21 , b/412750209 ) এর সাথে সম্পর্কিত কম্পোজিশনে অপ্রয়োজনীয় অবৈধকরণ প্রতিরোধ করা হয়েছে।
বাগ ফিক্স
- ডকুমেন্টেশন এবং টুলিংয়ে স্পষ্ট করে বলা হয়েছে যে ধরে রাখার জন্য পাঠানো কীগুলিও ধরে রাখা হয়। ধরে রাখার জন্য দেওয়া কীগুলি এড়িয়ে চলুন যা মেমরি লিক হতে পারে। ( Ib553b , b/177562901 )
- একটি ভিন্ন থ্রেডে একটি পজ করা কম্পোজিশনের
resume()কল করার সময় সমস্যাটি সমাধান করা হয়েছে, মূল থ্রেড যখন পরবর্তী ফ্রেমের জন্য পজযোগ্য কম্পোজিশনটি পুনরায় কম্পোজ করার চেষ্টা করে তখন মুলতুবি থাকা বিজ্ঞপ্তিগুলির অবস্থা বিভ্রান্ত হতে পারে। ( Ie5f17 , b/442649894 ) - লগ ব্যতিক্রমগুলি কম্পোজিশনে ক্যাপচার করা হয়েছে। ( I47d78 , b/432799675 , b/436878515 , b/359623674 , b/400436355 )
সংস্করণ 1.10.0-alpha02
২৭ আগস্ট, ২০২৫
androidx.compose.runtime:runtime-*:1.10.0-alpha02 প্রকাশিত হয়েছে। সংস্করণ 1.10.0-alpha02-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
-
@DoNotRetainযোগ করা হয়েছে, যাretainAPI-এর সাথে ব্যবহার করা উচিত নয় এমন প্রকারগুলি টীকা করতে ব্যবহার করা যেতে পারে, সম্ভবত কারণ তারা রিসোর্স লিক করবে। ( Ie5435 ) - Kotlin 2.0 দিয়ে মুক্তিপ্রাপ্ত প্রকল্পগুলির জন্য KGP 2.0.0 বা তার নতুন সংস্করণ ব্যবহার করা প্রয়োজন। ( Idb6b5 )
বাগ ফিক্স
- যখন কোনও কম্পোজিশনের রুট নোড পরিবর্তন করে, তখন অ্যাপলিয়ারে সঠিকভাবে অপারেশন গণনা করার জন্য চলমান কন্টেন্ট স্থির করা হয়েছে। চলমান কন্টেন্টের জন্য পরিবর্তন গণনা করার সময় একটি
up()কল মুলতুবি রেখে অ্যাপলিয়ারে আনডিসপ্যাচ করা যেতে পারে যার ফলে পরবর্তী ব্যবহারের জন্য অ্যাপলিয়ার অবস্থা ভুলভাবে অবস্থান করতে পারে। ( I7c583 ), ( I47b70 ) -
CheckResultঅপ্রচলিত হিসেবে চিহ্নিত করে কারণ এটি ব্যবহারের জন্য নয়। ( I32934 )
সংস্করণ 1.10.0-alpha01
১৩ আগস্ট, ২০২৫
androidx.compose.runtime:runtime-*:1.10.0-alpha01 প্রকাশিত হয়েছে। সংস্করণ 1.10.0-alpha01-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
- retain API চালু করে।
rememberSaveableমতো, retain কম্পোজিশন হায়ারার্কি থেকে বেরিয়ে আসা মনে রাখা মানগুলিকে ধরে রাখতে এবং সংরক্ষণ করতে পারে। retained মানগুলি সিরিয়ালাইজ করা হয় না এবং সংরক্ষিত মানের তুলনায় তাদের আয়ুষ্কাল কম থাকে এবং androidxViewModelএর মতোই আচরণ করে। আরও বিস্তারিত জানার জন্য ডকুমেন্টেশন দেখুন। ( Ia3105 , b/177562901 ) - একটি
awaitOrScheduleNextCompositionEnd()API যোগ করা হয়েছে, যা Recomposer বর্তমান ফ্রেমটি রচনা শেষ করলে একটি কলব্যাক ইস্যু করে। যদি Recomposer বর্তমানে একটি ফ্রেম রচনা না করে, তাহলে পরবর্তী ফ্রেমের রচনা শেষ না হওয়া পর্যন্ত এই API স্থগিত থাকে এবং একটি নতুন ফ্রেম রচনা করার সময়সূচী নির্ধারণ করে। ( Ib873c ) - একটি নন-ইউনিট রিটার্নিং কম্পোজিশন স্থানীয় সরবরাহকারী API যোগ করুন ( I22521 , b/271871288 )
- একটি বৈশিষ্ট্য পতাকা যোগ করা হয়েছে,
isMovableContentUsageTrackingEnabled, যা কন্টেন্ট তৈরি করার সময় কিছু অতিরিক্ত ওভারহেড এড়াতে চলমান সামগ্রীর ব্যবহার ট্র্যাক করার অনুমতি দেয়। এই বৈশিষ্ট্য পতাকা বর্তমানে ডিফল্টরূপে অক্ষম করা আছে। ( Ia713d )
বাগ ফিক্স
- সাবকম্পোজিশনের মধ্যে স্থানান্তরিত হলে চলমান কন্টেন্টের ক্র্যাশ ঠিক করে। ( I3fa1e , b/436858107 )
- একাধিক নেস্টেড সাবকম্পোজিশনের ভিতরে থাকাকালীন কম্পোজেবল স্ট্যাক ট্রেসের কিছু অংশ অনুপস্থিত থাকা একটি বাগ সংশোধন করে। ( I98c6f )
- ডিফল্ট minSdk কে API 21 থেকে API 23 এ স্থানান্তর করা হচ্ছে ( Ibdfca , b/380448311 , b/435705964 , b/435705223 )
- একাধিক থ্রেড থেকে একটি বিরতিযোগ্য রচনার অভ্যন্তরীণ অবস্থা আপডেট করার সময় একটি রেস শর্ত ঠিক করা হয়েছে। ( I03895 )
- প্রাথমিক রচনার আগে কল করা কম্পোজিশন নিবন্ধন পর্যবেক্ষক আপডেট করে। ( I4adca , b/430600932 )
-
AutoboxingStateValuePropertyDetectorকে K1 এবং K2 উভয়ের জন্য সামঞ্জস্যপূর্ণ করার জন্য ছোটখাটো বাগ সংশোধন করা হয়েছে। ( Ie81c1 )
বহিরাগত অবদান
- runtime-rxjava2 আর্টিফ্যাক্ট মাল্টিপ্ল্যাটফর্ম তৈরি করুন এবং JVM কে একটি সমর্থিত টার্গেট হিসেবে যুক্ত করুন। ( I5409e )
- runtime-rxjava3 আর্টিফ্যাক্ট মাল্টিপ্ল্যাটফর্ম তৈরি করুন এবং JVM কে একটি সমর্থিত টার্গেট হিসেবে যুক্ত করুন। ( I97e84 )
সংস্করণ 1.9
সংস্করণ 1.9.4
২২ অক্টোবর, ২০২৫
androidx.compose.runtime:runtime-*:1.9.4 প্রকাশিত হয়েছে। সংস্করণ 1.9.4-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.9.3
৮ অক্টোবর, ২০২৫
androidx.compose.runtime:runtime-*:1.9.3 প্রকাশিত হয়েছে। সংস্করণ 1.9.3-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.9.2
২৪ সেপ্টেম্বর, ২০২৫
androidx.compose.runtime:runtime-*:1.9.2 প্রকাশিত হয়েছে। সংস্করণ 1.9.2-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.9.1
১০ সেপ্টেম্বর, ২০২৫
androidx.compose.runtime:runtime-*:1.9.1 প্রকাশিত হয়েছে। সংস্করণ 1.9.1-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- রচনার প্রক্রিয়াধীন রচনাগুলি পুনর্নির্মাণ করা এড়িয়ে চলুন। ( Iacb01 )
- রিকম্পোজ স্কোপগুলিকে দুবার পজ করা থেকে বিরত রাখুন। ( I060b2 , b/431584881 )
সংস্করণ 1.9.0
১৩ আগস্ট, ২০২৫
androidx.compose.runtime:runtime-*:1.9.0 প্রকাশিত হয়েছে। সংস্করণ 1.9.0-এ এই কমিটগুলি রয়েছে।
১.৮.০ থেকে গুরুত্বপূর্ণ পরিবর্তনগুলি
- এখন Compose-এর সাথে পাঠানো Lint চেকের জন্য ন্যূনতম 8.8.2 AGP সংস্করণ প্রয়োজন। যদি আপনি AGP আপগ্রেড করতে না পারেন, তাহলে আপনি আপনার gradle.properties-এ
android.experimental.lint.version=8.8.2(অথবা নতুন সংস্করণ) ব্যবহার করে Lint নিজেই আপগ্রেড করতে পারেন। IDE-এর ভিতরে Compose lint চেক চালানোর জন্য, Android Studio Ladybug বা নতুন সংস্করণ প্রয়োজন। - একটি নতুন রানটাইম-অ্যানোটেশন লাইব্রেরি তৈরি করা হয়েছে। এতে কম্পোজ রানটাইমের উপর নির্ভরতা ছাড়াই অ্যানোটেশনের সংজ্ঞা রয়েছে, তাই এটি নন-কম্পোজ মডিউল থেকে ব্যবহার করা যেতে পারে।
-
@Stable,@Immutable, এবং@StableMarkerruntime-annotation এ সরানো হয়েছে, যাতে নন-রচনা মডিউলগুলি টীকাবদ্ধ করা যায়। -
@FrequentlyChangingValueএবং@RememberInCompositionরানটাইম-অ্যানোটেশনে যোগ করা হয়েছে।@FrequentlyChangingValueএমন ঘোষণা চিহ্নিত করে যা ঘন ঘন পুনর্গঠনের কারণ হতে পারে, এবং@RememberInCompositionএমন ঘোষণা চিহ্নিত করে যা রচনায় মনে রাখা উচিত। সংশ্লিষ্ট লিন্ট চেক ভুল ব্যবহারের জন্য সতর্ক করে।
-
সংস্করণ 1.9.0-rc01
৩০ জুলাই, ২০২৫
androidx.compose.runtime:runtime-*:1.9.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 1.9.0-rc01-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- প্রাথমিক রচনার আগে কল করা কম্পোজিশন নিবন্ধন পর্যবেক্ষক আপডেট করে। ( I4adca , b/430600932 )
সংস্করণ 1.9.0-beta03
১৬ জুলাই, ২০২৫
androidx.compose.runtime:runtime-*:1.9.0-beta03 প্রকাশিত হয়েছে। সংস্করণ 1.9.0-beta03-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.9.0-beta02
২ জুলাই, ২০২৫
androidx.compose.runtime:runtime-*:1.9.0-beta02 প্রকাশিত হয়েছে। সংস্করণ 1.9.0-beta02-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- কম্পোজিশনের মধ্যে স্লট টেবিলের মানগুলির রেফারেন্স লাইফটাইম কমিয়ে দেওয়া হয়েছে। এমন কিছু ক্ষেত্রে আছে যেখানে স্লট টেবিলের একটি রেফারেন্স প্রয়োজনের চেয়ে বেশি সময় ধরে একটি ফ্রেম টিকে থাকতে পারে। ( I49e74 , b/418516940 )
- হট রিলোড পদ্ধতির জন্য কোটলিন ম্যাঙ্গেল সরান। ( Ic56a3 , b/426871325 )
সংস্করণ 1.9.0-beta01
১৮ জুন, ২০২৫
androidx.compose.runtime:runtime-*:1.9.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.9.0-beta01-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
- কম্পোজ কম্পাইলার দ্বারা যোগ করা উৎস তথ্য পার্স করার জন্য একটি টুলিং API যোগ করা হয়েছে। ( Iceaf9 , b/408492167 )
-
SnapshotStateSetএখন Android-এParcelableপ্রয়োগ করে, এটি এখনrememberSaveable { ... }অংশ হিসেবে ব্যবহার করা যেতে পারে। ( I755dd , b/378623803 ) -
SnapshotStateListএখন Android-এParcelableপ্রয়োগ করে, এটি এখনrememberSaveable { ... }অংশ হিসেবে ব্যবহারের জন্য সমর্থিত। ( Id18be , b/378623803 ) -
movableContentOf()এখন@RememberInCompositionঅ্যানোটেশন দিয়ে চিহ্নিত, যা লিন্টকে ভুল ব্যবহার ধরার অনুমতি দেয় ( I2738d ) - পুনর্গঠনের কারণগুলির আরও ব্যাপক পর্যবেক্ষণের জন্য পরীক্ষামূলক রচনা পর্যবেক্ষক API আপডেট করা হয়েছে ( I32b6a )
- এই বৈশিষ্ট্যের ভবিষ্যতের বিকাশের জন্য পরীক্ষামূলকভাবে সেট পরিবর্তন করুন
setDiagnosticStackTraceEnabled। ( I11db3 ) -
currentCompositeKeyHashএখন বন্ধ করা হয়েছে। পরিবর্তেcurrentCompositeKeyHashCodeব্যবহার করুন। প্রতিস্থাপন API একই হ্যাশকে আরও বিট দিয়ে এনকোড করে, যা কম্পোজিশন হায়ারার্কিতে দুটি এলোমেলোভাবে সম্পর্কহীন গ্রুপের একই হ্যাশ কী থাকার সম্ভাবনাকে দ্রুত হ্রাস করে। ( I4cb6a , b/177562901 ) - Kotlin 2.0 দিয়ে মুক্তিপ্রাপ্ত প্রকল্পগুলির জন্য KGP 2.0.0 বা তার নতুন সংস্করণ ব্যবহার করা প্রয়োজন ( Idb6b5 )
-
@Stable,@Immutable, এবং@StableMarkerruntime-annotation এ স্থানান্তরিত করা হয়েছে (একটি সামঞ্জস্যপূর্ণ উপায়ে)। আপনি যদি compose এর উপর নির্ভর করে না এমন লাইব্রেরি থেকে এই টীকাগুলি ব্যবহার করতে চান তবে আপনি এখন runtime-annotation এর উপর নির্ভর করতে পারেন। ( I23a16 ) -
KSerializerগ্রহণকারীrememberSaveableওভারলোডের নাম পরিবর্তন করেrememberSerializableকরা হয়েছে। এই পরিবর্তনটিkotlinx.serializationসাথে এর উদ্দেশ্যমূলক ব্যবহার স্পষ্ট করে।rememberSaveableএ সরাসরি সাধারণkotlinx.Serializableক্লাসগুলিকে সমর্থন করার জন্য একটিreifiedটাইপ প্যারামিটারের প্রয়োজন হবে, যা সমস্ত কল সাইটকে কম্পাইলের সময় reified টাইপ তথ্য প্রদানের মাধ্যমে সোর্স সামঞ্জস্যতা ভেঙে দেবে। ( Idb875 , I38627 , b/376028110 )
বাগ ফিক্স
- যেসব রচনায় বিরতিহীন কন্টেন্ট সেট করা হয়েছিল এবং বাতিল করা হয়েছে, সেগুলো অবশ্যই ফেলে দিতে হবে। এটি এখন রচনা দ্বারা পরীক্ষা করা হবে এবং যদি এটি পুনরায় ব্যবহার করা হয় তবে তা ফেলে দেওয়া হবে। ( I2daa5 , b/406792785 )
- যখন পজযোগ্য কম্পোজিশনটি নিষ্পত্তি করা হবে তখন কোনও জালিয়াতিপূর্ণ
onForgottento remember পর্যবেক্ষক পাঠানো বন্ধ করার জন্য স্থির পজযোগ্য কম্পোজিশন। বাতিল পজযোগ্য কম্পোজিশনে থাকাRememberObserversশুধুমাত্র onAbandoned পাঠানো উচিত। ( I26f54 ) - চলমান কন্টেন্ট প্রক্রিয়াকরণের দেরী পর্যায়ে আসা অবৈধকরণগুলি কম্পোজারে যোগ করা হয় কিন্তু যখন বিষয়বস্তু সরানো হয় তখন এই অবৈধকরণগুলি আপডেট করা হয় না যার ফলে বিষয়বস্তুটি ভুল জায়গায় পুনরায় কম্পোজ করা হয়, এমন একটি চলমান কন্টেন্ট সমস্যা সমাধান করা হয়েছে। ( Icd2fa , b/409439507 )
- যখন চলমান কন্টেন্ট তৈরির পরে কিন্তু সরানোর আগে অবৈধ হয়ে যায়, তখন একটি সমস্যা সমাধান করা হয়েছে। ( I99eac , b/229001114 )
-
SnapshotStateListদ্বারা তৈরি একটি তালিকা ইটারেটরেরremove()কলিং,previous()কল করার পরে, তালিকা থেকে ভুল উপাদানটি সরিয়ে ফেলতে পারে এবং একই ক্রমিক কলের জন্যArrayListযা করে তার সাথে মেলে না। ( I05ab7 , b/417493222 ) -
onForgottonএর ডিসপ্যাচিং এর সাথে একটি অর্ডারিং সমস্যা সমাধান করা হয়েছে, যা, উদাহরণস্বরূপ,onDisposeঅফ ডিসপোজেবল ইফেক্টগুলিকে ভুল ক্রমে কার্যকর করতে পারে। ( Ic1c91 , b/417450712 ) - বিরতিযোগ্য রচনায় পুনঃব্যবহারের অবস্থা পরিচালনার জন্য ঠিক করুন ( Ife96e , b/404058957 )
- যখন কোনও রচনা বিরতি দেওয়া হয় এবং পুনরায় চালু করা হয়, তখন পুনঃব্যবহারের অবস্থা ঠিক করা হয়েছে, কিন্তু পূর্বে বিরতি দেওয়া কিছু অবস্থা পুনঃপ্রতিষ্ঠা করার প্রয়োজন হয়েছে কারণ রচনা বিরতি দেওয়া হয়েছিল, তখন কিছু অবস্থা পরিবর্তিত হয়েছিল। ( I441d1 , b/416209738 )
- সমস্যা b/404058957 এর জন্য পজযোগ্য কম্পোজিশন মনে রাখার জন্য ডিসপ্যাচ ফিক্স সম্পন্ন হয়েছে। পূর্ববর্তী ফিক্সটি অসম্পূর্ণ ছিল। ( I1afd4 , b/404058957 )
-
OffsetApplierএখন সঠিকভাবেapply()কে ওভাররাইড করে যা pausable composition এর সাথে চালু করা হয়েছিল। এটি না থাকলে ভার্চুয়াল নোড আপডেট করার সময় pausable composition একটি ব্যতিক্রম তৈরি করতে পারে। ( Idbf31 , b/409291131 ) - ফ্রেম পাঠানোর সময়
FrameClock.withFrameNanosএ স্থগিত কল বাতিল করা হলে Molecule ব্যবহারকারীদের উপর প্রভাব ফেলতে পারে এমন একটি অচলাবস্থার সমাধান করা হয়েছে। ( I89cab , b/407027032 ) - চলমান কন্টেন্টের সাথে রিকম্পোজারটি অলস থাকতে পারে ( Ie5416 , b/409267170 )
- বিরতিযোগ্য রচনার সময়
onReuseএবংonDeactivateযে ক্রমে উল্টে যেতে পারে। এখন এগুলিonDeactivate/onReuseএর ক্রমানুসারে ঘটবে বলে নিশ্চিত করা হচ্ছে। ( I996e4 , b/404058957 ) - একই প্রয়োগে ( I570b2 , b/404645679 , b/407931790 ) মনে রাখা/ভুলে যাওয়া পাঠানো এড়াতে পজযোগ্য রচনায় মনে রাখা পর্যবেক্ষকদের প্রেরণ ঠিক করুন।
-
MainThreadচেক অক্ষম করতে এবং থ্রেডিং সমস্যা সমাধানের জন্য কম্পোজ মাল্টিপ্ল্যাটফর্মেLifecycleRegistryঅনিরাপদ মোডে স্যুইচ করা হয়েছে। বিস্তারিত জানার জন্য CMP-8227 দেখুন। ( Icee87 )
বহিরাগত অবদান
- Molecule ব্যবহারকারীদের প্রভাবিত করে এমন একটি বাগ সংশোধন করা হয়েছে যেখানে
RecompositionMode.Immediateব্যবহার করার ফলে রিকম্পোজিশন মিস হতে পারে। ( I9f3a9 , b/419527812 ) - এক্সপোজড
PausableCompositionisAppliedএবংisCancelledগেটার যাPausableCompositionঅবস্থা পরীক্ষা করার অনুমতি দেয়। ( I994aa ) -
FunctionKeyMetaটীকাতেAnnotationTarget.FUNCTIONযোগ করা হয়েছে। ( I08021 )
সংস্করণ 1.9.0-alpha04
৪ জুন, ২০২৫
androidx.compose.runtime:runtime-*:1.9.0-alpha04 প্রকাশিত হয়েছে। সংস্করণ 1.9.0-alpha04-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
-
SnapshotStateSetএখন Android-এ Parcelable প্রয়োগ করে, এটি এখনrememberSaveable { ... }অংশ হিসেবে ব্যবহার করা যেতে পারে। ( I755dd , b/378623803 ) -
SnapshotStateListএখন Android-এ Parcelable প্রয়োগ করে, এটি এখনrememberSaveable { ... }অংশ হিসেবে ব্যবহারের জন্য সমর্থিত। ( Id18be , b/378623803 ) -
movableContentOf()এখন@RememberInCompositionঅ্যানোটেশন দিয়ে চিহ্নিত, যা লিন্টকে ভুল ব্যবহার ধরার অনুমতি দেয় ( I2738d ) - পুনর্গঠনের কারণগুলির আরও ব্যাপক পর্যবেক্ষণের জন্য পরীক্ষামূলক রচনা পর্যবেক্ষক API আপডেট করা হয়েছে ( I32b6a )
বাগ ফিক্স
-
onForgottonএর ডিসপ্যাচিং এর সাথে একটি অর্ডারিং সমস্যা সমাধান করা হয়েছে, যা, উদাহরণস্বরূপ,onDisposeঅফ ডিসপোজেবল ইফেক্টগুলিকে ভুল ক্রমে কার্যকর করতে পারে। ( Ic1c91 , b/417450712 ) - বিরতিযোগ্য রচনায় পুনঃব্যবহারের অবস্থা পরিচালনার জন্য ঠিক করুন ( Ife96e , b/404058957 )
- K1 এবং K2 ( Ie4878 ) উভয়ের জন্য পরিবর্তনযোগ্য সংগ্রহ সনাক্তকরণ সামঞ্জস্যপূর্ণ করার জন্য ছোটখাটো বাগ সংশোধন করা হয়েছে।
- K1 এবং K2 ( I9900d ) উভয়ের জন্য সামঞ্জস্যপূর্ণ ওভাররাইড করা প্রপার্টি অ্যাক্সেসরগুলিতে অ্যানোটেশন লুকআপ তৈরি করতে ছোটখাটো বাগ সংশোধন করা হয়েছে।
বহিরাগত অবদান
- Molecule ব্যবহারকারীদের প্রভাবিত করে এমন একটি বাগ সংশোধন করা হয়েছে যেখানে
RecompositionMode.Immediateব্যবহার করার ফলে রিকম্পোজিশন মিস হতে পারে। ( I9f3a9 , b/419527812 ) - এক্সপোজড
PausableCompositionisApplied এবংisCancelledগেটার যাPausableCompositionঅবস্থা পরীক্ষা করার অনুমতি দেয়। ( I994aa )
সংস্করণ 1.9.0-alpha03
২০ মে, ২০২৫
androidx.compose.runtime:runtime-*:1.9.0-alpha03 প্রকাশিত হয়েছে। সংস্করণ 1.9.0-alpha03-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
- এই বৈশিষ্ট্যের ভবিষ্যতের বিকাশের জন্য পরীক্ষামূলকভাবে সেট পরিবর্তন করুন
setDiagnosticStackTraceEnabled। ( I11db3 )
বাগ ফিক্স
- যখন কোনও রচনা বিরতি দেওয়া হয় এবং পুনরায় চালু করা হয়, তখন পুনঃব্যবহারের অবস্থা ঠিক করা হয়েছে, কিন্তু পূর্বে বিরতি দেওয়া কিছু অবস্থা পুনঃপ্রতিষ্ঠা করার প্রয়োজন হয়েছে কারণ রচনা বিরতি দেওয়া হয়েছিল, তখন কিছু অবস্থা পরিবর্তিত হয়েছিল। ( I441d1 , b/416209738 )
- সমস্যা b/404058957 এর জন্য পজযোগ্য কম্পোজিশন মনে রাখার জন্য ডিসপ্যাচ ফিক্স সম্পন্ন হয়েছে। পূর্ববর্তী ফিক্সটি অসম্পূর্ণ ছিল। ( I1afd4 , b/404058957 )
-
SaveableStateHolder.SaveableStateProviderএখন কম্পোজিশনের মাধ্যমে তার কন্টেন্টে একটিLocalSavedStateRegistryOwnerপ্রদান করে। ( Ia2761 , b/413108878 ) -
androidx.compose.runtime.saveableএখনandroidx.lifecycle.runtime.composeএর উপর নির্ভর করে। ( I53228 , b/413108878 )
সংস্করণ 1.9.0-alpha02
৭ মে, ২০২৫
androidx.compose.runtime:runtime-*:1.9.0-alpha02 প্রকাশিত হয়েছে। সংস্করণ 1.9.0-alpha02-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
- কাস্টম 'কী' ব্যবহার করে
rememberSaveableডিপ্রিকেটেড করা হয়েছে। এটি পজিশনাল স্কোপিংকে বাইপাস করে, যার ফলে স্টেট বাগ এবং অসঙ্গত আচরণ দেখা দেয় (যেমন, অনিচ্ছাকৃত স্টেট শেয়ারিং বা ক্ষতি, নেস্টেডLazyLayoutsএ সমস্যা)। সামঞ্জস্যপূর্ণ, স্থানীয়ভাবে-স্কোপড স্টেটের জন্য পজিশনাল স্কোপিং ব্যবহার করতে দয়া করে 'কী' প্যারামিটারটি সরিয়ে দিন। আরও বিস্তারিত জানার জন্য সম্পূর্ণ কমিট বার্তাটি দেখুন। ( I5e6ff , b/357685851 )
বাগ ফিক্স
-
OffsetApplierএখন সঠিকভাবেapply()কে ওভাররাইড করে যা pausable composition এর সাথে চালু করা হয়েছিল। এটি না থাকলে pausable composition ভার্চুয়াল নোড আপডেট করার সময় একটি ব্যতিক্রম থ্রো করতে পারে। ( Idbf31 , b/409291131 ) - ফ্রেম পাঠানোর সময়
FrameClock.withFrameNanosএ স্থগিত কল বাতিল করা হলে Molecule ব্যবহারকারীদের উপর প্রভাব ফেলতে পারে এমন একটি অচলাবস্থার সমাধান করা হয়েছে। ( I89cab , b/407027032 ) - রিকম্পোজারটি অলস অবস্থায় থাকতে পারে, যেখানে চলমান কন্টেন্ট অবস্থা এখনও বাতিল করার অপেক্ষায় থাকে। সাধারণত এটি ঘটে না কারণ রিকম্পোজারের প্রধান লুপে চলমান কন্টেন্ট অবস্থা বাতিল করা হয়। তবে,
resume()( Ie5416 , b/409267170 ) এর সময় চলমান কন্টেন্ট বাতিল করা হলে এটি বিরতিযোগ্য রচনায় ঘটতে পারে। - বিরতিযোগ্য রচনার সময়
onReuseএবংonDeactivateযে ক্রমে উল্টে যেতে পারে। এখন এগুলিonDeactivate/onReuseএর ক্রমে ঘটবে বলে নিশ্চিত করা হচ্ছে। ( I996e4 , b/404058957 )
সংস্করণ 1.9.0-alpha01
২৩ এপ্রিল, ২০২৫
androidx.compose.runtime:runtime-*:1.9.0-alpha01 প্রকাশিত হয়েছে। সংস্করণ 1.9.0-alpha01-এ এই কমিটগুলি রয়েছে।
আচরণগত পরিবর্তন
- এখন Compose এর সাথে পাঠানো Lint চেকের জন্য ন্যূনতম 8.8.2 AGP সংস্করণ প্রয়োজন। যদি আপনি AGP আপগ্রেড করতে না পারেন, তাহলে আপনি আপনার
gradle.propertiesএandroid.experimental.lint.version=8.8.2(অথবা একটি নতুন সংস্করণ) ব্যবহার করে Lint নিজেই আপগ্রেড করতে পারেন। IDE এর ভিতরে Compose lint চেক চালানোর জন্য, Android Studio Ladybug বা নতুন সংস্করণ প্রয়োজন।
API পরিবর্তনগুলি
-
currentCompositeKeyHashএখন বন্ধ করা হয়েছে। পরিবর্তেcurrentCompositeKeyHashCodeব্যবহার করুন। প্রতিস্থাপন API একই হ্যাশকে আরও বিট দিয়ে এনকোড করে, যা কম্পোজিশন হায়ারার্কিতে দুটি এলোমেলোভাবে সম্পর্কহীন গ্রুপের একই হ্যাশ কী থাকার সম্ভাবনাকে দ্রুত হ্রাস করে। ( I4cb6a , b/177562901 ) - Kotlin 2.0 দিয়ে মুক্তিপ্রাপ্ত প্রকল্পগুলির জন্য KGP 2.0.0 বা তার নতুন সংস্করণ ব্যবহার করা প্রয়োজন ( Idb6b5 )
-
@Stable,@Immutable, এবং@StableMarkerruntime-annotation এ স্থানান্তরিত করা হয়েছে (একটি সামঞ্জস্যপূর্ণ উপায়ে)। আপনি যদি compose এর উপর নির্ভর করে না এমন লাইব্রেরি থেকে এই টীকাগুলি ব্যবহার করতে চান তবে আপনি এখন runtime-annotation এর উপর নির্ভর করতে পারেন। ( I23a16 ) -
onCreatingএবংonDisposingমুছে ফেলে কারণ এগুলিকে অবচিত করেonPreCreateএবংonPreDisposeনামকরণ করা হয়েছিল। এই পরিবর্তনটি rename সম্পূর্ণ করে। ( I97461 ) - কম্পোজিশনের একটি কম্পোজিশন নোডের অবস্থানের উপর ভিত্তি করে একটি কম্পোজিশন স্ট্যাক ট্রেস সংযুক্ত করার অনুমতি দেয় এমন একটি কম্পোজিশন স্থানীয় এক্সপোজ করুন। ( Ie0bda , b/354163858 )
- কম্পোজিশনে সংরক্ষিত উৎস তথ্যের উপর ভিত্তি করে ডায়াগনস্টিক কম্পোজ স্ট্যাক ট্রেস চালু করুন। ( I3db9f , b/354163858 )
-
runWithTimingDisabledrunWithMeasurementDisabledএর পরিবর্তে বাতিল করুন, যা আচরণটিকে আরও স্পষ্টভাবে বর্ণনা করে - সমস্ত মেট্রিক্স পজ করা হয়েছে। অতিরিক্তভাবে,MicrobenchmarkScopeসুপারক্লাসটি প্রকাশ করুন কারণrunWithMeasurementDisabledফাংশনটিকে অ্যাক্সেস খোলার জন্য পুনরায় ঘোষণা করা সম্ভব নয়, কারণ এটি ইনলাইন। ( I9e23b , b/389149423 , b/149979716 ) -
@FrequentlyChangingValue: যোগ করে একটি অ্যানোটেশন যা ফাংশন এবং প্রোপার্টি গেটার চিহ্নিত করতে পারে, যাতে বোঝা যায় যে তাদের সরাসরি কম্পোজিশনের ভিতরে ডাকা উচিত নয়, কারণ এর ফলে ঘন ঘন পুনর্গঠন হতে পারে। উদাহরণস্বরূপ, স্ক্রোল পজিশন মান এবং অ্যানিমেটিং মান চিহ্নিত করা। সংশ্লিষ্ট লিন্ট চেক দ্বারা সতর্কতা প্রদান করা হয়। ( I83630 , b/234042500 ) -
@RememberInCompositionযোগ করে: একটি অ্যানোটেশন যা কনস্ট্রাক্টর, ফাংশন এবং প্রোপার্টি গেটার চিহ্নিত করতে পারে, যা নির্দেশ করে যে মনে না রেখে তাদের সরাসরি কম্পোজিশনের ভিতরে ডাকা উচিত নয়। একটি সংশ্লিষ্ট লিন্ট চেক দ্বারা ত্রুটিগুলি উত্থাপিত হবে। এই অ্যানোটেশনটি এমন ঘোষণাগুলি চিহ্নিত করতে ব্যবহার করা যেতে পারে যা স্টেটফুল / পরিবর্তনযোগ্য বস্তুগুলি ফেরত দেয়, এমন বস্তু যার পরিচয় রচনাগুলিতে বজায় রাখা গুরুত্বপূর্ণ, অথবা এমন বস্তু যা তাৎক্ষণিকভাবে ব্যয়বহুল এবং রচনাগুলিতে ক্যাশে করা উচিত। ( Ie7db0 ) - KotlinX Serialization ব্যবহার করে টাইপ-সেফ স্টেট পারসিস্টেন্সের জন্য
KSerializerসমর্থন করে এমন একটি নতুনrememberSaveableওভারলোড যোগ করা হয়েছে। বিদ্যমানSaverভিত্তিক API এখনও সমর্থিত। ( Iea4ab , b/376028110 )
বাগ ফিক্স
- একই প্রয়োগে ( I570b2 , b/404645679 , b/407931790 ) মনে রাখা/ভুলে যাওয়া পাঠানো এড়াতে পজযোগ্য রচনায় মনে রাখা পর্যবেক্ষকদের প্রেরণ ঠিক করুন।
- API নির্দেশিকাগুলির সাথে মিল রাখার জন্য
SnapshotObserverপদ্ধতিগুলির নাম onCreating-এonPreCreateএবংonDisposingনামonPreDisposeএ পরিবর্তন করা হয়েছে। পূর্ববর্তী পদ্ধতিগুলি অবচিত এবং নতুন পদ্ধতিগুলি ডিফল্টভাবে পুরানোগুলিকে কল করে, তাই এই ইন্টারফেসের বিদ্যমান বাস্তবায়নগুলি পদ্ধতিগুলি অপসারণ না করা পর্যন্ত কাজ করতে থাকবে। এই পদ্ধতিগুলি 1.9.0 আলফাতে একটি ফলো-আপ CL-তে সরানো হবে যা শীঘ্রই এটি অনুসরণ করবে। 1.8 স্থিতিশীলের আগে এগুলি 1.8 বিটা থেকে সরানো হবে। ( I6d753 ) - একটি চলমান গোষ্ঠীর পরে প্রদর্শিত একটি এলিয়েড গোষ্ঠী পুনর্গঠনের সময় মনে রাখা মানগুলি ভুলভাবে ভুলে যাওয়া এবং পুনরায় গণনা করা যেতে পারে এমন একটি সমস্যা সমাধান করা হয়েছে ( I62cab , b/383769314 )
-
LaunchedEffectএবংrememberCoroutineScope( I705c0 , b/354163858 ) এ কম্পোজ স্ট্যাক ট্রেসের জন্য সমর্থন যোগ করা হয়েছে। - কম্পোজ লিন্ট চেকের জন্য এখন কমান্ড লাইন থেকে ন্যূনতম 8.8.2 AGP সংস্করণ এবং IDE সমর্থনের জন্য কমপক্ষে Android Studio Ladybug প্রয়োজন। আপনি যদি AGP এর একটি পুরানো সংস্করণ ব্যবহার করেন, তাহলে AGP কে প্রভাবিত না করে Lint সংস্করণ আপগ্রেড করার জন্য gradle.properties তে
android.experimental.lint.version=8.8.2সেট করতে পারেন। ( I6f2a8 )
বহিরাগত অবদান
-
FunctionKeyMetaটীকাতেAnnotationTarget.FUNCTIONযোগ করা হয়েছে। ( I08021 )
সংস্করণ 1.8
সংস্করণ 1.8.3
১৮ জুন, ২০২৫
androidx.compose.runtime:runtime-*:1.8.3 প্রকাশিত হয়েছে। সংস্করণ 1.8.3-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.8.2
২০ মে, ২০২৫
androidx.compose.runtime:runtime-*:1.8.2 প্রকাশিত হয়েছে। সংস্করণ 1.8.2-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.8.1
৭ মে, ২০২৫
androidx.compose.runtime:runtime-*:1.8.1 প্রকাশিত হয়েছে। সংস্করণ 1.8.1-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.8.0
২৩ এপ্রিল, ২০২৫
androidx.compose.runtime:runtime-*:1.8.0 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.8.0-rc03
৯ এপ্রিল, ২০২৫
androidx.compose.runtime:runtime-*:1.8.0-rc03 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-rc03-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.8.0-rc02
২৬ মার্চ, ২০২৫
androidx.compose.runtime:runtime-*:1.8.0-rc02 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-rc02-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.8.0-rc01
১২ মার্চ, ২০২৫
androidx.compose.runtime:runtime-*:1.8.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-rc01-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
- API নির্দেশিকাগুলির সাথে মিল রাখার জন্য
SnapshotObserverপদ্ধতিগুলির নাম onCreating-এonPreCreateএবংonDisposingনামonPreDisposeএ পরিবর্তন করা হয়েছে। পূর্ববর্তী পদ্ধতিগুলি অবচিত এবং নতুন পদ্ধতিগুলি ডিফল্টভাবে পুরানোগুলিকে কল করে, তাই এই ইন্টারফেসের বিদ্যমান বাস্তবায়নগুলি পদ্ধতিগুলি অপসারণ না করা পর্যন্ত কাজ করতে থাকবে। এই পদ্ধতিগুলি 1.9.0 আলফাতে একটি ফলো-আপ CL-তে সরানো হবে যা শীঘ্রই এটি অনুসরণ করবে। 1.8 স্থিতিশীলের আগে এগুলি 1.8 বিটা থেকে সরানো হবে। ( I6d753 )
সংস্করণ 1.8.0-beta03
২৬ ফেব্রুয়ারী, ২০২৫
androidx.compose.runtime:runtime-*:1.8.0-beta03 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-beta03-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.8.0-beta02
১২ ফেব্রুয়ারী, ২০২৫
androidx.compose.runtime:runtime-*:1.8.0-beta02 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-beta02-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- স্থগিত রচনায় রেথ্রো ব্যতিক্রম পেয়েছে। ( 384486d )
সংস্করণ 1.8.0-beta01
২৯ জানুয়ারী, ২০২৫
androidx.compose.runtime:runtime-*:1.8.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-beta01-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
- ব্যতিক্রম থেকে প্রসারিত না হওয়া কম্পোজিশনের সময় একটি থ্রোয়েবল উত্থাপন করলে 'মুলতুবি থাকা কম্পোজিশন প্রয়োগ করা হয়নি' ত্রুটি দেখা দিতে পারে এমন একটি সমস্যার সমাধান করে। ( I356be , b/382094412 )
সংস্করণ 1.8.0-alpha08
১৫ জানুয়ারী, ২০২৫
androidx.compose.runtime:runtime-*:1.8.0-alpha08 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-alpha08-এ এই কমিটগুলি রয়েছে।
সংস্করণ 1.8.0-alpha07
১১ ডিসেম্বর, ২০২৪
androidx.compose.runtime:runtime-*:1.8.0-alpha07 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-alpha07-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
- যেখানে কম্পোজিশনগুলিকে একত্রিত করার জন্য কোনও নোড ব্যবহার করা হয় না, সেখানে প্যারেন্ট কম্পোজিশনের সাথে সাবকম্পোজিশনগুলিকে সম্পর্কযুক্ত করতে লেআউট ইন্সপেক্টরকে সাহায্য করে এমন টুলিং API যোগ করা হয়েছে। ( I4ce3d )
-
SnapshotIdএর জন্য পাটিগণিত এবং বিশেষ ধ্রুবকগুলিকে পাবলিকের পরিবর্তে অভ্যন্তরীণ করে তৈরি করা হয়েছে। প্রয়োজনেSnasphotIdতে পাটিগণিত সম্পাদন করা যেতে পারে, যথাক্রমেtoInt()অথবাtoLong()ব্যবহার করেIntঅথবাLongএ রূপান্তর করে। ( Ic3a57 )
বহিরাগত অবদান
-
movableContentOfপ্যারামিটারের জন্য স্টোরেজ অপ্টিমাইজ করুন। ( ed87177 )
সংস্করণ 1.8.0-alpha06
১৩ নভেম্বর, ২০২৪
androidx.compose.runtime:runtime-*:1.8.0-alpha06 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-alpha06-এ এই কমিটগুলি রয়েছে।
API পরিবর্তনগুলি
-
PausableCompositionAPI-তে পরিবর্তন। এই ব্রেকিং পরিবর্তনগুলি 1.8.0-alpha-এর পূর্ববর্তী রিলিজের (1.8.0-alpha02 থেকে) সাথে সম্পর্কিত, কিন্তু যেহেতু এগুলি 1.8.0-এ নতুন API, তাই API গুলি এখনও আলফাতে থাকায় পিছনের দিকে সামঞ্জস্য বজায় রাখা হয়নি। ( I39819 ) - একটি রিকম্পোজার ( Iaeb7e ) এর মধ্যে নতুন রচনা তৈরি পর্যবেক্ষণ করার জন্য টুলিং API যোগ করে।
- Snapshot-এ
snapshotIdLongSnapshotযোগ করা হয়েছে এবংidঅবচিত করা হয়েছে। খুব উচ্চ ফ্রেম রেট এবং দীর্ঘ সময় ধরে চলমান অ্যানিমেশন সহ সিস্টেমগুলিতে স্ন্যাপশট আইডি ওভারফ্লো হওয়া এড়াতে স্ন্যাপশটের আইডিIntথেকেLongএ পরিবর্তন করা হয়েছে। এই টাইপটিInt, অথবা অন্য ধরণের প্ল্যাটফর্মগুলিতে হতে পারে এমন প্রত্যাশিত/প্রকৃত করার জন্য, যে প্ল্যাটফর্মগুলিতে NativeLongটাইপ নেই। যেসব প্ল্যাটফর্মে NativeLongনেই, যেমন JavaScript, তাদের উচ্চ ফ্রেম রেট (1000 FPS-এর বেশি) এড়ানো উচিত যা প্রতি 24 দিনেIntজন্য ওভারফ্লো হতে পারে। ( I38ac3 , b/374821679 )
বাগ ফিক্স
- একটি একক
providesজন্য স্থিরprovidesDefault। ( aosp/3318540 b/374263387 ) -
ChangeListঅপ্টিমাইজ করুন। ( 3318538 )
সংস্করণ 1.8.0-alpha05
৩০ অক্টোবর, ২০২৪
androidx.compose.runtime:runtime-*:1.8.0-alpha05 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-alpha05-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
-
SnapshotIdSetএInt.MAX_VALUEযোগ করার সময় স্ট্যাক ওভারফ্লো ঠিক করুন। ( b/370536104 , Ic4179f6 ) - Runtime micro-optimizations ( I50c60 )
- Allow R8 to remove debugging runtimeCheck calls ( I8c44 )
- Make
compoundKeyOfiterative instead of recursive ( I5817f )
External Contribution
- Implement stacks with collection lists ( I7d47c )
Version 1.8.0-alpha04
১৬ অক্টোবর, ২০২৪
androidx.compose.runtime:runtime-*:1.8.0-alpha04 is released. Version 1.8.0-alpha04 contains these commits .
Performance Improvements
- Provide snapshot id for state records in constructor ( 85c00f )
- Refactor
SnapshotState***to avoid class verification errors ( 6ee4a6 ) - Fix R8 rules to prevent throw inlining ( 5beb92 )
- Micro-optimize Operations ( d73c5c )
- Optimize
SynchronizedObjectallocations on JVM ( 2b043f )
Version 1.8.0-alpha03
২ অক্টোবর, ২০২৪
androidx.compose.runtime:runtime-*:1.8.0-alpha03 is released. Version 1.8.0-alpha03 contains these commits .
Performance Improvements
- Lazily create child context for
rememberCoroutineScope( f61464 )-
rememberCoroutineScopeis typically used to launch coroutines in response to events that happen post-composition. In some scenarios these events may never occur, leading to added costs of Job creation and cancellation without any benefit. - Make the scope returned by
rememberCoroutineScopecreate itscoroutineContextlazily when accessed, avoiding job creation and cancellation entirely if the scope is never used.
-
Version 1.8.0-alpha02
১৮ সেপ্টেম্বর, ২০২৪
androidx.compose.runtime:runtime-*:1.8.0-alpha02 is released. Version 1.8.0-alpha02 contains these commits .
নতুন বৈশিষ্ট্য
- Added
PausableCompositionwhich allows creating a subcomposition that can be paused during composition and and applied asynchronously to the composition. Compiler support is required for pausing which is currently in development. ( I3394b )
Version 1.8.0-alpha01
September 4, 2024
androidx.compose.runtime:runtime-*:1.8.0-alpha01 is released. Version 1.8.0-alpha01 contains these commits .
Version 1.7
Version 1.7.8
February 12, 2025
androidx.compose.runtime:runtime-*:1.7.8 is released. Version 1.7.8 contains these commits .
Version 1.7.7
২৯ জানুয়ারী, ২০২৫
androidx.compose.runtime:runtime-*:1.7.7 is released. No changes from 1.7.6.
androidx.compose.runtime:runtime-*:1.7.6 is released. Version 1.7.6 contains these commits .
Version 1.7.5
৩০ অক্টোবর, ২০২৪
androidx.compose.runtime:runtime-*:1.7.5 is released. Version 1.7.5 contains these commits .
Version 1.7.4
১৬ অক্টোবর, ২০২৪
androidx.compose.runtime:runtime-*:1.7.4 is released. Version 1.7.4 contains these commits .
Version 1.7.3
২ অক্টোবর, ২০২৪
androidx.compose.runtime:runtime-*:1.7.3 is released. Version 1.7.3 contains these commits .
Version 1.7.2
১৮ সেপ্টেম্বর, ২০২৪
androidx.compose.runtime:runtime-*:1.7.2 is released. Version 1.7.2 contains these commits .
Version 1.7.1
১০ সেপ্টেম্বর, ২০২৪
- No changes to Android artifacts.
-desktopartifacts were removed and-jvmStubsand-linuxx64Stubsartifacts were added. None of these targets are meant to be used, they are placeholders to help Jetbrains Compose efforts.
Version 1.7.0
September 4, 2024
androidx.compose.runtime:runtime-*:1.7.0 is released. Version 1.7.0 contains these commits .
Important changes since 1.6.0
- Added the ability to provide a composition local that is computed based on the values of other composition locals either by default, using
compositionLocalWithComputedDefault()or by supplying a lambda to use to compute the value by usingprovidesComputedinstead ofprovides. - The value of a composition local can be obtained by using the
currentValueproperty of the composition local accessible from within the lambda computing the value. This is used instead ofcurrentwhich is only accessible in@Composablefunctions. ( Iadbc0 ) - Newly created state objects are immediately accessible from other snapshots, including the global snapshot, with their initial state. Any subsequent modifications are not visible until the snapshot in which the object was created is applied.
- The initial state of
mutableStateOf(), as well as their primitive versions, is the value passed in as a parameter tomutableStateOf(). The initial state ofmutableStateListOf()andmutableStateMapOf()is empty. - Added
Snapshot.isInSnapshotandSnapshot.PreexistingSnapshotIdthat are used to enable a state object to support being immediately accessible from the global snapshot upon its creation. - Custom state objects can support being immediately accessible by following the pattern of changes made to the built-in snapshot objects. ( I84a17 )
- Enable
nonSkippingGroupOptimizationfor compose libraries. This causes the generated code for all non-restartable composable functions in androidx to be more efficient. In the future we plan to enable this by default. I( acbc08 ) - Invalidate composable lambdas in subcompositions on the same frame. ( 98301c )
- Call
onReleasecallback in the same order asonForgotten. ( 2cd790 ) - Enable strong skipping mode ( ed1766 )
- Make
currentCompoundHashKeyunique in more cases ( d4a872 )
Version 1.7.0-rc01
২১ আগস্ট, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-rc01 is released. Version 1.7.0-rc01 contains these commits .
Version 1.7.0-beta07
৭ আগস্ট, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-beta07 is released. Version 1.7.0-beta07 contains these commits .
Version 1.7.0-beta06
July 24, 2024
androidx.compose.runtime:runtime-*:1.7.0-beta06 is released. Version 1.7.0-beta06 contains these commits .
Version 1.7.0-beta05
১০ জুলাই, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-beta05 is released. Version 1.7.0-beta05 contains these commits .
Version 1.7.0-beta04
২৬ জুন, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-beta04 is released. Version 1.7.0-beta04 contains these commits .
Version 1.7.0-beta03
১২ জুন, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-beta03 is released. Version 1.7.0-beta03 contains these commits .
Version 1.7.0-beta02
May 29, 2024
androidx.compose.runtime:runtime-*:1.7.0-beta02 is released. Version 1.7.0-beta02 contains these commits .
Version 1.7.0-beta01
May 14, 2024
androidx.compose.runtime:runtime-*:1.7.0-beta01 is released. Version 1.7.0-beta01 contains these commits .
Version 1.7.0-alpha08
১ মে, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-alpha08 is released. Version 1.7.0-alpha08 contains these commits .
Version 1.7.0-alpha07
April 17, 2024
androidx.compose.runtime:runtime-*:1.7.0-alpha07 is released. Version 1.7.0-alpha07 contains these commits .
নতুন বৈশিষ্ট্য
- Added the ability to provide a composition local that is computed based on the values of other composition locals either by default, using
compositionLocalWithComputedDefault()or by supplying a lambda to use to compute the value by usingprovidesComputedinstead ofprovides. - The value of a composition local can be obtained by using the
currentValueproperty of the composition local accessible from within the lambda computing the value. This is used instead ofcurrentwhich is only accessible in@Composablefunctions. ( Iadbc0 )
API Changes
- Newly created state objects are immediately accessible from other snapshots, including the global snapshot, with their initial state. Any subsequent modifications are not visible until the snapshot in which the object was created is applied.
- The initial state of
mutableStateOf(), as well as their primitive versions, is the value passed in as a parameter tomutableStateOf(). The initial state ofmutableStateListOf()andmutableStateMapOf()is empty. - Added
Snapshot.isInSnapshotandSnapshot.PreexistingSnapshotIdthat are used to enable a state object to support being immediately accessible from the global snapshot upon its creation. - Custom state objects can support being immediately accessible by following the pattern of changes made to the built-in snapshot objects. ( I84a17 )
Bug Fixes
- Fixed merging of
readObserverin nested snapshots. This caused nested derived states to under-invalidate when used inside asnapshotFlow. ( Idf138 )
Version 1.7.0-alpha06
৩ এপ্রিল, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-alpha06 is released. Version 1.7.0-alpha06 contains these commits .
Bug Fixes
- Fix provide single values handling
providesDefault( 538f45 ) - Avoid a deadlock in the Recomposer accessing the frame clock ( 07e5c6 )
Version 1.7.0-alpha05
March 20, 2024
androidx.compose.runtime:runtime-*:1.7.0-alpha05 is released. Version 1.7.0-alpha05 contains these commits .
Bug Fixes
- Clear late changes on deactivated composition ( 5950bc )
Version 1.7.0-alpha04
March 6, 2024
androidx.compose.runtime:runtime-*:1.7.0-alpha04 is released. Version 1.7.0-alpha04 contains these commits .
Performance Improvements
- Call
Snapshot.currentonce per derived state evaluation ( ee7daf ) - Read
currentRecordonce per observation in composition ( b882b2 ) - Remove accidental iterator allocation in
snapshotFlow( 231e56 ) - Enable
nonSkippingGroupOptimizationfor compose libraries. This causes the generated code for all non-restartable composable functions in androidx to be more efficient. In the future we plan to enable this by default. I( acbc08 )
Version 1.7.0-alpha03
২১ ফেব্রুয়ারী, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-alpha03 is released. Version 1.7.0-alpha03 contains these commits.
API Changes
- Introduce a replace groups to improve detecting changes ( 0941b5 )
Performance Improvements
- Improve memory allocation when detecting changes ( 53e7fd )
- Fix a memory leak in the composer ( 0e097d )
- Use
ScopeMapto pass invalidations when recomposing ( e19a7e ) - Optimize invalidations map to only keep derived states ( f11c44 )
- Replace
IdentityArraySetusages withScatterSet( db572e ) - Optimize
removeScopeinScopeMap( bb0530 )
Version 1.7.0-alpha02
৭ ফেব্রুয়ারী, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-alpha02 is released. Version 1.7.0-alpha02 contains these commits.
Bug Fixes
- Invalidate composable lambdas in subcompositions on the same frame. ( 98301c )
- Call
onReleasecallback in the same order asonForgotten. ( 2cd790 ) - Filter changed states that are not observed in
snapshotFlow. ( 796b80 )
Performance Improvements
- Modify snapshot observer in place when it is already transparent. ( f60f30 )
- Optimize
SnapshotIdSet.lowest(). ( 7ae149 ) - Use an allocation-free
fold()inSnapshotIdSet. ( 532b7d ) - Remove iterator allocation ( 83f96b )
Version 1.7.0-alpha01
২৪ জানুয়ারী, ২০২৪
androidx.compose.runtime:runtime-*:1.7.0-alpha01 is released. Version 1.7.0-alpha01 contains these commits.
Performance Optimizations
- Add the ability to create slots after a child group has been added ( b5960c )
- Optimize recording modifications of snapshot states ( 28c3fe )
- Enable strong skipping mode ( ed1766 )
Bug Fixes
- Account for default parameter meta in intrinsic remember ( 096665 )
- Make
currentCompoundHashKeyunique in more cases ( d4a872 ) - Realize groups when exiting inline function call ( 2a90fc )
Version 1.6
Version 1.6.8
১২ জুন, ২০২৪
androidx.compose.runtime:runtime-*:1.6.8 is released. Version 1.6.8 contains these commits .
Version 1.6.7
১ মে, ২০২৪
androidx.compose.runtime:runtime-*:1.6.7 is released. Version 1.6.7 contains these commits .
Version 1.6.6
April 17, 2024
androidx.compose.runtime:runtime-*:1.6.6 is released. No changes since the last release.
Version 1.6.5
৩ এপ্রিল, ২০২৪
androidx.compose.runtime:runtime-*:1.6.5 is released. Version 1.6.5 contains these commits .
Version 1.6.4
March 20, 2024
androidx.compose.runtime:runtime-*:1.6.4 is released. Version 1.6.4 contains these commits .
Version 1.6.3
March 6, 2024
androidx.compose.runtime:runtime-*:1.6.3 is released. Version 1.6.3 contains these commits .
Version 1.6.2
২১ ফেব্রুয়ারী, ২০২৪
androidx.compose.runtime:runtime-*:1.6.2 is released. Version 1.6.2 contains these commits.
Version 1.6.1
৭ ফেব্রুয়ারী, ২০২৪
androidx.compose.runtime:runtime-*:1.6.1 is released. Version 1.6.1 contains these commits.
Bug Fixes
- Call
onReleasecallback in the same order asonForgotten. ( 2cd790 ) - Filter changed states that are not observed in
snapshotFlow. ( 796b80 )
Version 1.6.0
২৪ জানুয়ারী, ২০২৪
androidx.compose.runtime:runtime-*:1.6.0 is released. Version 1.6.0 contains these commits.
Important changes since 1.5.0
নতুন বৈশিষ্ট্য
- Re-throw exceptions that are swallowed during recomposition loop ( 4dff9a )
Performance Optimizations
- Optimize recording modifications of snapshot states ( 28c3fe )
- Optimize
rememberSaveable( f01d79 ) - Defer re-reading derived states until changes are recorded ( f38099 )
- Improve providing composition local values ( a337ea )
Bug Fixes
- Fix slot table memory leak ( 73fcfe )
- Skip recomposition of subcompositions that will be removed. ( Ieeb99 , b/254645321 )
- Only trigger
RememberObserverlifecycles when it is stored in remember calculation. ( f6b4dc ) - Restrict
$dirtycapture to inline lambdas. ( acfca0 ) - Fix moveable content sometimes receiving the wrong composition locals. ( 035cd6 )
Version 1.6.0-rc01
January 10, 2024
androidx.compose.runtime:runtime-*:1.6.0-rc01 is released. Version 1.6.0-rc01 contains these commits.
Version 1.6.0-beta03
১৩ ডিসেম্বর, ২০২৩
androidx.compose.runtime:runtime-*:1.6.0-beta03 is released. Version 1.6.0-beta03 contains these commits.
Version 1.6.0-beta02
November 29, 2023
androidx.compose.runtime:runtime-*:1.6.0-beta02 is released. Version 1.6.0-beta02 contains these commits.
Version 1.6.0-beta01
১৫ নভেম্বর, ২০২৩
androidx.compose.runtime:runtime-*:1.6.0-beta01 is released. Version 1.6.0-beta01 contains these commits.
API Changes
- Propagate Certain stability values in annotation. (274a4c)
Bug Fixes
- Use referential policy for composition local scope state in context. (83361c)
- Restrict $dirty capture to inline lambdas. (acfca0)
- Fix moveable content sometimes receiving the wrong composition locals. (035cd6)
- Use faster non-allocating hashmaps in
RecomposeScopeImpl. (d79494) - Use
ObjectIntMapinDerivedState. (21862e) - Use
IntReffor intSnapshotThreadLocalinDerivedState. (04eaf4)
Version 1.6.0-alpha08
October 18, 2023
androidx.compose.runtime:runtime-*:1.6.0-alpha08 is released. Version 1.6.0-alpha08 contains these commits.
Bug Fixes
- Only trigger
RememberObserverlifecycles when it is stored in remember calculation. ( f6b4dc ) - Improve allocations in invalidations list sorting. ( 954d63 )
- Use new non-allocating maps in
SnapshotStateObserver. ( 4303ce ) - Clear invalidations when composition is deactivated. ( e001be )
Version 1.6.0-alpha07
October 4, 2023
androidx.compose.runtime:runtime-*:1.6.0-alpha07 is released. Version 1.6.0-alpha07 contains these commits.
API Changes
-
SnapshotStateListis now marked asRandomAccessto enable the direct indexing version of list helpers to be used. ( I5210c , b/219554654 )
Version 1.6.0-alpha06
২০ সেপ্টেম্বর, ২০২৩
androidx.compose.runtime:runtime-*:1.6.0-alpha06 is released. Version 1.6.0-alpha06 contains these commits.
Version 1.6.0-alpha05
৬ সেপ্টেম্বর, ২০২৩
androidx.compose.runtime:runtime-*:1.6.0-alpha05 is released. Version 1.6.0-alpha05 contains these commits.
Version 1.6.0-alpha04
২৩ আগস্ট, ২০২৩
androidx.compose.runtime:runtime-*:1.6.0-alpha04 is released. Version 1.6.0-alpha04 contains these commits.
নতুন বৈশিষ্ট্য
- Re-throw exceptions that are swallowed during recomposition loop ( 4dff9a )
API Changes
- Added a method to deactivate
ReusableComposition, removing observations but keeping nodes in place. The deactivated composition can be activated again by callingsetContent. ( Ib7f31 ) - Add
ReusableCompositioninterface for managing lifecycle and reuse of subcompositions. ( I812d1 , b/252846775 )
Version 1.6.0-alpha03
৯ আগস্ট, ২০২৩
androidx.compose.runtime:runtime-*:1.6.0-alpha03 is released. Version 1.6.0-alpha03 contains these commits.
Bug Fixes
- Fix new
CompositionLocalProvideroptimization ( 3118e88 ) - Correct how movable content nodes are disassembled. ( 5e3d59b )
Version 1.6.0-alpha02
July 26, 2023
androidx.compose.runtime:runtime-*:1.6.0-alpha02 is released. Version 1.6.0-alpha02 contains these commits.
New Features & Performance Enhancements
- Optimize
rememberSaveable( f01d79 ) - Defer re-reading derived states until changes are recorded ( f38099 )
- Improve providing composition local values ( a337ea )
-
SideEffectis marked as@ExplicitGroupsComposableto avoid generating a group. ( I74815 ) - Avoid comparing composition local maps on reuse ( 782071 )
API Changes
- Added a special case overload for
CompositionLocalProvidersthat avoids overhead used to make providing multiple values faster but is overhead when providing a single value. ( I6d640 , b/288169379 )
Bug Fixes
- Fix slot table memory leak ( 73fcfe )
- Fix how we restore
rememberSaveablewhenstateSaverreturns null ( 90748c )
Version 1.6.0-alpha01
২১ জুন, ২০২৩
androidx.compose.runtime:runtime-*:1.6.0-alpha01 is released. Version 1.6.0-alpha01 contains these commits.
Bug Fixes
- Skip recomposition of subcompositions that will be removed. ( Ieeb99 , b/254645321 )
- Reduced allocations when applying snapshots. ( I65c09 )
- Avoid calculating
readableHashinDerivedStateif snapshot wasn't modified ( 68c565 )
Version 1.5
Version 1.5.4
October 18, 2023
androidx.compose.runtime:runtime-*:1.5.4 is released. Version 1.5.4 contains these commits.
Version 1.5.3
October 4, 2023
androidx.compose.runtime:runtime-*:1.5.3 is released. Version 1.5.3 contains these commits.
Version 1.5.2
September 27, 2023
androidx.compose.runtime:runtime-*:1.5.2 is released. Version 1.5.2 contains these commits.
Version 1.5.1
৬ সেপ্টেম্বর, ২০২৩
androidx.compose.runtime:runtime-*:1.5.1 is released. Version 1.5.1 contains these commits.
Version 1.5.0
৯ আগস্ট, ২০২৩
androidx.compose.runtime:runtime-*:1.5.0 is released. Version 1.5.0 contains these commits.
API Changes
- Removed allocations in recomposition, color animations, and
AndroidComposeView. ( Ib2bfa ) - Added a
@StateFactoryMarkerannotation, to mark functions that create states and must be wrapped in aremembercall. ( I64550 ) - Add primitive versions of State and
MutableState( fb3d89 ) - Added
Snapshot.isApplyObserverNotificationPending( I672a5 ) - Added primitive versions of the
StateAPI, allowing Int, Long, Float, and Double values to be tracked inStateobjects without incurring penalties for autoboxing. Use the new factory methodsmutableIntState(Int),mutableFloatStateOf(Float), etc in order to use these. ( I48e43 )
Bug Fixes
- Skip recomposition of subcompositions that will be removed. ( Ieeb99 , b/254645321 )
- Don't retain snapshot reference in
ComposerImpl( 0206f7 ) - Don't apply composition twice ( f5791b )
- Ensure invalidation for non-initialized derived state values ( aa2a92 )
- Call
onEndChangesduring composition dispose. ( 62cc8c ) - Fix moving content into a sub-composition ( 4beb41 )
- Fix potential deadlocks ( c1a425 and 8edce0 )
- The recomposer created for an Android window will now only block calls to
withFrameNanosinstead of all composition when it receives an ON_STOP notification. This means windows associated with stopped activites will continue to recompose for data changes but the animations, or any other caller ofwithFrameNanos, will block. ( Id9e7f , b/240975572 ) - Execute deactivation callbacks for
LayoutNodebefore disposing effects 3784073 - Fix changed flags for restarted lambdas ea81df9
- Fix live edit regression for Composable with nodes 73fd4d8
- ON_STOP should pause the frame clock broadcasts instead of composition ae276f1
- Invalidate
SnapshotStateObserverscopes for unchanged derived states 84d9b1c - Fix potential dead-lock when disposing compositions 28761fc
- Fix moving content into a sub-composition 92d4156
- Fix changed flags for restarted lambdas ( 8a03e9 )
- Execute deactivation callbacks for
LayoutNodebefore disposing effects ( 8b0fa4 ) - Fix
endToMarker()when ending node groups. ( d71d980 ) - Use current
SlotWritergroup for check on deactivation ( a0b518b ) - Remove the
fillinSlotTable.moveSlotGapTo()and move it to close ( 81f9935 ) - Fix missing invalidations while movable content is moving ( 1d7c024 )
- Fix immediate invalidations for moved movable content ( 8676618 )
Performance Improvements
- Avoid calculating
readableHashinDerivedStateif snapshot wasn't modified. ( 307102 ) - Reduced allocations ( I65c09 , d7ea77 , 727974 , and 445808 )
- Quick cancellation of compose
CoroutineScopes( a55362 and bd382f ) - Overwrite records of state objects with inaccessible state records ( c986960 )
- Use composer of the correct scope when realizing groups ( 9a5e5b6 )
- Use
IdentityArraySetto store snapshot invalidations ( 7f60cca ) - Reduce allocations for snapshot observations ( 5bc535f )
Version 1.5.0-rc01
July 26, 2023
androidx.compose.runtime:runtime-*:1.5.0-rc01 is released. Version 1.5.0-rc01 contains these commits.
Bug Fixes
Defer re-reading derived states until changes are recorded ( f38099 )
An optional inspection to recommend migrating
mutableStateOf()calls to their corresponding specialized types for primitives is available. Its lint ID isAutoboxingStateCreation. Previously, this inspection was enabled by default for all projects. To see this warning in Android Studio's editor and your project's lint outputs, change its severity from informational to warning (or higher) by declaringwarning "AutoboxingStateCreation"inside your module's build.gradle or build.gradle.kts configuration as shown ( I34f7e ):android { lint { warning "AutoboxingStateCreation" } ... }
Version 1.5.0-beta03
২৮ জুন, ২০২৩
androidx.compose.runtime:runtime-*:1.5.0-beta03 is released. Version 1.5.0-beta03 contains these commits.
Bug Fixes
- Skip recomposition of subcompositions that will be removed. ( Ieeb99 , b/254645321 )
Version 1.5.0-beta02
৭ জুন, ২০২৩
androidx.compose.runtime:runtime-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.
Performance Improvements
- Avoid calculating
readableHashinDerivedStateif snapshot wasn't modified. ( 307102 )
Version 1.5.0-beta01
২৪ মে, ২০২৩
androidx.compose.runtime:runtime-*:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.
API Changes
- Removed allocations in recomposition, color animations, and
AndroidComposeView( Ib2bfa ) - Added a
@StateFactoryMarkerannotation, to mark functions that create states and must be wrapped in aremembercall. ( I64550 ) - Add primitive versions of State and
MutableState( fb3d89 ) - Added
Snapshot.isApplyObserverNotificationPending( I672a5 )
Bug Fixes
- Reduced allocations ( I65c09 , d7ea77 , 727974 , and 445808 )
- Don't retain snapshot reference in
ComposerImpl( 0206f7 ) - Quick cancellation of compose
CoroutineScopes( a55362 and bd382f ) - Don't apply composition twice ( f5791b )
- Ensure invalidation for non-initialized derived state values ( aa2a92 )
- Call
onEndChangesduring composition dispose. ( 62cc8c ) - Fix moving content into a sub-composition ( 4beb41 )
- Fix potential deadlocks ( c1a425
- ON_STOP should pause the frame clock broadcasts instead of composition ( f4a2d1 )
- Fix changed flags for restarted lambdas ( 8a03e9 )
- Execute deactivation callbacks for
LayoutNodebefore disposing effects ( 8b0fa4 )
External Contribution
- Added
Snapshot.isApplyObserverNotificationPending( I672a5 )
Version 1.5.0-alpha04
May 10, 2023
androidx.compose.runtime:runtime-*:1.5.0-alpha04 is released. Version 1.5.0-alpha04 contains these commits.
API Changes
- Added primitive versions of the
StateAPI, allowing Int, Long, Float, and Double values to be tracked inStateobjects without incurring penalties for autoboxing. Use the new factory methodsmutableIntState(Int),mutableFloatStateOf(Float), etc in order to use these. ( I48e43 )
Bug Fixes
Call
onEndChangesduring composition dispose. Focus nodes removed duringComposition.disposeare subscribing toonEndChangesto reset focus.( 03d4a47 )Ensure invalidation for non-initialized derived state values. Each derived state is associated with a list of its dependencies in
SnapshotStateObserver, used to invalidate scopes associated with derived state whenever dependency changes. The dependency change is registered on snapshot advance, which can happen after derived state read (due to the call toSnapshot.notifyObjectsInitialized()).Previous derived state observation logic in
SnapshotStateObserverwas cleaning up old dependencies, then reading new value. This resulted in a race condition with invalidation happening in a cleaned up state, where dependency invalidation wasn't registered.This change reorders derived state read and dependency cleanup, ensuring that invalidation always happens in a valid state. ( c472be6 )
Version 1.5.0-alpha03
১৯ এপ্রিল, ২০২৩
androidx.compose.runtime:runtime-*:1.5.0-alpha03 is released. Version 1.5.0-alpha03 contains these commits.
API Changes
- The recomposer created for an Android window will now only block calls to
withFrameNanosinstead of all composition when it receives an ON_STOP notification. This means windows associated with stopped activites will continue to recompose for data changes but the animations, or any other caller ofwithFrameNanos, will block. ( Id9e7f , b/240975572 )
Bug Fixes
- Fix potential deadlock in snapshot list and map 5c1a425
- Execute deactivation callbacks for
LayoutNodebefore disposing effects 3784073 - Fix changed flags for restarted lambdas ea81df9
- Fix live edit regression for Composable with nodes 73fd4d8
- ON_STOP should pause the frame clock broadcasts instead of composition ae276f1
- Invalidate
SnapshotStateObserverscopes for unchanged derived states 84d9b1c - Fix potential dead-lock when disposing compositions 28761fc
- Fix moving content into a sub-composition 92d4156
Version 1.5.0-alpha02
৫ এপ্রিল, ২০২৩
androidx.compose.runtime:runtime-*:1.5.0-alpha02 is released. Version 1.5.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
- Kotlin's
getValueoperator can now be composable ( f174f6e )
Bug Fixes, Performance Improvements
- Overwrite records of state objects with inaccessible state records ( c986960 )
- Use composer of the correct scope when realizing groups ( 9a5e5b6 )
- Fix
endToMarker()when ending node groups. ( d71d980 ) - Use current
SlotWritergroup for check on deactivation ( a0b518b ) - Use
IdentityArraySetto store snapshot invalidations ( 7f60cca ) - Remove the
fillinSlotTable.moveSlotGapTo()and move it to close ( 81f9935 ) - Fix missing invalidations while movable content is moving ( 1d7c024 )
- Fix immediate invalidations for moved movable content ( 8676618 )
- Reduce allocations for snapshot observations ( 5bc535f )
Version 1.5.0-alpha01
২২ মার্চ, ২০২৩
androidx.compose.runtime:runtime-*:1.5.0-alpha01 is released. Version 1.5.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
- Adds
Modifier.Node#coroutineScopeto allowModifier.Nodesto launch coroutines ( I76ef9 ) - Allow
Modifier.Nodesto readCompositionLocalsby implementing theCompositionLocalConsumerModifierNodeinterface. ( Ib44df )
Version 1.4
Version 1.4.3
৩ মে, ২০২৩
androidx.compose.runtime:runtime-*:1.4.3 is released with no changes.
Version 1.4.2
১৯ এপ্রিল, ২০২৩
androidx.compose.runtime:runtime-*:1.4.2 is released. Version 1.4.2 contains these commits.
Bug Fixes
Fix potential deadlock in snapshot list and map 2eb6570
Adding content to a
SnapshotStateListorSnapshotStateMapcan encounter a deadlock if the modification is concurrent with a direct write to the state record. This was made significantly more likely to be encountered with the changes introduced by 93fcae828b that uses direct writes to release unused records.The locks are now ordered in that a snapshot lock is never attempted to be taken when a map or list lock is held.
Version 1.4.1
৫ এপ্রিল, ২০২৩
androidx.compose.runtime:runtime-*:1.4.1 is released. Version 1.4.1 contains these commits.
Bug Fixes
- Fix
endToMarker()when ending node groups. d71d980
Version 1.4.0
২২ মার্চ, ২০২৩
androidx.compose.runtime:runtime-*:1.4.0 is released. Version 1.4.0 contains these commits.
Important changes since 1.3.0
- Use initialized value from
LiveDatafor first composition 3680e25 - Add
ComposeNodeLifecycleCallbackto observe lifecycle of compose nodes. 8b6a258 - Add
parameterTypesproperty toComposableMethod7b6c7ad
Bug Fixes & Performance Improvements
- Clear both scope indexes in
SnapshotStateObserver29f4a3e - Add groups needed in the body of unskippable lambdas 7d06752
- Improve memory reference characteristics of Snapshot state 93fcae8
- Remove boxing in composition local lookups 0875717
- Use correct key for non-reusable nodes groups 6388d8d
- Protect
SnapshotStateObserverfrom recursive and concurrent applies 98cb6ba - Added a check-index-bounds check in the
IdentityArraySet"get" method 35a77d3 - Update compose module to use
ViewTreeLifecycleOwnerextensions 21c2122 - Send apply notifications after Recomposer finishes frame. 98f2641
- Fix index out of bounds crash when cancelling the Recomposer 8f8656f
- Always force recompose if parent providers of Composition have changed 9526fcc
- Recomposer tolerance for cancelled Jobs a55f7ed
- Improve handling invalidations for large number of composers 9b7ed67
- Fix generating closing groups for non-local returns b6f590c
Version 1.4.0-rc01
৮ মার্চ, ২০২৩
androidx.compose.runtime:runtime-*:1.4.0-rc01 is released. Version 1.4.0-rc01 contains these commits.
Bug Fixes
Version 1.4.0-beta02
২২ ফেব্রুয়ারী, ২০২৩
androidx.compose.runtime:runtime:1.4.0-beta02 and androidx.compose.runtime:runtime-saveable:1.4.0-beta02 are released. Version 1.4.0-beta02 contains these commits.
Version 1.4.0-beta01
৮ ফেব্রুয়ারী, ২০২৩
androidx.compose.runtime:runtime-*:1.4.0-beta01 is released. Version 1.4.0-beta01 contains these commits.
API Changes
-
ComposeNodeLifecycleCallbackwas added which allows to observe lifecycle of Compose nodes ( I3731b ) - Added
@TestOnlytoComposer.disableSourceInformation()as this function is only safe to call in a test. ( I896c8 )
Bug Fixes
- Remove boxing in composition local lookups ( 62f66a )
- Improve memory reference characteristics of Snapshot state ( dfb451 )
Version 1.4.0-alpha05
২৫ জানুয়ারী, ২০২৩
androidx.compose.runtime:runtime:1.4.0-alpha05 and androidx.compose.runtime:runtime-saveable:1.4.0-alpha05 are released. Version 1.4.0-alpha05 contains these commits.
API Changes
- More type/nullability of inline/deprecated-hidden functions ( I24f91 )
Version 1.4.0-alpha04
১১ জানুয়ারী, ২০২৩
androidx.compose.runtime:runtime-*:1.4.0-alpha04 is released. Version 1.4.0-alpha04 contains these commits.
API Changes
-
TestMonotonicFrameClocknow uses correct experimental annotation. ( I95c9e )
Bug Fixes
- Protect
SnapshotStateObserverfrom recursive and concurrent applies ( d902fb )
Version 1.4.0-alpha03
৭ ডিসেম্বর, ২০২২
androidx.compose.runtime:runtime-*:1.4.0-alpha03 is released. Version 1.4.0-alpha03 contains these commits.
API Changes
- adding a new public method to
ComposableMethodclass analogous tojava.lang.reflect.Method#getParameterTypes()( Iab0c3 )
Bug Fixes
- Snapshot apply notifications are now sent after the
Recomposerfinishes applying changes. ( Iad6c0 , b/222093277 )
Version 1.4.0-alpha02
৯ নভেম্বর, ২০২২
androidx.compose.runtime:runtime-*:1.4.0-alpha02 is released. Version 1.4.0-alpha02 contains these commits.
Version 1.4.0-alpha01
২৪ অক্টোবর, ২০২২
androidx.compose.runtime:runtime-*:1.4.0-alpha01 is released. Version 1.4.0-alpha01 contains these commits.
API Changes
-
SnapshotStateListandSnapshotStateMapnow have explicit implementaions oftoList()andtoMap(), respectfully. These methods return their current content without peforming a copy as they return the internal immutable data used to store their content. This value can be used, for example, to produce a flow of values usingsnapshotFlowwithout requiring copying of the data. ( Ica2bd )
Version 1.3
Version 1.3.3
১১ জানুয়ারী, ২০২৩
androidx.compose.runtime:runtime-*:1.3.3 is released. Version 1.3.3 contains these commits.
- No changes since 1.3.2
Version 1.3.2
৭ ডিসেম্বর, ২০২২
androidx.compose.runtime:runtime-*:1.3.2 is released. Version 1.3.2 contains these commits.
Bug Fixes
- Updated to support androidx.compose.ui 1.3.2
Version 1.3.1
৯ নভেম্বর, ২০২২
androidx.compose.runtime:runtime-*:1.3.1 is released. Version 1.3.1 contains these commits.
Version 1.3.0
২৪ অক্টোবর, ২০২২
androidx.compose.runtime:runtime-*:1.3.0 is released. Version 1.3.0 contains these commits.
Important changes since 1.2.0
Exception Handling / Live Edit Support
- In order to better support live edit, APIs were added to enable handling of exceptions during composition
- Composition error handling for hot reload
- Handle live edit errors on save/restore
Composition Tracing
- Runtime tracing APIs were added in order to support new composition tracing tooling
- Generate composable trace event start/end calls
- Re-added ComposerKt.traceEventStart(Int, String)
Composable Reflection APIs
- A new
ComposableMethodAPI was added to allow for more reliable reflection-based invocations of composable APIs. - Move invokeComposable to compose runtime
- Rework API to invoke composable method
Runtime Fixes
- Fix faulty range test for slot table checking for markers
- Allow movable content to move into and out of SubcomposeLayout
- Fix moving content to new content of a subcomposition
Snapshot System
- The snapshot system got various improvements around memory management, performance, and correctness.
- Optimize scope removal in SnapshotStateObserver
- Dispose nested snapshots created from transparent snapshots
- Fixed race condition when reading state from the global snapshot
- Support DerivedState in SnapshotStateObserver
- Prevent removing derived state from composition when it is read in other scopes
- Use IdentityArrayMap instead of HashMap inside DerivedState
- Update derived state observers to use mutable vector
- Update SnapshotStateObserver state cleanup
- Replace SnapshotStateObserver.invalidated with ArraySet
- Fixed race condition when reading state from the global snapshot
- Fix use of stale record in DerivedState hash calculation
- Fix race condition when advancing the global snapshot
- Speed up scope observations cleanup in SnapshotStateObserver
Version 1.3.0-rc01
October 5, 2022
androidx.compose.runtime:runtime-*:1.3.0-rc01 is released. Version 1.3.0-rc01 contains these commits.
Bug Fixes
- Fixed
ArrayIndexOutOfBoundsExceptioncoming from the slot table ( b/249076084 )
Version 1.3.0-beta03
September 21, 2022
androidx.compose.runtime:runtime-*:1.3.0-beta03 is released. Version 1.3.0-beta03 contains these commits.
Behavior Breaking Change
- The parameter to
rememberandrememberCoroutineScopewhere changed to becrossinline. This will report an error for early returns instead of allowing an early return which will cause a later internal error to be reported. - This change can potentially lead to new compiler errors to be reported requiring non-local returns to be removed from the lambdas passed to these functions. ( Ibea62 )
Version 1.3.0-beta02
৭ সেপ্টেম্বর, ২০২২
androidx.compose.runtime:runtime-*:1.3.0-beta02 is released. Version 1.3.0-beta02 contains these commits.
Bug Fixes
- Updated API ( I64ca0 )
Version 1.3.0-beta01
২৪ আগস্ট, ২০২২
androidx.compose.runtime:runtime-*:1.3.0-beta01 is released. Version 1.3.0-beta01 contains these commits.
API Changes
- A
findmethod was added toCompositionDatato allow developer tools using this API to quickly find a sub-group of composition using its identity. ( I5794f )
Version 1.3.0-alpha03
১০ আগস্ট, ২০২২
androidx.compose.runtime:runtime-*:1.3.0-alpha03 is released. Version 1.3.0-alpha03 contains these commits.
Version 1.3.0-alpha02
২৭ জুলাই, ২০২২
androidx.compose.runtime:runtime-*:1.3.0-alpha02 is released. Version 1.3.0-alpha02 contains these commits.
API Changes
- Re-added
ComposerKt.traceEventStart(Int, String)for backwards compatibility ( I6e6de )
Version 1.3.0-alpha01
২৯ জুন, ২০২২
androidx.compose.runtime:runtime-*:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
API Changes
- Moving utility functionality to runtime ( I4f729 )
Version 1.2
Version 1.2.1
১০ আগস্ট, ২০২২
androidx.compose.runtime:runtime-*:1.2.1 is released. Version 1.2.1 contains these commits.
Bug Fixes
- Fixed memory leak: dispose of nested snapshots created from transparent snapshots b/239603305
সংস্করণ 1.2.0
২৭ জুলাই, ২০২২
androidx.compose.runtime:runtime-*:1.2.0 is released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
Compose Runtime had a handful of features introduced in 1.2.0, along with many stabilizing bug fixes. The most significant new feature was the introduction of the
movableContentOfAPI , which can be used to enable complex UX such as shared element transitions. ThemovableContentOfAPI converts a composable lambda into a lambda that moves it state, and corresponding nodes, to any new location it is called. When the previous call leaves the composition the state is temporarily preserved and if a new call to the lambda enters the composition then the state, and associated Nodes, are moved to the location of the new call. If no new call is added the state is removed permanently and remember observers are notified.If a
movableContentOflambda is called multiple times in the same composition, new state and nodes are created for each call and, as calls leave the composition and new calls enter, the state is moved from the first leaving calls to the entering calls in the order they are called. All state not claimed by new calls is removed permanently.In addition to this and a few other new features, much time was spent stabilizing the runtime and Snapshot state system. Various memory leaks were removed and code paths optimized.
A summarized list of the changes can be found below:
New Features in 1.2
- Add experimental snapshot unsafeEnter/Leave
- Add Snapshot.asContextElement experimental API
- Introduce Snapshot.withoutReadObservation
- Allow state to move within a composition
- Tracing of Recompositions in Compose
Performance in 1.2
- Improve composition local performance
- Baseline profiles for compose should be derived using benchmarks
Bug Fixes in 1.2
- Remove tracking information from release recompose scopes
- Prevent removing derived state from composition when it is read in other scopes
- Use more efficient removeScope() in SnapshotStateObserver
- Clean up derived state dependencies in composition
- Fix currentCompositeKeyHash changing after inner recomposition inside movable content
- Clean up invalidated compositions during disposal
- Fix derive state read during recomposition
- Fix memory leak when observing derived state objects
- Fixed movableContent composite hash key to be consistent
- Fix corner a case where the composer would crash
- Ensure forced invalidation of a group forces recomposition
- Fix bug when rememberSaveable with input is restored in the wrong order
Version 1.2.0-rc03
২৯ জুন, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-rc03 is released. Version 1.2.0-rc03 contains these commits.
Bug Fixes
- Derived state observations were previously unconditionally removed from the recompose scope and composition together, which broke other scopes which might be still observing derived state. This change only removes derived state instances if it is no longer observed by other scopes. ( b/236618362 )
Version 1.2.0-rc02
২২ জুন, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-rc02 is released. Version 1.2.0-rc02 contains these commits.
Version 1.2.0-rc01
১৫ জুন, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-rc01 is released. Version 1.2.0-rc01 contains these commits.
API Changes
- Interfaces in compose libraries are now built using jdk8 default interface methods ( I5bcf1 )
Version 1.2.0-beta03
১ জুন, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-beta03 is released. Version 1.2.0-beta03 contains these commits.
Version 1.2.0-beta02
May 18, 2022
androidx.compose.runtime:runtime-*:1.2.0-beta02 is released. Version 1.2.0-beta02 contains these commits.
Version 1.2.0-beta01
May 11, 2022
androidx.compose.runtime:runtime-*:1.2.0-beta01 is released. Version 1.2.0-beta01 contains these commits.
নতুন বৈশিষ্ট্য
- This is the first beta release of 1.2!
API Changes
- Added experimental
Snapshot.unsafeEnter/unsafeLeave( I108f3 ) - Added experimental
Snapshot.asContextElement()API ( Iff072 ) - The
@ComposableTargetannotation and annotations marked by@ComposableTargetMarkercan now be used at the file scope using the@fileprefix. Using a target annotation at the file scope will cause the compiler to assume all composable functions in the file are intended to be target the associated applier. For example, using@file:UiComposabledeclares that all@Composablefunctions target the Compose UI applier. A function that needs to target another applier must explicitly supply the target marker annotation for the desired applier. ( I40804 )
Version 1.2.0-alpha08
২০ এপ্রিল, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-alpha08 is released. Version 1.2.0-alpha08 contains these commits.
API Changes
- Added
TracingInProgressto theCompositionTracerinterface. ( Ic6f12 ) - Add
recomposeScopeIdentityto Composer ( I0c873 ) - Restricted tracing APIs (Composer.setTracer) to
OptIn(InternalComposeTracingApi). ( I9187f ) - Added
ResuableContentHostwhich allows better control over the lifetime of state created for reusable content. For example, if a sub-composition is temporarily not in use then the content can be deactivated causing all the remembered state in the composition to be forgotten triggering, for example, all disposable effects. ( I2c0f2 , b/220322704 )
Version 1.2.0-alpha07
৬ এপ্রিল, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-alpha07 is released. Version 1.2.0-alpha07 contains these commits.
API Changes
- New function
Snapshot.withoutReadObservation { ... }was added. It allows users to run the passed lambda without subscribing to the changes of the state values read during this block. You could find it useful in use cases when you want to benefit from the snapshot based thread safe write/reads, but want to be able to read the value without causing unnecessary recomposition or remeasure. ( I9f365 , b/214054486 )
Version 1.2.0-alpha06
March 23, 2022
androidx.compose.runtime:runtime-*:1.2.0-alpha06 is released. Version 1.2.0-alpha06 contains these commits.
Version 1.2.0-alpha05
March 9, 2022
androidx.compose.runtime:runtime-*:1.2.0-alpha05 is released. Version 1.2.0-alpha05 contains these commits.
External Contribution
- Updated to use Kotlinx coroutines 1.6.0 ( I3366d )
Version 1.2.0-alpha04
২৩ ফেব্রুয়ারী, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-alpha04 is released. Version 1.2.0-alpha04 contains these commits.
API Changes
Added
ComposableTarget,ComposableTargetMarkerandComposableOpenTargetthat allows compile time reporting of when a composable function is called targeting an applier it was not designed to use.In most cases the annotations can be inferred by the compose compiler plugin so using these annotation directly should be rare . The cases that cannot be inferred include creating and using a custom applier, abstract composable functions (such as interface methods), fields or global variables that are composable lambdas (local variables and parameters are inferred), or when using
ComposeNodeor a related composable functions.For custom appliers the composable functions that calls
ComposeNodeorReusableComposeNodeneed to add aCompoableTargetannotation for the function and any composable lambda parameter types. It is recommended, however, to create an annotation that is annotated withComposableTargetMarkerand then the marked annotation be used instead ofComposableTargetdirectly. A composable annotation marked withComposableTargetMarkeris equivalent to aComposbleTargetwith the fully qualified name of the attribute class as the applier parameter. For an example of usingComposableTargetMarkerseeanroidx.compose.ui.UiComposable. ( I38f11 )
Version 1.2.0-alpha03
৯ ফেব্রুয়ারী, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-alpha03 is released. Version 1.2.0-alpha03 contains these commits.
API Changes
Added
movableContentOfwhich converts a composable lambda into a lambda that moves it state, and corresponding nodes, to any new location it is called. When the previous call leaves the composition the state is temporarily preserved and if a new call to the lambda enters the composition then the state, and associated nodes, are moved to the location of the new call. If no new call is added the state is removed permanently and remember observers are notified.If a
movableContentOflambda is called multiple times in the same composition, new state and nodes are created for each call and, as calls leave the composition and new calls enter, the state is moved from the first leaving calls to the entering calls in the order they are called. All state not claimed by new calls is removed permanently. ( Ib4850 )Added a tracing API to composition to enable tools to provide more detailed tracing of composable functions. The compiler now generates calls to the tracing API which include source information. ( Ib0eb5 )
To remove these calls and the associated source information from a release build, add the following Proguard rule:
-assumenosideeffects public class androidx.compose.runtime.ComposerKt { boolean isTraceInProgress(); void traceEventStart(int,java.lang.String); void traceEventEnd(); }Add
InternalComposeScopewhich gives tools the ability to identify a composable during recompositions. ( I07a3f )
Version 1.2.0-alpha02
২৬ জানুয়ারী, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-alpha02 is released. Version 1.2.0-alpha02 contains these commits.
Version 1.2.0-alpha01
১২ জানুয়ারী, ২০২২
androidx.compose.runtime:runtime-*:1.2.0-alpha01 is released. Version 1.2.0-alpha01 contains these commits.
API Changes
- Added
identityfield toCompositionDatafor generating invariant ids in the Layout Inspector. ( Ic116e )
Dependency Updates
- Now depends on Kotlin
1.6.10.
Version 1.1
সংস্করণ 1.1.1
২৩ ফেব্রুয়ারী, ২০২২
androidx.compose.runtime:runtime-*:1.1.1 is released. Version 1.1.1 contains these commits.
Bug Fixes
- Fix
NullPointerExceptionatandroidx.compose.ui.platform.RenderNodeLayer.updateDisplayList( aosp/1947059 , b/206677462 ) - Fix crash caused by clipboard content while reading from clipboard on Android. ( I06020 , b/197769306 )
- Fixed RTL in
LazyVerticalGrid( aosp/1931080 , b/207510535 )
সংস্করণ 1.1.0
৯ ফেব্রুয়ারী, ২০২২
androidx.compose.runtime:runtime-*:1.1.0 is released. Version 1.1.0 contains these commits.
Important changes since 1.0.0
- Stable support for the Android 12 Overscroll effect
- Improvements to touch target sizing
- Note that, with respect to Compose 1.0, Material components will expand their layout space to meet Material accessibility guidelines for touch target size . For instance, Button touch target will expand to a minimum size of
48x48dp, even if you set the Button's size to be smaller. This aligns Compose Material to the same behavior of Material Design Components, providing consistent behavior if you mix Views and Compose. This change also ensures that when you create your UI using Compose Material components, minimum requirements for touch target accessibility will be met. - Stable support for Navigation Rail
- Graduates a number of previously experimental APIs to stable
- Support for newer versions of Kotlin
Version 1.1.0-rc03
২৬ জানুয়ারী, ২০২২
androidx.compose.runtime:runtime-*:1.1.0-rc03 is released. Version 1.1.0-rc03 contains these commits.
Bug Fixes
- Updated to support Compose Material
1.1.0-rc03
Version 1.1.0-rc01
December 15, 2021
androidx.compose.runtime:runtime-*:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.
Version 1.1.0-beta04
১ ডিসেম্বর, ২০২১
androidx.compose.runtime:runtime-*:1.1.0-beta04 is released. Version 1.1.0-beta04 contains these commits.
নতুন বৈশিষ্ট্য
- Updated to be compatible with Kotlin
1.6.0
Version 1.1.0-beta03
১৭ নভেম্বর, ২০২১
androidx.compose.runtime:runtime-*:1.1.0-beta03 is released. Version 1.1.0-beta03 contains these commits.
Version 1.1.0-beta02
November 3, 2021
androidx.compose.runtime:runtime-*:1.1.0-beta02 is released. Version 1.1.0-beta02 contains these commits.
API Changes
- Snapshot code was split up into multiple files, but all still lives in the same JVM class. ( Ic6c98 )
Version 1.1.0-beta01
২৭ অক্টোবর, ২০২১
androidx.compose.runtime:runtime-*:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.
Version 1.1.0-alpha06
October 13, 2021
androidx.compose.runtime:runtime-*:1.1.0-alpha06 is released. Version 1.1.0-alpha06 contains these commits.
API Changes
- Removed
InternalCompilerApifrom Composer methods that are required to be called cross-module ( I1aa0b ) -
Recomposer.statehas been deprecated and replaced byRecomposer.currentStateto change its type to a StateFlow ( Ic2ab3 , b/197773820 )
Version 1.1.0-alpha05
২৯ সেপ্টেম্বর, ২০২১
androidx.compose.runtime:runtime-*:1.1.0-alpha05 is released. Version 1.1.0-alpha05 contains these commits.
Version 1.1.0-alpha04
১৫ সেপ্টেম্বর, ২০২১
androidx.compose.runtime:runtime-*:1.1.0-alpha04 is released. Version 1.1.0-alpha04 contains these commits.
Version 1.1.0-alpha03
১ সেপ্টেম্বর, ২০২১
androidx.compose.runtime:runtime-*:1.1.0-alpha03 is released. Version 1.1.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- The Compose Compiler now supports older versions of the Compose Runtime (1.0). Prior to this change, the Compose Compiler was only compatible with the Compose Runtime of the same version or later. After this change, the Compose Compiler is compatible with an older version of the Compose Runtime (1.0). ( aosp/1796968 )
- Updated Compose
1.1.0-alpha03to depend on Kotlin1.5.30. ( I74545 )
Version 1.1.0-alpha02
১৮ আগস্ট, ২০২১
androidx.compose.runtime:runtime-*:1.1.0-alpha02 is released. Version 1.1.0-alpha02 contains these commits.
Version 1.1.0-alpha01
৪ আগস্ট, ২০২১
androidx.compose.runtime:runtime-*:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.
Version 1.0
সংস্করণ 1.0.5
November 3, 2021
androidx.compose.runtime:runtime-*:1.0.5 is released. Version 1.0.5 contains these commits.
Bug Fixes
- Fixed a crash tracking derivedStateOf instances. ( aosp/1792247 )
Version 1.0.4
October 13, 2021
androidx.compose.runtime:runtime-*:1.0.4 is released. Version 1.0.4 contains these commits.
Dependency Updates
- Updated to depend on Kotlin
1.5.31
Version 1.0.3
২৯ সেপ্টেম্বর, ২০২১
androidx.compose.runtime:runtime-*:1.0.3 is released. Version 1.0.3 contains these commits.
Dependency Updates
- Updated to depend on Kotlin
1.5.30
সংস্করণ 1.0.2
১ সেপ্টেম্বর, ২০২১
androidx.compose.runtime:runtime-*:1.0.2 is released. Version 1.0.2 contains these commits.
Updated to support the Compose 1.0.2 release. Compose 1.0.2 is still compatible with Kotlin 1.5.21 .
সংস্করণ 1.0.1
৪ আগস্ট, ২০২১
androidx.compose.runtime:runtime-*:1.0.1 is released. Version 1.0.1 contains these commits.
Dependency Updates
- Updated to depend on Kotlin
1.5.21.
সংস্করণ 1.0.0
July 28, 2021
androidx.compose.runtime:runtime-*:1.0.0 is released. Version 1.0.0 contains these commits.
Major features of 1.0.0
This is the first stable release of Compose. Please see the official Compose Release blog for more details!
জ্ঞাত সমস্যা
If you are using Android Studio Bumblebee Canary 4 or AGP
7.1.0-alpha04/7.1.0-alpha05, you may hit the following crash:java.lang.AbstractMethodError: abstract method "void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)"To fix, temporarily increase your minSdkVersion to 24+ in your
build.gradlefile. This issue will be fixed in the next version of Android Studio Bumblebee and AGP7.1. ( b/194289155 )
Version 1.0.0-rc02
১৪ জুলাই, ২০২১
androidx.compose.runtime:runtime-*:1.0.0-rc02 is released. Version 1.0.0-rc02 contains these commits.
- Fixed race conditions in SnapshotStateObserver causing spurratic NullPointerExceptions. ( aosp/1763445 , aosp/1758105 , b/192677711 )
- Fixed issues with runtime snapshots causing
java.lang.IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been appliedcrashes. ( b/193006595 , b/192570897 )
Version 1.0.0-rc01
July 1, 2021
androidx.compose.runtime:runtime-*:1.0.0-rc01 is released. Version 1.0.0-rc01 contains these commits.
Version 1.0.0-beta09
১৬ জুন, ২০২১
androidx.compose.runtime:runtime-*:1.0.0-beta09 is released. Version 1.0.0-beta09 contains these commits.
Added Profile Rules
This release adds profile rules to the following compose modules ( I14ed6 ):
- androidx.compose.animation
- androidx.compose.animation-core
- androidx.compose.foundation
- androidx.compose.foundation-layout
- androidx.compose.material
- androidx.compose.material-ripple
- androidx.compose.runtime
- androidx.compose.ui
- androidx.compose.ui.geometry
- androidx.compose.ui.graphics
- androidx.compose.ui.text
- androidx.compose.ui.text
- androidx.compose.ui.unit
- androidx.compose.ui.util
What are profile rules?
Profile rules for a library are specified in a text file
baseline-prof.txtlocated in thesrc/mainor equivalent directory. The file specifies a rule per line, where a rule in this case is a pattern for matching to methods or classes in the library. The syntax for these rules is a superset of the human-readable ART profile format that is used when usingadb shell profman --dump-classes-and-methods .... These rules take one of two forms to target either methods or classes.A method rule will have the following pattern:
<FLAGS><CLASS_DESCRIPTOR>-><METHOD_SIGNATURE>And a class rule will have the following pattern:
<CLASS_DESCRIPTOR>Here
<FLAGS>is one or more of the charactersH,S, andPto indicate whether or not this method should be flagged as "Hot", "Startup", or "Post Startup".The
<CLASS_DESCRIPTOR>is the descriptor for the class that the targeted method belongs to. For example, the classandroidx.compose.runtime.SlotTablewould have a descriptor ofLandroidx/compose/runtime/SlotTable;.The
<METHOD_SIGNATURE>is the signature of the method, and includes the name, parameter types, and return types of the method. For example, the methodfun isPlaced(): BooleanonLayoutNodehas the signatureisPlaced()Z.These patterns can have wildcards (
**,*, and?) in order to have a single rule encompass multiple methods or classes.
What do the rules do?
A method that has the flag
Hindicates that this method is a "hot" method, and should be compiled ahead of time.A method that has the flag
Sindicates that it is a method which is called at startup, and should be compiled ahead of time to avoid the cost of compilation and interpreting the method at startup time.A method that has the flag
Pindicates that it is a method which is called after startup.A class that is present in this file indicates that it is used during startup and should be pre-allocated in the heap to avoid the cost of class loading.
How does this work?
- Libraries can define these rules which will be packaged in AAR artifacts. When an app is then built which includes these artifacts, these rules are merged together and the merged rules are used to build a compact binary ART profile that is specific to the app. ART can then leverage this profile when the app is installed on devices in order to ahead-of-time compile a specific subset of the application to improve the performance of the application, especially the first run. Note that this will have no effect on debuggable applications.
Version 1.0.0-beta08
June 2, 2021
androidx.compose.runtime:runtime-*:1.0.0-beta08 is released. Version 1.0.0-beta08 contains these commits.
API Changes
-
State<T>is nowState<out T>( I69049 ) -
ControlledCompositionAPI change to enable recomposing changes in a recompose single pass. ( Iaafd1 , b/184173932 )
Version 1.0.0-beta07
১৮ মে, ২০২১
androidx.compose.runtime:runtime-*:1.0.0-beta07 is released. Version 1.0.0-beta07 contains these commits.
API Changes
- Added new compose compiler APIs that allow the source information generated by the compiler to be removed during source minification. ( Ia34e6 )
Introduces
ReusableContentwhich will attempt to reuse the nodes in its content instead of replacing them when the key is changed. When the key is changed the previous values in the slot table for the content is ignored except for the nodes that were generated and the values used to update the nodes.Introduces
ReusableComposeNodethat will reuse the node emitted instead of replacing it as is done forComposeNode. ( I1dd86 )@ComposeCompilerApino longer@RequiresOptIn( Iab690 )
Bug Fixes
- LazyColumn/Row will now keep up to 2 previously visible items active (not disposed) even when they are scrolled out already. This allows the component to reuse the active subcompositions when we will need to compose a new item which improves the scrolling performance. ( Ie5555 )
Version 1.0.0-beta06
May 5, 2021
androidx.compose.runtime:runtime-*:1.0.0-beta06 is released. Version 1.0.0-beta06 contains these commits.
API Changes
-
@ComposeCompilerApino longer@RequiresOptIn( Iab690 )
Version 1.0.0-beta05
April 21, 2021
androidx.compose.runtime:runtime-*:1.0.0-beta05 is released. Version 1.0.0-beta05 contains these commits.
API Changes
- Removed
@InternalComposeApifor recording snapshot reads and writes ( Id134d )
Bug Fixes
- The AndroidManifest files from ui-test-manifest and ui-tooling-data are now compatible with Android 12 ( I6f9de , b/184718994 )
Version 1.0.0-beta04
April 7, 2021
androidx.compose.runtime:runtime-*:1.0.0-beta04 is released. Version 1.0.0-beta04 contains these commits.
Bug Fixes
Prior to this change, local composable functions were skippable based on their parameters. After this change, no local composable functions will skip. This change is done because it is common and expected for local functions to capture parameters from the parent and them skipping is a common source of bugs.
To summarize, consider the example:
@Composable fun Counter(count: Int, onCountChange: (Int) -> Unit) { @Composable fun ShowCount() { Text("Count: $count") } ShowCount() Button(onClick={ onCountChange(count + 1) }) { Text("Increment") } }Prior to this change, the
ShowCountcomposable function would always skip, even after thecountparameter was updated. This is no longer the case. ( I5648a )Fixed the issue when
rememberSaveable()was restoring the old value when used with input params ( I1b110 , b/182403380 )
Version 1.0.0-beta03
২৪ মার্চ, ২০২১
androidx.compose.runtime:runtime-*:1.0.0-beta03 is released. Version 1.0.0-beta03 contains these commits.
API Changes
-
DefaultMonotonicFrameClockis deprecated. CallingwithFrameNanosorRecomposer.runRecomposeAndApplyChangeswith noMonotonicFrameClockwill now throwIllegalStateException. ( I4eb0d )
Version 1.0.0-beta02
March 10, 2021
androidx.compose.runtime:runtime-*:1.0.0-beta02 is released. Version 1.0.0-beta02 contains these commits.
Bug Fixes
- Enforce restrictions on public usage of experimental APIs ( I6aa29 , b/174531520 )
- Fix for broken
rememberSaveable { mutableStateOf(0) }when used inside a destination of navigation-compose. ( I1312b , b/180042685 , b/180701630 )
Version 1.0.0-beta01
২৪ ফেব্রুয়ারী, ২০২১
androidx.compose.runtime:runtime-*:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.
This is the first release of Compose 1.0.0 Beta.
API Changes
- Add
Recomposer.runRecomposeConcurrentlyAndApplyChangesexperimental API for recomposing invalidated compositions off the main frame loop. ( I342d0 ) - Any composables marked with @ReadOnlyComposable are now compile-time validated to ensure that they only make calls to other @ReadOnlyComposables ( I58961 )
The
defaultFactoryforcompositionLocalOfandstaticCompositionLocalOfis now required instead of optional.This changes removes a potential type error for non-nullable types where no default factory was provided. Previously this would provide a null reference for a non-nullable type.
For nullable types consider supplying
{ null }as the default factory.We do not recommend using locals with non-nullable types unless a sensible default can be provided. If no sensible default exists, the
defaultFactorylambda should throw an exception. However throwing an exception means that consumers of the local will have an implicit dependency on it being provided that is not enforced by the type system. ( Ifbd2a )Deprecated symbols were removed from the compose runtime ( I3252c )
Deprecated
emptyContent()is removed. Use{}instead. ( Idb33f , b/179432510 )Providers has been renamed to CompositionLocalProvider
- The Composition constructor no longer accepts a key parameter, and has been deprecated.
- currentCompositeKeyHash has been turned into a composable top level property instead of a composable top level function.
- CompositionData and CompositionGroup have been moved to the androidx.compose.runtime.tooling namespace
- ComposableLambda has been made an interface instead of a concrete class, and no longer has type parameters.
- ComposableLambdaN has been made an interface instead of a concrete class, and no longer has type parameters.
- The snapshotFlow function has been moved to the androidx.compose.runtime namespace
- the merge method of SnapshotMutationPolicy is no longer experimental
- The @TestOnly top level clearRoots function has been removed. It is no longer necessary.
- keySourceInfoOf and resetSourceInfo functions have been removed. They are no longer necessary.
- Composer.collectKeySourceInformation has been removed. It is no longer necessary.
- isJoinedKey, joinedKeyLeft, and joinedKeyRight methods have been removed. They are no longer necessary.
- Various top level APIs have been moved and reorganized into different files. Due to Kotlin's file class semantics, this will break binary compatibility but not source compatibility, so should not be an issue for most users.
- ( I99b7d , b/177245490 )
SnapshotStateObserver is not Experimental anymore ( Id2e6a )
Deleted some previously deprecated APIs ( Ice5da , b/178633932 )
Made the following Material API changes:
- Added contentPadding parameter to Top/BottomAppBar to allow customizing the default padding.
- Reordered parameters in BackdropScaffold to follow API guidelines for required parameters being before optional parameters.
- Moved
iconparameter in BottomNavigationItem to be afterselectedandonClick. - Renamed
alwaysShowLabelsparameter in BottomNavigationItem toalwaysShowLabel. - Renamed
bodyContentparameters in a few components to justcontent. - Reordered parameters in
ButtonDefaults.buttonColors(). Please note that because the type of the parameters have not changed, this will not cause an error in your code - please ensure you are either using named parameters or update the ordering manually, otherwise your code will not work the same as previously. - Added
secondaryVariantparameter todarkColors(). This color is typically the same assecondaryin dark theme, but adding for consistency and further customization. - Removed ElevationDefaults and animateElevation() from the public API surface since they were not commonly used / useful.
- Renamed
onValueChangeEndinSlidertoonValueChangeFinishedand made it nullable. - Renamed
textparameter inSnackbartocontentfor consistency. - Added
contentPaddingparameter toDropdownMenuItemto allow customizing the default padding and madecontentbe an extension onRowScope. - Renamed
ModalDrawerLayouttoModalDrawer. - Renamed
BottomDrawerLayouttoBottomDrawer. - ( I1cc66 )
Version 1.0.0-alpha12
১০ ফেব্রুয়ারী, ২০২১
androidx.compose.runtime:runtime-*:1.0.0-alpha12 is released. Version 1.0.0-alpha12 contains these commits.
API Changes
- Support for ViewGroups was removed from UiApplier. The Deprecated emitView composables were removed. ( Ifb214 )
- CompositionReference renamed to CompositionContext ( I53fcb )
- ComponentActivity.setContent has moved to androidx.activity.compose.setContent in the androidx.activity:activity-compose module. ( Icf416 )
- Snapshot API was updated to be more consistent with API guideline as well as hiding internal implementation classes from the public API. ( Id9e32 )
- Renamed Ambients to match the Ambient -> CompositionLocal rename. Ambients used to be named AmbientFoo, now CompositionLocals are named LocalFoo. ( I2d55d )
- Renamed Ambient to CompositionLocal, and ambientOf / staticAmbientOf to compositionLocalOf / staticCompositionLocalOf respectively. This change helps to make the purpose of CompositionLocal more clear: a mechanism for providing / retrieving values local to a composition. CompositionLocal instances should be prefixed with
Local, such as val LocalFoo = compositionLocalOf { Foo() }. ( Ia55b6 ) - takeMutableSnapshot and takeSnapshot have moved to be companion methods of Snapshot. ( I91f19 )
@ComposableContracthas been deprecated in favor of three more specific annotations.@ComposableContract(restartable = false)has become@NonRestartableComposable@ComposableContract(readonly = true)has become@ReadOnlyComposable@ComposableContract(preventCapture = true)has become@DisallowComposableCalls@ComposableContract(tracked = true)has been removed. ( I60a9d )emptyContent() and (@Composable () -> Unit).orEmpty() utilities have been deprecated as they no longer have any positive performance impact or value ( I0484d )
snapshotFlowandwithMutableSnapshotare no longer experimental ( I6a45f )Recomposers can now be closed. Closed recomposers will continue recomposition until composition child coroutines complete. Recomposer.shutDown renamed to cancel to contrast with close. ( Ib6d76 )
The
compose:runtime-dispatchartifact is now deprecated. MonotonicFrameClock can now be found in compose:runtime and AndroidUiDispatcher can be found in compose:ui. ( Ib5c36 )The API the Compose compiler plugin targets has been refactored to use an interface instead of a concrete class. The interface also no longer uses a type parameter.
This is an internal change that should not effect source code compatibility but is a binary breaking change. ( I3b922 , b/169406779 )
SnapshotMutableState was introduced ( Icfd03 )
DisposableEffectDisposable was renamed to DisposaleEffectResult ( Ica7c6 )
Removed Recomposer.current(). [Abstract]ComposeView now default to lazily created, window-scoped Recomposers driven by the ViewTreeLifecycleOwner for the window. Recomposition and withFrameNanos-based animation ticks are paused while the host Lifecycle is stopped. ( I38e11 )
Recomposer.runningRecomposers now offers a global StateFlow of read-only RecomposerInfo for observing ongoing composition state in the process. Prefer this API to Recomposer.current(), which is now deprecated. ( If8ebe )
DisposableEffectDisposable was renamed to DisposaleEffectResult ( I3ea68 )
Version 1.0.0-alpha11
January 28, 2021
androidx.compose.runtime:runtime-*:1.0.0-alpha11 is released. Version 1.0.0-alpha11 contains these commits.
API Changes
- onCommit, onDispose, and onActive have been deprecated in favor of SideEffect and DisposableEffect APIs ( If760e )
- The emit() API and all overloads have been deprecated and renamed to ComposeNode. The APIs are identical, just a different name in order to follow the naming conventions of Compose ( I4137b )
- invalidate and compositionReference() are now deprecated in favor of currentRecomposeScope and rememberCompositionReference respectively. ( I583a8 )
RememberObserver replaces CompositionLifecycleObserver and CompositionLifecycleObserver is now deprecated.
RememberObserveris a replacement forCompositionLifecycleObserverwith modified semantics and renamed methods. Changing to the new API can be done mechanically for objects that are only remembered once which is, and continues to be, the recommended practice. However, if a reference was remembered more than once in a compositiononRememberedis called for each reference whereonEnteris only called once.onEnterwas called multiple time if the object was used in subcompositions, such asWithConstraintsandScaffoldmaking the singleonEntercall guarantee unreliable and it was removed forRememberObserver.RememberObserveraddsonAbandonedwhich is called if theRememberObserverinstance is returned from the callback passed torememberbut was not remembered in the composition state and, therefore, will never haveonRememberedcalled. This can occur if an exception terminates composition before completing or the composition is discarded because the state is was producing a composition for is no longer current or otherwise is no longer needed. If the instance ofRememberObserverfollowing the single reference recommendation above is tracking an external resource bothonForgottenandonAbandonedeach indicate that the resource is no longer needed. If the object is tracking work started or resources allocated inonRemembered,onAbandonedcan be ignored as it will not be called ifonRememberedis called. ( I02c36 )Do not mark
collectAsState()functions as inline ( Ia73e4 )
Bug Fixes
- WithConstraints was reworked as BoxWithConstraints and moved to foundation.layout. ( I9420b , b/173387208 )
- Leverage TestCoroutineDispatcher in testing ( I532b6 )
Version 1.0.0-alpha10
January 13, 2021
androidx.compose.runtime:runtime-*:1.0.0-alpha10 is released. Version 1.0.0-alpha10 contains these commits.
Breaking Change
Restructuring of the internal compiler API allows batching changes to the nodes generated as a result of composition into the "apply changes" phase of composition, after all
@Composablefunctions have completed.This is a behavioral breaking change that might affect application code as nodes are no longer available from internal and experimental APIs until after changes have been applied. This can usually be worked around by surrounding code with such dependencies in a
SideEffectcomposable to defer execution of the code until after the nodes have been created and initialized. ( I018da )
API Changes
- Added a way to track if the recomposer has applied changes. ( I1b3e2 )
Expand [Abstract]ComposeView APIs to allow recycling Compose-based views, disposing their composition to recreate again later. Add APIs for installing and discovering window-scoped Recomposers and CompositionReferences for creating child compositions.
Add ViewCompositionStrategy for configuring the composition disposal strategy of [Abstract]ComposeViews; default behavior is dispose on window detach. ( I860ab )
Bug Fixes
- Recomposer now exposes a Flow of its current state, allowing monitoring its activity and the activity of associated effects. ( Ifb2b9 )
- The native keyEvent can now be accessed through keyEvent.nativeKeyEvent ( I87c57 , b/173086397 )
Version 1.0.0-alpha09
December 16, 2020
androidx.compose.runtime:runtime-*:1.0.0-alpha09 is released. Version 1.0.0-alpha09 contains these commits.
API Changes
Removed SlotTable, SlotReader and SlotWriter from the public API. These were marked as InternalComposeAPI previously. Now they are internal to the compose module.
CompositionData and CompositionGroup were added as a replacement for the ui-tooling API to use to extract composition information. These are public but are not intended for use outside the ui-tooling API as they provide the raw information the ui-tooling API interprets ( I31a9c )
The Applier class is no longer considered an ( Id85b0 )
The
Applierinterface has changed to simplify building trees bottom-up instead of top-down.The
insert()method has been renamed toinsertTopDown().A new method,
insertBottomUp(), was added.An applier either inserts nodes into the tree it is editing using
insertTopDown()orinsertBottomUp()depending on which performs better.Some trees, such as
LayoutNodeandView, are much more efficient to build bottom-up than top-down. Prior to this change, a stack of inserts was required to implement bottom-up which needed to be copied to every applier which needed bottom-up construction for performance. With this change anApplieroverridesinsertBottomUp()to build a tree bottom-up andinsertTopDown()to build the tree top-down. ( Icbdc2 )Compose supports property getters that can make composable invocations. Support for this is not going away, but the syntax for declaring a property getter as being @Composable is changing.
The now-deprecated syntax for doing this was by annotating the property itself:
@Composable val someProperty: Int get() = ...The now-correct syntax for doing this is by annotating the getter of the property:
val someProperty: Int @Composable get() = ...Both syntaxes will work for some time, but the former deprecated syntax will eventually become a compile error. ( Id9197 )
Bug Fixes
- AndroidOwner made internal ( Ibcad0 , b/170296980 )
- subcomposeInto(LayoutNode) was made internal ( Id724a )
Version 1.0.0-alpha08
December 2, 2020
androidx.compose.runtime:runtime-*:1.0.0-alpha08 is released. Version 1.0.0-alpha08 contains these commits.
API Changes
- Added lint check for composable lambda parameter naming and position, to check for consistency with Compose guidelines. Also migrated some APIs using
childrenas the name for their trailing lambda tocontent, according to the lint check and guidance. ( Iec48e ) - Recomposer no longer accepts an EmbeddingContext; required scheduling dependencies are obtained from the effectCoroutineContext. FrameManager is deprecated; platform integrations should initialize their own global snapshot handling. ( I02369 )
- RestorableStateHolder.withRestorableState function was renamed to RestorableStateProvider ( I66640 )
Bug Fixes
- Deprecated Ambients named with
Ambientas their suffix, and replaced them with new properties prefixed with Ambient, following other Ambients and Compose API guidelines. ( I33440 ) - Remove old ui-test module and its stubs ( I3a7cb )
Version 1.0.0-alpha07
November 11, 2020
androidx.compose.runtime:runtime-*:1.0.0-alpha07 is released. Version 1.0.0-alpha07 contains these commits.
নতুন বৈশিষ্ট্য
API Changes
- The
@UnionTypeannotation has been deprecated ( I57cde ) - provideDefault was added as an alternative to provide for providing ambients, and it can be used to specify ambient values that will only be set when there is no ambient value already provided. ( Id6635 , b/171024925 )
- LaunchedTask was renamed to LaunchedEffect for consistency with the SideEffect and DisposableEffect APIs. LaunchedEffect with no subject params is not permitted in order to encourage best practices. ( Ifd3d4 )
- Applier now has onBeginChanges/onEndChanges callbacks that are invoked when a Composer begins/is finished applying changes to the tree. These may be used for batching resource management if needed. ( Icf476 )
- Recomposer now requires a CoroutineContext at construction ( Ic4610 )
- Changes to the internal SlotTable implementation which should not affect the public API. ( If9828 )
- Deprecated rxjava2 adapters which does not take the initial value were removed ( Idb72f )
Bug Fixes
- foundation.Text has been deprecated and replaced with material.Text. For a basic, unopinionated text API that does not consume values from a theme, see androidx.compose.foundation.BasicText. ( If64cb )
- BaseTextField has been deprecated. Use BasicTextField instead. ( I896eb )
- Several layout related symbols were moved from androidx.compose.ui to androidx.compose.layout.ui. ( I0fa98 , b/170475424 )
External Contribution
- Added
runtime-rxjava3module for compose. Similar toruntime-rxjava2( I02cbf )
Version 1.0.0-alpha06
October 28, 2020
androidx.compose.runtime:runtime-*:1.0.0-alpha06 is released. Version 1.0.0-alpha06 contains these commits.
API Changes
- Recomposer is now a CompositionReference and a valid composition parent. Explicit Recomposer is now required in fewer places. ( I4036f )
- Added DisposableEffect counterpart API to SideEffect, filling the role of onCommit-with-params but with a required onDispose.
- Added rememberUpdatedState API to publish data from recomposition to ongoing or long-lived processes such as DisposableEffects or LaunchedTasks.
- ( Id50b9 )
- MutableVector now implements RandomAccess ( I85d73 , b/170461551 )
- Added SideEffect composable for applying side effects of composition to objects managed by the composition. SideEffect is intended to replace the onCommit composable. ( Ia77c2 )
- New experimental api RestorableStateHolder. It allows to save the state defined with [savedInstanceState] and [rememberSavedInstanceState] for the subtree before disposing it to make it possible to compose it back next time with the restored state. ( I66884 , b/166586419 )
Bug Fixes
- Enable transitions in ComposeTestRule; remove option to enable the blinking cursor from ComposeTestRule. ( If0de3 )
Version 1.0.0-alpha05
১৪ অক্টোবর, ২০২০
androidx.compose.runtime:runtime-*:1.0.0-alpha05 is released. Version 1.0.0-alpha05 contains these commits.
API Changes
- Experimental Modifier.pointerInput suspending input modifier ( Ia77d2 )
- The scrolling performance of LazyColumn/Row is improved by doing less work in subcomposition on every scroll. The new hasInvalidations() method was added for Composition class. hasPendingChanges() method from Recomposer was renamed to hasInvalidations() ( Ib2f32 , b/168293643 , b/167972292 , b/165028371 )
- Add produceState API for launching coroutines from composition that update a single
State<T>value over time ( Id4a57 ) - launchInComposition renamed to LaunchedTask to match Compose API guidelines ( I99a8e )
- The order of place() calls in custom Layouts now defines the drawing order for the children ( Ibc9f6 )
Version 1.0.0-alpha04
October 1, 2020
androidx.compose.runtime:runtime-*:1.0.0-alpha04 is released. Version 1.0.0-alpha04 contains these commits.
API Changes
- Added OwnerScope to allow collection of layout and drawing observation scopes once they are no longer valid. ( Ic4cf8 )
- Added derivedStateOf API to create State objects based on a calculation which may read (and derive from) other State objects ( If758b )
- Added TestOnly API for SnapshotStateObserver ( I6e2a9 )
Bug Fixes
- foundation.Box was deprecated. Please use foundation.layout.Box instead. ( Ie5950 , b/167680279 )
Version 1.0.0-alpha03
September 16, 2020
androidx.compose.runtime:runtime-*:1.0.0-alpha03 is released. Version 1.0.0-alpha03 contains these commits.
API Changes
-
CompositionCoroutineScopeno longer implementsMonotonicFrameClock. Callers ofwithFrameNanosshould import the top-level function explicitly. ( Icb642 , b/166778123 )
Bug Fixes
- Global testing functions such as
onNodeorwaitForIdleare now deprecated, please migrate to their new counterparts that are defined on ComposeTestRule ( I7f45a ) -
launchInCompositionno longer launches coroutines undispatched ( Ief6af , b/166486000 )
Version 1.0.0-alpha02
২ সেপ্টেম্বর, ২০২০
androidx.compose.runtime:runtime-*:1.0.0-alpha02 is released. Version 1.0.0-alpha02 contains these commits.
API Changes
- Add
snapshotFlowandwithMutableSnapshotAPIs for consuming and producing Snapshot data changes. ( I3e722 ) The calling convention for composable functions has changed. This is a binary breaking change. All libraries must be recompiled to work with this version of the compose compiler plugin.
This change does not create a source level breaking change as the only APIs that have changed are compiler APIs that have an explicit opt in. ( I7afd2 , b/158123185 )
Removed scheduling methods from EmbeddingContext ( I7b9be )
onPreCommit is deprecated; onCommit now has onPreCommit's behavior.
onCommit and onActive now run in the same choreographer frame that the composition changes committed in rather than at the beginning of the next choreographer frame. ( I70403 )
Version 1.0.0-alpha01
২৬ আগস্ট, ২০২০
androidx.compose.runtime:runtime-*:1.0.0-alpha01 is released. Version 1.0.0-alpha01 contains these commits.
Version 0.1.0-dev
Version 0.1.0-dev17
August 19, 2020
androidx.compose.runtime:runtime-*:0.1.0-dev17 is released. Version 0.1.0-dev17 contains these commits.
API Changes
- Custom emits can now declare that one or more of its setters can be skipped and recomposed independently of the emit. ( Ibbd13 )
Removed deprecated FrameManager calls.
Internal compose APIs have been changed to reduce the amount of overhead to track state objects such as
mutableStateof()( I80ba6 )The
state { ... }composable is now deprecated in favor of explicit calls toremember { mutableStateOf(...) }for clarity. This reduces the overall API surface and number of concepts for state management, and matches theby mutableStateOf()pattern for class property delegation. ( Ia5727 )Flow.collectAsState now determines the default dispatcher from the composition itself rather than defaulting to Dispatchers.Main. ( I9c1d9 )
Crash when something which saves the state was used inside the for loop is fixed. Now having the same key in savedInstanceState() is allowed, api of UiSavedStateRegistry is now adjusted to this new requirement ( I4ab76 , b/160042650 , b/156853976 , b/159026663 , b/154920561 )
Bug Fixes
-
emitViewwas deprecated. UseAndroidViewinstead if possible for emitting Views inside Compose. Note that composing Views and ViewGroups directly will not be supported in the future unless these are leaves in the composition tree, case when this can be achieved using AndroidView. ( I29b1e , b/163871221 )
Version 0.1.0-dev16
৫ আগস্ট, ২০২০
androidx.compose.runtime:runtime-*:0.1.0-dev16 is released. Version 0.1.0-dev16 contains these commits.
API Changes
The default mutation policy of
mutableStateOf(),ambientOf()andsavedInstanceStateOf()has changed to bestructuralEqualityPolicy()instead ofreferentialEqualityPolicy().The default for deciding if a new value assigned to a
mutableStateOf()instance is considered a change now defaults to using==instead of using===.See https://kotlinlang.org/docs/reference/equality.html
ambientOf()andsavedInstanceStateOf()usemutableStateOf()in their implementations so they were changed to be consistent withmutableStateOf().Using structural equality more closely matches developer expectations.
উদাহরণস্বরূপ,
val state = mutableStateOf(1f)followed by,
state.value = 1fwill no longer be consider a change to
stateand uses ofstateduring composition will no longer need to be recomposed.This is a breaking change but, in most cases (such when using classes that do not override
equals()), this will not have a noticeable effect on an application.Classes that do override
equals(), such asdataclasses, might see a performance degradation as theirequals()methods are now, by default, called when assigned to amutableStateOf().The previous behavior can be restored by adding the policy parameter
policy = referentialEqualityPolicy()to calls tomutableStateOf(),ambientOf()andsavedInstanceStateOf(). ( Ic21a7 )RowandColumnare now inline function significantly reducing the overhead of using them. ( I75c10 )
Bug Fixes
- setViewContent was deprecated. setContent should be used instead. ( I7e497 , b/160335130 )
Added MonotonicFrameAnimationClock that enables you to use a MonotonicFrameClock as an AnimationClockObservable to bridge the gap between the new coroutines based clocks and APIs that still use the old callback based clocks.
The MonotonicFrameClock equivalent of ManualAnimationClock is now ManualFrameClock. ( I111c7 , b/161247083 )
Modifier.stateDraggable was completely reworked and renamed to Modifier.swipeable. A new SwipeableState class was introduced, and DrawerState and BottomDrawerState were refactored to inherit from it. [Modal/Bottom]DrawerLayout no longer take an onStateChange parameter. ( I72332 , b/148023068 )
Modifier.plus has been deprecated, use Modifier.then instead. 'Then' has a stronger signal of ordering, while also prohibits to type
Modifier.padding().background() + anotherModifier, which breaks the chain and harder to read ( Iedd58 , b/161529964 )SubcomposeLayout is added. It is a low level primitive which allows to compose the children during the measuring if we want to use some values available only later during the measure for the subtree composition. For example WithConstraints is not implemented using SubcomposeLayout. ( I25cc8 )
Material FilledTextField was renamed to TextField and foundational TextField was renamed to BaseTextField to make simplest desired API easy to discover and use ( Ia6242 , b/155482676 )
Modifier.drawBackground has been renamed to Modifier.background ( I13677 )
Version 0.1.0-dev15
July 22, 2020
androidx.compose.runtime:runtime-*:0.1.0-dev15 is released. Version 0.1.0-dev15 contains these commits.
Dependencies Update
- To use the
0.1.0-dev15version of Compose, you will need to update your dependencies according to the new code snippets shown above in Declaring dependencies .
API Changes
@Modelannotation is now deprecated. Use state and mutableStateOf as alternatives. This deprecation decision was reached after much careful discussion.Justification
Rationale includes but is not limited to:
- Reduces API surface area and concepts we need to teach
- More closely aligns with other comparable toolkits (Swift UI, React, Flutter)
- Reversible decision. We can always bring
@Modelback later. - Removes corner-case usage and difficult to answer questions about configuring
@Modelas things we need to handle -
@Modeldata classes, equals, hashcode, etc. - How do I have some properties “observed” and others not?
- How do I specify structural vs. referential equality to be used in observation?
- Reduces “magic” in the system. Would reduce the likelihood of someone assuming system was smarter than it is (ie, it knowing how to diff a list)
- Makes the granularity of observation more intuitive.
- Improves refactorability from variable -> property on class
- Potentially opens up possibilities to do hand-crafted State-specific optimizations
- More closely aligns with the rest of the ecosystem and reduces ambiguity towards immutable or us “embracing mutable state”
Migration Notes
Almost all existing usages of
@Modelare fairly trivially transformed in one of two ways. The example below has a@Modelclass with two properties just for the sake of example, and has it being used in a composable.@Model class Position( var x: Int, var y: Int ) @Composable fun Example() { var p = remember { Position(0, 0) } PositionChanger( position=p, onXChange={ p.x = it } onYChange={ p.y = it } ) }Alternative 1: Use
State<OriginalClass>and create copies.This approach is made easier with Kotlin's data classes. Essentially, make all previously
varproperties intovalproperties of a data class, and then usestateinstead ofremember, and assign the state value to cloned copies of the original using the data classcopy(...)convenience method.It's important to note that this approach only works when the only mutations to that class were done in the same scope that the
Stateinstance is created. If the class is internally mutating itself outside of the scope of usage, and you are relying on the observation of that, then the next approach is the one you will want to use.data class Position( val x: Int, val y: Int ) @Composable fun Example() { var p by state { Position(0, 0) } PositionChanger( position=p, onXChange={ p = p.copy(x=it) } onYChange={ p = p.copy(y=it) } ) }Alternative 2: Use mutableStateOf and property delegates
This approach is made easier with Kotlin's property delegates and the
mutableStateOfAPI which allows you to create MutableState instances outside of composition. Essentially, replace allvarproperties of the original class withvarproperties withmutableStateOfas their property delegate. This has the advantage that the usage of the class will not change at all, only the internal implementation of it. The behavior is not completely identical to the original example though, as each property is now observed/subscribed to individually, so the recompositions you see after this refactor could be more narrow (a good thing).class Position(x: Int, y: Int) { var x by mutableStateOf(x) var y by mutableStateOf(y) } // source of Example is identical to original @Composable fun Example() { var p = remember { Position(0, 0) } PositionChanger( position=p, onXChange={ p.x = it } onYChange={ p.y = it } ) }( I409e8 , b/152050010 , b/146362815 , b/146342522 , b/143413369 , b/135715219 , b/143263925 , b/139653744 )
Changes the code generation strategy of Compose's compiler. Prior to the change, the compose compiler would transform calls to composable functions. With this change, we now transform the body of a composable function and leave the callsite unaltered (mostly).
This means that most of the logic communicating with the compose runtime happens at the start of the function body, instead of at the callsite.
This should be a source-compatible change for all usage of compose. Most users of compose should not have to update any code as a result of this change.
In order to support this work, the JVM signature of all composable functions has changed. A Composable function accepting a single parameter is transformed into a function accepting 3 parameters, the additional parameters are the Composer, a 'key' integer. a bitmask integer used to propagate metadata through calls.
Compose now also transforms default arguments to a composable function. It does this without introducing an additional synthetic default overload of the function itself, so this change will result in fewer functions being defined.
Known intentional behavioral changes resulting from this:
- Some calls will skip where they wouldn't have previously
- Composable expressions in default argument expressions are now correctly subscribed to and handled
This work included some optimizations: 1. The result of comparisons of parameters are propagated through the call graph to other composable functions. This will result in fewer comparisons at runtime, reduces the slot table size, as well as more skipping of composable functions that were previously not skipped 2. Paremeters which are determined to be “static” at compile time are no longer compared or stored in the runtime. This reduces the number of comparisons and reduces slot table size. 3. Control flow structure of the body of functions is used to minimize the number of groups that are generated. This reduces slot table size and results in less work for the runtime 4. Unused dispatch and receiver parameters to functions are not included in determining skippability of the function if they are not used inside of the body of the function.
Most breaking changes were for APIs that the compiler targets directly, and typical use of compose will not be affected: 1. Composer::startExpr was removed 2. Composer::endExpr was removed 3. Composer::call was deprecated 4. The non-varargs overloads of
keyhave been removed. Use thevarargversion going forward. 5. The Pivotal annotation was deprecated. Usekeyas a replacement. 6. ScopeUpdateScope::updateScope was changed to expect a Function3 instead of Function1 7. restartableFunction and restartableFunctionN were updated to include additional compile time parameters ( I60756 , b/143464846 )Added sortWith and removeRange to MutableVector ( Icccf7 )
Added default method implementations for CompositionLifecycleObserver ( I24289 )
Applier now requires a clear() method for disposing compositions ( Ibe697 )
Added asMutableList() to MutableVector to allow it to be passed to public API without having to copy the entire list. ( I298df )
Added rememberCoroutineScope() to obtain a managed CoroutineScope in composition for launching jobs in response to events. ( I0e264 )
MutableVector is a new collection that does not implement any of the standard Collection interface. This collection offers speed above other requirements and is intended to only be used in internal implementations. ( I8ebd6 )
Temporarily removed
StableMutableListandStableMutableMapto avoid an issue in the version of Kotlin compose requires. These interfaces will be reintroduced once compose is updated to a version of Kotlin that doesn't have the issue.SnapshotStateListandSnapshotStateMapare now public but they will be deprecated onceStableMutableListandStableMutableMapare restored. ( Ia7769 )add top-level withFrameNanos function for animation timing ( Ie34c5 )
@Untracked annotation has been deprecated. Replace with @ComposableContract(tracked=false) ( Id211e )
RestartableFunction and associated APIs have been renamed to ComposableLambda, etc. These APIs were targeted only by the compiler so this should not affect source level compatibility normally. The rename was done primarily to communicate what this class is better when it shows up in stack traces ( I7eb25 )
@Composable annotation is no longer valid on classes ( Ia5f02 )
Ambient<T>is now @Stable instead of @Immutable ( I0b4bb )Prior to this change, the compose compiler plugin would non-trivially intercept calls to constructors inside of a @Composable function if there was an ( I5205a , b/158123804 )
The Recompose composable is no longer a useful abstraction. Most recomposition should happen as a result of MutableState assignments. For anything beyond that, it is recommended that you use the
invalidatefunction to trigger a recomposition of the current scope. ( Ifc992 )Observe is no longer a useful abstraction. If you need to replicate it, its implementation can be replicated by just creating a composable function which executes a composable lambda parameter. For example,
@Composable fun Observe(body: @Composable () -> Unit) = body()( I40d37 )@Direct was deprecated in favor of @ComposableContract(restartable=false) ( If4708 )
Added an adapter for the recently introduced StateFlow which allows as to pre-populate the initial value so the returned State is non-nullable ( I61dd8 , b/156233789 )
Added an adapter for Flow. Example of the usage: val value by flow.collectAsState() ( If2198 , b/153375923 )
[Mutable]State property delegate operators moved to extensions to support Kotlin 1.4 property delegate optimizations. Callers must add imports to continue using
by state { ... }orby mutableStateOf(...). ( I5312c )androidx.compose.ViewComposer has been moved to androidx.ui.node.UiComposer androidx.compose.Emittable has been removed. It was redundant with ComponentNode. androidx.compose.ViewAdapters has been removed. They are no longer a supported use case. Compose.composeInto has been deprecated. Use
setContentorsetViewContentinstead. Compose.disposeComposition has been deprecated. Use thedisposemethod on theCompositionreturned bysetContentinstead. androidx.compose.Compose.subcomposeInto has moved to androidx.ui.core.subcomposeInto ComponentNode#emitInsertAt has been renamed to ComponentNode#insertAt ComponentNode#emitRemoveAt has been renamed to ComponentNode#removeAt ComponentNode#emitMode has been renamed to ComponentNode#move ( Idef00 )Updated the
ComposeFlags.COMPOSER_PARAMflag to betrue, which will change the code generation strategy for the compose plugin. At a high level, this causes @Composable functions to be generated with an additional synthetic parameter, which is passed through to subsequent @Composable calls in order for the runtime to properly manage execution. This is a significant binary breaking change, however, should preserve source-level compatibility in all sanctioned usage of compose. ( I7971c )Breaking changes to the ambients API. See log and
Ambient<T>documentation for details ( I4c7ee , b/143769776 )Added ui-livedata - new artifact with an adapter for LiveData. Example of the usage: val value by liveData.observeAsState() ( Ie9e8c , b/150465596 )
Rx adapters without explicit initial value are deprecated. Using null is not always the best default, for example when you have a List it is better to start with emptyList() or any other reasonable default ( I00025 , b/161348384 )
Added ui-rxjava2 - new artifact with adapters for RxJava2. Example of the usage: val value by observable.subscribeAsState() ( Ifab4b , b/153369097 )
savedInstanceState()can now be used with nullable types ( I6847f , b/153532190 )New listSaver() and mapSaver() to make it easier to write custom Saver objects ( I8cf68 , b/152331508 )
New functions: savedInstanceState() and rememberSavedInstanceState(). They are similar to state() and remember() but have a saved instance state support build in ( If1987 , b/152025209 )
Bug Fixes
-
runOnIdleComposerenamed torunOnIdle( I83607 ) - Made LayoutNode experimental API ( I4f2e9 )
- androidx.ui.foundation.TextFieldValue and androidx.ui.input.EditorValue is deprecated. TextField, FilledTextField and CoreTextField composables that uses that type is also deprecated. Please use androidx.ui.input.TextFieldValue instead ( I4066d , b/155211005 )
- Removed deprecated DrawBackground API in favor of drawBackground extension APIs on Modifier. Refactored color, brush and paint drawBackground implementations to reduce code paths as well as remove requirement for Modifier to be created as part of composition. ( I0343a )
- Updated higher level compose APIs that expose a Canvas to expose CanvasScope instead. This removes the need for consumers to maintain their own Paint objects. For consumers that still require access to a Canvas they can use the drawCanvas extension method which provides a callback to issue drawing commands with the underlying Canvas. ( I80afd )
- WithConstraints trailing lambda API has been changed. Now instead of two params it has a receiver scope which in addition to constraints and layoutDirection provides minWidth, maxWidth, minHeight and maxHeight properties in Dp ( I91b9a , b/149979702 )
- Added symmetric padding modifier. ( I39840 )
- Updated wrapContentWidth and wrapContentHeight to expect vertical or horizontal Alignment rather than any Alignment. The gravity modifier was updated to accept vertical or horizontal Alignment. Row, Column and Stack were updated to support custom continuous Alignments. ( Ib0728 )
- ui-text module is renamed as ui-text-core ( I57dec )
- Improve DrawModifier API:
- Made the receiver scope for draw() ContentDrawScope
- Removed all parameters on draw()
- DrawScope has same interface as former CanvasScope
- ContentDrawScope has drawContent() method ( Ibaced , b/152919067 )
- ColoredRect has been deprecated. Use
Box(Modifier.preferredSize(width, height).drawBackground(color))instead. ( I499fa , b/152753731 ) - Replaced Modifier plus operator with factory extension functions ( I225e4 )
- RowScope and ColumnScope members are now accessible outside Row and Column. ( I3a641 )
- Renamed LayoutFlexible to LayoutWeight. Renamed tight parameter to fill. ( If4738 )
- WithConstraints got LayoutDirection parameter ( I6d6f7 )
- Renamed background to DrawBackground and make it to be memorized by default ( Ia0bd3 )
- Replaced ButtonStyle with distinct functions and removed text (string) overload. See updated samples for usage information. ( If63ab , b/146478620 , b/146482131 )
-
runOnIdleComposeandrunOnUiThreadare now global functions instead of methods on ComposeTestRule. ( Icbe8f )
External Contribution
- Remove unneeded API such as Looper and Handler from Compose Runtime porting layer ( I6847d )
- Deprecate
Flow<T>.collectAsState()with no initial value. UseStateFlow<T>or pass an explicit initial value instead. ( I63f98 , b/157674865 )