René's URL Explorer Experiment


Title: Add dynamic Widget/Component creation · Issue #389 · NativeScript/NativeScript · GitHub

Open Graph Title: Add dynamic Widget/Component creation · Issue #389 · NativeScript/NativeScript

X Title: Add dynamic Widget/Component creation · Issue #389 · NativeScript/NativeScript

Description: What’s the problem? The current UI definition paradigm requires us to know exactly which UI elements are needed before a Page creation. This is often _not_ the case for larger apps. Although data binding handles dynamic UI updating nicel...

Open Graph Description: What’s the problem? The current UI definition paradigm requires us to know exactly which UI elements are needed before a Page creation. This is often _not_ the case for larger apps. Although data b...

X Description: What’s the problem? The current UI definition paradigm requires us to know exactly which UI elements are needed before a Page creation. This is often _not_ the case for larger apps. Although data b...

Opengraph URL: https://github.com/NativeScript/NativeScript/issues/389

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add dynamic Widget/Component creation","articleBody":"### What’s the problem?\n\nThe current UI definition paradigm requires us to know exactly which UI elements are needed before a `Page` creation. This is often **_not**_ the case for larger apps. Although data binding handles dynamic UI updating nicely for tabular data and other small items, it is not the right solution for large dynamically generated UI compositions.\n### What do we have now?\n\nThe existing capabilities of {N} **_do**_ allow for us to specify isolated groupings of UI components (_or widgets_) referenced into the XML of the parent `Page`.\n\n```\n// Define our Widget in file \"xml-declaration/widget1\".\n\u003cStackLayout id=\"stackLayout\" \u003e\n    \u003cLabel id=\"label1\" text=\"Label1\" /\u003e\n    \u003cButton id=\"button1\" text=\"Button1\" /\u003e \n\u003c/StackLayout\u003e\n```\n\n```\n// Embed our custom Widget into our Page.\n\u003cPage xmlns:widgets=\"xml-declaration/widget1\"\u003e\n     \u003cwidgets:Widget1 /\u003e\n\u003c/Page\u003e\n```\n### What do we need?\n\nWe need a dynamic widget builder, providing full control over **_when**_ a custom widget gets created.\n\nIdeally we’d expect its usage and API to be simple, perhaps something like:\n_(using the widget XML declared above)_\n\n```\nvar widget1 = viewBuilder.build({ name: ‘xml-declaration/widget1’ });\nsomeView.addChild(widget1);\n```\n\nCurrently we **_do**_ have the ability to dynamically create `Page` views/controllers from an XML file.\nThis is done via the `Frame` class using the static method `resolvePageFromEntry()`:\n\n```\nvar widget1 = frameCommon.resolvePageFromEntry({ moduleName: 'xml-declaration/widget1' });\nsomeView.addChild(widget1);\n```\n\nwhere the XML would be declared something like:\n\n```\n\u003cPage xmlns=\"http://www.nativescript.org/tns.xsd\" loaded=\"pageLoaded\" \u003e\n    \u003cStackLayout id=\"stackLayout\" \u003e\n        \u003cLabel id=\"label1\" text=\"Label1\" /\u003e\n        \u003cButton id=\"button1\" text=\"Button1\" /\u003e \n    \u003c/StackLayout\u003e\n\u003c/Page\u003e\n```\n\nNote that the widget must be wrapped in a `Page` element or this will **_not work**_!\nBut making every widget a `Page` would incur excessive overhead, and quite frankly you could create some nonsensical compositions, like a `Page` with a `StackedLayout` parent.\n\nThis is not the right solution.\n### Technical considerations\n\nThe main _benefit_ of having a `Page` as our root in a widget is contains the internal method `addCssFile()` which applies styling during the `resolvePageFromEntry()` call, where the css file name is dynamically determined from the target module name.\n\nThe main _drawback_ of having a `Page` root is that it knows about app Navigation, which a small widget absolutely should **_not**_. This abstraction is wrong for our widgets.\n\nCurrently the visible UI elements have different direct parent classes: `TextBase`, `Layout`, `ContentView`, and `View`. So introducing a generic builder which handles the automatic styling (like the `Page` does now) would mean they would all have to have a common base having the `addCssFile()` styling capability. Perhaps this could be retrofitted up into the shared-common base class `View`? Or perhaps some other class abstraction in between would be more correct.\n\nThen using the same builder call proposed before, we would be handed the correct (and stylized) widget, regardless of the outer container type specified in the XML:\n\n```\nvar widget1 = viewBuilder.build({ name: ‘xml-declaration/widget1’ });\nsomeView.addChild(widget1);\n```\n","author":{"url":"https://github.com/patrickseda","@type":"Person","name":"patrickseda"},"datePublished":"2015-07-03T21:46:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/389/NativeScript/issues/389"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:6a41771b-ad84-6298-fe45-7b4429c7747d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA492:28C0E5:4E48822:67521E2:6A5DA3E8
html-safe-noncea1c2e9804bae123af6a7dc512145b14da6aadd51a7f8e7b84368d00e9aa231df
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDkyOjI4QzBFNTo0RTQ4ODIyOjY3NTIxRTI6NkE1REEzRTgiLCJ2aXNpdG9yX2lkIjoiNzYwNDUyMjgwNTIwMTA1MjY0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3733f4a4d870764332bcf5de314eb21eaa8a89b98adbb4a8bd94eb426aa45e30
hovercard-subject-tagissue:92940841
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/NativeScript/389/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fd78dc4803e1868a94c4fbb673098dd1ace76415c9c1eca5e7c66adadc6b9ec1/NativeScript/NativeScript/issues/389
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fd78dc4803e1868a94c4fbb673098dd1ace76415c9c1eca5e7c66adadc6b9ec1/NativeScript/NativeScript/issues/389
og:image:altWhat’s the problem? The current UI definition paradigm requires us to know exactly which UI elements are needed before a Page creation. This is often _not_ the case for larger apps. Although data b...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepatrickseda
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id31492490
octolytics-dimension-repository_nwoNativeScript/NativeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31492490
octolytics-dimension-repository_network_root_nwoNativeScript/NativeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/NativeScript/issues/389#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fissues%2F389
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fissues%2F389
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NativeScript%2FNativeScript
Reloadhttps://github.com/NativeScript/NativeScript/issues/389
Reloadhttps://github.com/NativeScript/NativeScript/issues/389
Reloadhttps://github.com/NativeScript/NativeScript/issues/389
Please reload this pagehttps://github.com/NativeScript/NativeScript/issues/389
NativeScript https://github.com/NativeScript
NativeScripthttps://github.com/NativeScript/NativeScript
Please reload this pagehttps://github.com/NativeScript/NativeScript/issues/389
Notifications https://github.com/login?return_to=%2FNativeScript%2FNativeScript
Fork 1.7k https://github.com/login?return_to=%2FNativeScript%2FNativeScript
Star 25.6k https://github.com/login?return_to=%2FNativeScript%2FNativeScript
Code https://github.com/NativeScript/NativeScript
Issues 771 https://github.com/NativeScript/NativeScript/issues
Pull requests 66 https://github.com/NativeScript/NativeScript/pulls
Discussions https://github.com/NativeScript/NativeScript/discussions
Actions https://github.com/NativeScript/NativeScript/actions
Projects https://github.com/NativeScript/NativeScript/projects
Wiki https://github.com/NativeScript/NativeScript/wiki
Security and quality 0 https://github.com/NativeScript/NativeScript/security
Insights https://github.com/NativeScript/NativeScript/pulse
Code https://github.com/NativeScript/NativeScript
Issues https://github.com/NativeScript/NativeScript/issues
Pull requests https://github.com/NativeScript/NativeScript/pulls
Discussions https://github.com/NativeScript/NativeScript/discussions
Actions https://github.com/NativeScript/NativeScript/actions
Projects https://github.com/NativeScript/NativeScript/projects
Wiki https://github.com/NativeScript/NativeScript/wiki
Security and quality https://github.com/NativeScript/NativeScript/security
Insights https://github.com/NativeScript/NativeScript/pulse
Add dynamic Widget/Component creationhttps://github.com/NativeScript/NativeScript/issues/389#top
https://github.com/enchev
donehttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22done%22
1.2.0https://github.com/NativeScript/NativeScript/milestone/5
https://github.com/patrickseda
patricksedahttps://github.com/patrickseda
on Jul 3, 2015https://github.com/NativeScript/NativeScript/issues/389#issue-92940841
enchevhttps://github.com/enchev
donehttps://github.com/NativeScript/NativeScript/issues?q=state%3Aopen%20label%3A%22done%22
1.2.0https://github.com/NativeScript/NativeScript/milestone/5
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.