René's URL Explorer Experiment


Title: Proposal: Lualib override plugins · Issue #973 · TypeScriptToLua/TypeScriptToLua · GitHub

Open Graph Title: Proposal: Lualib override plugins · Issue #973 · TypeScriptToLua/TypeScriptToLua

X Title: Proposal: Lualib override plugins · Issue #973 · TypeScriptToLua/TypeScriptToLua

Description: In the last 2 weeks we received two requests for the ability to modify lualib output with plugins. One for supplying an environment-specific implementation of __TS__New, and another for a specialized ArrayForEach implementation for an en...

Open Graph Description: In the last 2 weeks we received two requests for the ability to modify lualib output with plugins. One for supplying an environment-specific implementation of __TS__New, and another for a specializ...

X Description: In the last 2 weeks we received two requests for the ability to modify lualib output with plugins. One for supplying an environment-specific implementation of __TS__New, and another for a specializ...

Opengraph URL: https://github.com/TypeScriptToLua/TypeScriptToLua/issues/973

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: Lualib override plugins","articleBody":"In the last 2 weeks we received two requests for the ability to modify lualib output with plugins. One for supplying an environment-specific implementation of __TS__New, and another for a specialized ArrayForEach implementation for an environment's special tables.\r\n\r\nOther use cases for overriding lualib functions might be using computation/memory/garbage optimized versions of lualib functions.\r\n\r\nI think this is a 'quick win' as it seems relatively simple to implement this as follows:\r\n\r\nAdd a record to the plugin interface that allows supplying a string for a lualib feature:\r\n\r\n```diff\r\nexport interface Plugin {\r\n    /**\r\n     * An augmentation to the map of visitors that transform TypeScript AST to Lua AST.\r\n     *\r\n     * Key is a `SyntaxKind` of a processed node.\r\n     */\r\n    visitors?: Visitors;\r\n\r\n    /**\r\n     * A function that converts Lua AST to a string.\r\n     *\r\n     * At most one custom printer can be provided across all plugins.\r\n     */\r\n    printer?: Printer;\r\n+\r\n+    /**\r\n+     * Provide a custom string that will be emitted as implementation for a lualib feature.\r\n+     */\r\n+    lualib?: Partial\u003cRecord\u003cLuaLibFeature, string\u003e\u003e\r\n}\r\n```\r\n\r\nThen a plugin could look like this:\r\n```ts\r\nconst plugin = {\r\n    lualib: {\r\n        [LuaLibFeature.Delete]: `\r\n            function __TS__Delete(target, key)\r\n                target[key] = nil\r\n            end\r\n        `\r\n    }\r\n}\r\n```\r\n\r\nOr even:\r\n```ts\r\nconst plugin = {\r\n    lualib: {\r\n        ...garbageCollectorOptimizedLualibCollectionFromNpmPackage,\r\n        ...lualibFunctionsForEnvironment\r\n    }\r\n}\r\n```\r\n\r\nWe then pass these plugins to the printer and override the lualib methods it wants to emit.\r\n\r\nWhat I'm not sure about yet is if these should be supplied as Lua string or something else (TS/Lua AST/TS AST). Also leaving in the function header like I did in the example could potentially lead to typos and other issues, although we should easily be able to put in a diagnostic for that.\r\n","author":{"url":"https://github.com/Perryvw","@type":"Person","name":"Perryvw"},"datePublished":"2021-01-29T20:03:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/973/TypeScriptToLua/issues/973"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:874b596c-b319-887d-acac-d2d1438bf0c9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEAB4:3476BC:F28D9A:152A0A5:6970C533
html-safe-nonce23fb965ba73786f203f962645332c5c182eb77feac5db5c4f7f97ef1c2d435f6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUI0OjM0NzZCQzpGMjhEOUE6MTUyQTBBNTo2OTcwQzUzMyIsInZpc2l0b3JfaWQiOiIyNjM4MjczMTAwNDc3MDg0NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac677debd1f095a73976b7fd0a9f067e1767e1b4eca4484521eec3b93750657e23
hovercard-subject-tagissue:797151484
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/TypeScriptToLua/TypeScriptToLua/973/issue_layout
twitter:imagehttps://opengraph.githubassets.com/cd25c52354533d4faca125e86fd324675c67a3a2b6e2f716cc7ccf4a7cae5e2f/TypeScriptToLua/TypeScriptToLua/issues/973
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/cd25c52354533d4faca125e86fd324675c67a3a2b6e2f716cc7ccf4a7cae5e2f/TypeScriptToLua/TypeScriptToLua/issues/973
og:image:altIn the last 2 weeks we received two requests for the ability to modify lualib output with plugins. One for supplying an environment-specific implementation of __TS__New, and another for a specializ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamePerryvw
hostnamegithub.com
expected-hostnamegithub.com
Nonebb43a7bc61aba1b91c3c5cf8e7d00342e1e77a0cfe55a141222dbd7f9782d26f
turbo-cache-controlno-preview
go-importgithub.com/TypeScriptToLua/TypeScriptToLua git https://github.com/TypeScriptToLua/TypeScriptToLua.git
octolytics-dimension-user_id44121206
octolytics-dimension-user_loginTypeScriptToLua
octolytics-dimension-repository_id115876595
octolytics-dimension-repository_nwoTypeScriptToLua/TypeScriptToLua
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id115876595
octolytics-dimension-repository_network_root_nwoTypeScriptToLua/TypeScriptToLua
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
release34817b01ad7cdf8b2beb35ea7b0e2a7609004eff
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/973#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTypeScriptToLua%2FTypeScriptToLua%2Fissues%2F973
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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/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%2FTypeScriptToLua%2FTypeScriptToLua%2Fissues%2F973
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=TypeScriptToLua%2FTypeScriptToLua
Reloadhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/973
Reloadhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/973
Reloadhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/973
TypeScriptToLua https://github.com/TypeScriptToLua
TypeScriptToLuahttps://github.com/TypeScriptToLua/TypeScriptToLua
Please reload this pagehttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/973
Notifications https://github.com/login?return_to=%2FTypeScriptToLua%2FTypeScriptToLua
Fork 180 https://github.com/login?return_to=%2FTypeScriptToLua%2FTypeScriptToLua
Star 2.4k https://github.com/login?return_to=%2FTypeScriptToLua%2FTypeScriptToLua
Code https://github.com/TypeScriptToLua/TypeScriptToLua
Issues 137 https://github.com/TypeScriptToLua/TypeScriptToLua/issues
Pull requests 7 https://github.com/TypeScriptToLua/TypeScriptToLua/pulls
Actions https://github.com/TypeScriptToLua/TypeScriptToLua/actions
Wiki https://github.com/TypeScriptToLua/TypeScriptToLua/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/TypeScriptToLua/TypeScriptToLua/security
Please reload this pagehttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/973
Insights https://github.com/TypeScriptToLua/TypeScriptToLua/pulse
Code https://github.com/TypeScriptToLua/TypeScriptToLua
Issues https://github.com/TypeScriptToLua/TypeScriptToLua/issues
Pull requests https://github.com/TypeScriptToLua/TypeScriptToLua/pulls
Actions https://github.com/TypeScriptToLua/TypeScriptToLua/actions
Wiki https://github.com/TypeScriptToLua/TypeScriptToLua/wiki
Security https://github.com/TypeScriptToLua/TypeScriptToLua/security
Insights https://github.com/TypeScriptToLua/TypeScriptToLua/pulse
New issuehttps://github.com/login?return_to=https://github.com/TypeScriptToLua/TypeScriptToLua/issues/973
New issuehttps://github.com/login?return_to=https://github.com/TypeScriptToLua/TypeScriptToLua/issues/973
Proposal: Lualib override pluginshttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/973#top
discussionOpen for discussion and ideashttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22discussion%22
enhancementhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/Perryvw
https://github.com/Perryvw
Perryvwhttps://github.com/Perryvw
on Jan 29, 2021https://github.com/TypeScriptToLua/TypeScriptToLua/issues/973#issue-797151484
discussionOpen for discussion and ideashttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22discussion%22
enhancementhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22enhancement%22
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.