René's URL Explorer Experiment


Title: Documentation - Creating a 'secure' package. · Issue #24580 · angular/angular · GitHub

Open Graph Title: Documentation - Creating a 'secure' package. · Issue #24580 · angular/angular

X Title: Documentation - Creating a 'secure' package. · Issue #24580 · angular/angular

Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [X] Documentation issue or request [ ] Support request => Please do not submi...

Open Graph Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [X] Documentation issue or request [ ...

X Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [X] Documentation issue or reques...

Opengraph URL: https://github.com/angular/angular/issues/24580

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Documentation - Creating a 'secure' package.","articleBody":"\u003c!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\n\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n\r\n## I'm submitting a...\r\n\u003c!-- Check one of the following options with \"x\" -->\r\n\u003cpre>\u003ccode>\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[ ] Bug report  \u003c!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Performance issue\r\n[ ] Feature request\r\n[X] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n[ ] Other... Please describe:\r\n\u003c/code>\u003c/pre>\r\n\r\n## Current behavior\r\n\u003c!-- Describe how the issue manifests. -->\r\nNot an issue - sharing a process.\r\n\r\n## Expected behavior\r\n\u003c!-- Describe what the desired behavior would be. -->\r\n\r\n\r\n## Minimal reproduction of the problem with instructions\r\n\u003c!--\r\nFor bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via\r\nhttps://stackblitz.com or similar (you can use this template as a starting point: https://stackblitz.com/fork/angular-gitter).\r\n-->\r\n\r\n## What is the motivation / use case for changing the behavior?\r\n\u003c!-- Describe the motivation or the concrete use case. -->\r\n@alxhub asked me to pop by and share.\r\n\r\n## Environment\r\n\r\n\u003cpre>\u003ccode>\r\nAngular version: 6.0.8\r\n\u003c!-- Check whether this is still an issue in the most recent Angular version -->\r\n\r\nBrowser:\r\n- [ ] Chrome (desktop) version XX\r\n- [ ] Chrome (Android) version XX\r\n- [ ] Chrome (iOS) version XX\r\n- [ ] Firefox version XX\r\n- [ ] Safari (desktop) version XX\r\n- [ ] Safari (iOS) version XX\r\n- [ ] IE version XX\r\n- [ ] Edge version XX\r\n \r\nFor Tooling issues:\r\n- Node version: 8.11.3  \u003c!-- run `node --version` -->\r\n- Platform:  Windows 10 Pro\r\n\r\nOthers:\r\n\u003c!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->\r\n\u003c/code>\u003c/pre>\r\n\r\n# Creating a 'Secure' Angular Library Package\r\n\r\n## Background/Motivations\r\n\r\nI am an an enterprise architect who currently calls the arena of Fintech home.  Years ago, we set out to modernize our main client facing systems and their supporting APIs.  For the front end, we set our targets and AngularJS and didn't look back.  Our challenge wasn't a small one - coming from a .Net and Java heavy world in terms of our existing code bases, part of our systems included a 3rd party ecosystem which allowed partner developers to extend our base functionality.  Not only could partner developers extend the system's core functionality, but they could also package up their extensions in a manner compatible with our systems so that they could be resold to other organizations who also benefited from this new functionality.\r\n\r\nThe initial release of our revamped, albiet feature-limited system, was very well recieved - and almost immediately the ecosystem began to grown around it at a pace nearly exceeding our ability to continue to build out our initial system... A good problem to have - and so we continued to iterate and release.  \r\n\r\nAs anyone who works in \"Enterprise Development\" knows, IP is an important point of focus - companies often require first and foremost that trade industries be protected, and that key implementation details be locked away under lock and key.  Of course due to the core realities of JavaScript, this posed us an interesting challenege - in that you're highly limited in the ways that you can protect your propritary logic without breaking things.  But ultimately we persisted and prevailed - obfuscation and minification got us past our requirements so that we could forge ahead with our new stack based on 'web technologies'.  \r\n\r\nFor our system, which was based on AngularJS 1.5, we found the decorator pattern to suit us quite nicely when faced with the requirements of 'code protection'.  Using the decorator pattern, we were able to provide developer guidance documents which served to expose extenibility points via documentation.  While less than perfect, it worked pretty well for us and our clients - particularly when you consider the reality of JavaScript development, where API documentation was king, vs TypeScript development, where Typings are king (and more or less a requirement).\r\n\r\nFast foward a year+ and several iterations later, we found ourselves with a functional codebase now ported to Angular 4.  Angular 4 provided us some new and interesting challenges - namely that the ballgame, and its associated rules which we had build our system around had changed.  While we had completely redesigned our extensibility approach, which is outside of the scope of this document, we were faced with the very real problem of the 3rd party developer flow, which had seemingly degraded from Angular 1.x to 4.x under our design..  While I can't go too far into the details, a lot of the 3rd party work had to be done out of band - integration testing with the core platform required round trips to the build server under our design just to get a working environment to test your enhancements (which may have been broken due to an errant keystroke that had gone unnoticed before pushing for the build - so you had to do it all over again).  \r\n\r\nAs a stop-gap, we devised a new approach; though also far from optimal.  As we should have, we shifted the burden from the 3rd party developers back to ourselves.  How we accomplished this initially was via 2 different Angular npm packages of our core functionality.  While we tried time and time again, we could never get \"one library to rule them all\".  What we could come up with was a system backed by 2 different builds of our core library. 1) The developer pacakge, which was capable of JIT with typing support, but only contained minified/obfuscated transpiled JavaScript housing the implementation details. 2) The build package, which supported AOT production builds, but contained unobfuscated logic and so could only be distributed to partnered builders with whom we had a legal agreement with concerning our IP.\r\n\r\nThis approach 'worked', but was never quite favored - it felt hacky and was difficult to maintain multiple builds... \r\n\r\nNeedless to say, we had to find a better way.\r\n\r\n## A Better Way\r\n\r\nEnter Angular 6 - with it's fancy first class support of library generation.  Not quite knowing what we were getting into, a port of our 4.x to 6.x was undertaken - and went surprisingly well.  From here we worked to break out all of our implementation which was intended to be 'protected' in to Angular Libraries (with the help of the Angular CLI and ng-packagr).  Once our cleanup efforts were complete, we had a handful of Angular 6 feature libraries and what is essentially a shell application to tie them together.\r\n\r\nWhile I am still struggling to grok the hows and whys that this works, it seemingly just does for now.  In Angular 4 Land, we could never quite get our obfuscated/minified package to work for AOT Prod builds, though it worked perfectly fine for JIT builds; hence our need for 2 pacakges.  But I am happy to report that the rules are apparently different in Angular 6 Land - as we are now able to create this 'one package to rule them all' in a relatively straight forward manner.\r\n\r\nDuring some of the exploratory phase, I'd spoken on gitter with Alex Rickabaugh (@alxhub) about what we were trying to accomplish.  While our interactions were small in regards to our Angular 4 efforts, I popped back in to update Alex on the success we'd found with Angular 6 - at which time he requested that I do a quick writeup in the case that it might assist others....\r\n\r\n...so here we are...\r\n\r\n## Here be dragons...\r\n\r\nAs previously mentioned, the steps are currently pretty straight forward. For the following overview, let's assume we arrived here from \"ng g library awesomesauce\".\r\n- \"ng build awesomesauce --prod\"\r\n- Navigate to /dist/awesomesauce/\r\n- Delete the esm5, esm2015, esm5, and fesm2015 folders.\r\n- Navigate to /dist/bundles/ and delete the non *.min.* resources and the map associated with your minified bundle.\r\n- Back in /dist/awesomesauce/, open up package.json and make the following edits:\r\n\t- update 'main' to reference the *.min.js bundle in /bundles/\r\n\t- Delete 'module', 'es2015', 'esm5', 'esm2015', 'fesm5' and 'fesm2015' key/value pairs\r\n- \"ng pack\"\r\n\r\nYou are now the proud parent of a 'secured' Angular 6 library packaged for installation via NPM into an Angular 6 application - your bouncing new Angular library provides developer typing support for your public APIs, and which more importantly only contains minified/obfuscated implementation logic.  Of course this isn't 100% secure - you still have a considerable amount of information which is exposed in your *.d.ts typing files, and there's still quite a bit that can be inferred in combination with your included metadata file (which is required for this all to work as described)... This said, I do believe that there's little/nothing more exposed by this package than has always been the case with JavaScript libraries that provide typing support.\r\n\r\nNote: Again, here be dragons. I am not a web security expert. The process described here may or may not stand up to rigorous scrutiny. We're in the process of vetting this and working to clear the security requirements imposed upon us - but so far this appears to be fitting the bill for us, so perhaps it will for you too.\r\n","author":{"url":"https://github.com/mattezell","@type":"Person","name":"mattezell"},"datePublished":"2018-06-19T21:55:13Z","url":"https://github.com/angular/angular/issues/24580"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:61719c92-c898-6078-5466-54a6b4911d83
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9F90:31B4CC:184F66C:1FF414C:6B013792
html-safe-nonceb92cab443c67483e73e593fcb83b34ed9ec2ade01f24feae1cc68301aa11d36c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjkwOjMxQjRDQzoxODRGNjZDOjFGRjQxNEM6NkIwMTM3OTIiLCJ2aXNpdG9yX2lkIjoiOTA5OTE4Njk0NjIzMTU4MDU2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2905b101f5bdd2538ba7d2f9cf9b1d6d5b70d40640bfeed8f3feb5ce0b5b5e6c
hovercard-subject-tagissue:333853258
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/angular/angular/24580/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5d7bdb744a4c74a554193733227c70570de46143ebcbdffa64ea4edc65b523e8/angular/angular/issues/24580
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5d7bdb744a4c74a554193733227c70570de46143ebcbdffa64ea4edc65b523e8/angular/angular/issues/24580
og:image:altI'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [X] Documentation issue or request [ ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemattezell
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/24580#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F24580
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F24580
Sign uphttps://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=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/24580
Reloadhttps://github.com/angular/angular/issues/24580
Reloadhttps://github.com/angular/angular/issues/24580
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/24580
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/24580
Documentation - Creating a 'secure' package.https://github.com/angular/angular/issues/24580#top
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
state: needs eng inputhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20needs%20eng%20input%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/mattezell
mattezellhttps://github.com/mattezell
on Jun 19, 2018https://github.com/angular/angular/issues/24580#issue-333853258
@alxhubhttps://github.com/alxhub
@alxhubhttps://github.com/alxhub
https://github.com/mattezell
mattezellhttps://github.com/mattezell
on Jun 19, 2018https://github.com/angular/angular/issues/24580#issuecomment-398563304
jasonadenhttps://github.com/jasonaden
comp: docshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22comp%3A%20docs%22
on Jun 21, 2018https://github.com/angular/angular/issues/24580#event-1694835751
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Jun 21, 2018https://github.com/angular/angular/issues/24580#event-1694836019
https://github.com/jasonaden
jasonadenhttps://github.com/jasonaden
on Jun 21, 2018https://github.com/angular/angular/issues/24580#issuecomment-399269392
https://github.com/mattezell
mattezellhttps://github.com/mattezell
on Jun 25, 2018https://github.com/angular/angular/issues/24580#issuecomment-400019903
@jasonadenhttps://github.com/jasonaden
angular/angular-cli#11317https://github.com/angular/angular-cli/issues/11317
jenniferfellhttps://github.com/jenniferfell
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
on Jun 26, 2018https://github.com/angular/angular/issues/24580#event-1702308145
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
Backloghttps://github.com/angular/angular/milestone/82
on Jun 26, 2018https://github.com/angular/angular/issues/24580#event-1702308233
jenniferfellhttps://github.com/jenniferfell
state: needs eng inputhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20needs%20eng%20input%22
on Jun 26, 2018https://github.com/angular/angular/issues/24580#event-1702308393
https://github.com/jenniferfell
jenniferfellhttps://github.com/jenniferfell
on Jun 26, 2018https://github.com/angular/angular/issues/24580#issuecomment-400437548
@hanslhttps://github.com/hansl
@Broccohttps://github.com/Brocco
https://github.com/mattezell
mattezellhttps://github.com/mattezell
on Jun 27, 2018https://github.com/angular/angular/issues/24580#issuecomment-400825247
https://github.com/mattezell/SecureAngularLibraryhttps://github.com/mattezell/SecureAngularLibrary
https://github.com/wbhob
wbhobhttps://github.com/wbhob
on Jul 6, 2018https://github.com/angular/angular/issues/24580#issuecomment-402920863
https://github.com/josephperrott
josephperrotthttps://github.com/josephperrott
on May 25, 2021https://github.com/angular/angular/issues/24580#issuecomment-848257560
josephperrotthttps://github.com/josephperrott
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 25, 2021https://github.com/angular/angular/issues/24580#event-4795197314
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Jun 25, 2021https://github.com/angular/angular/issues/24580#issuecomment-868671604
automatic conversation locking policyhttps://github.com/angular/angular/blob/8f24bc9443b3872fe095d9f7f77b308a361a13b4/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Jun 25, 2021https://github.com/angular/angular/issues/24580#event-4940862066
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/24580
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/24580
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
state: needs eng inputhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20needs%20eng%20input%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
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.