Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

[TS] API entry missing for http._createDefaultCookieXSRFStrategy #2184

Closed
chalin opened this issue Aug 24, 2016 · 11 comments
Closed

[TS] API entry missing for http._createDefaultCookieXSRFStrategy #2184

chalin opened this issue Aug 24, 2016 · 11 comments

Comments

@chalin
Copy link
Contributor

chalin commented Aug 24, 2016

Visit https://angular.io/docs/ts/latest/api/http/index/ and click on the link to _createDefaultCookieXSRFStrategy which is found towards the end of the page. Result: 404, page not found.

The relevant code excerpt from modules/@angular/http/http.ts is:

/**
 * @experimental
 */
export function _createDefaultCookieXSRFStrategy() {
  return new CookieXSRFStrategy();
}

Notice that the function is exported.

Is the page for this entry being skipped because of the leading underscore? If so, then it should not appear in the index summary.

@ericjim @petebacondarwin
cc @Foxandxss @kwalrath

This is one of the broken links reported in #2150. (There is also a similar issue with platform-browser/index/_WORKER_UI_PLATFORM_PROVIDERS-let.html, but let's see how this issue is resolved first).

@petebacondarwin
Copy link
Contributor

The document indeed is not rendered because it starts with _.
Equally the code appears to indicate that the document should not be included in the module's exports. See https://github.com/angular/dgeni-packages/blob/823d3f9e06b08f49b0a4c177da94486ec8ea9ad1/typescript/processors/readTypeScriptModules.js#L98

@petebacondarwin
Copy link
Contributor

I think the problem is here: https://github.com/angular/angular.io/blob/master/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js#L70

We either need to iterate over a different collection than doc.exports (perhaps doc.members) or we should do a similar filtering to what is in readTypeScriptModules.js

@chalin
Copy link
Contributor Author

chalin commented Aug 25, 2016

@petebacondarwin: thanks for the feedback!

@wardbell @Foxandxss: doing similar filtering in both places would seem like a reasonable solution.

@petebacondarwin
Copy link
Contributor

(but not very DRY)

@chalin
Copy link
Contributor Author

chalin commented Aug 25, 2016

Not DRY, but an ok incremental improvement IMHO. (Of course, if someone wants to invest time in creating a DRY solution that would be great too.)

@petebacondarwin
Copy link
Contributor

Ah I see that the lines I was pointing to are regarding exportDoc members not exportDocs themselves... So I am not sure why the doc is not being rendered.

@petebacondarwin
Copy link
Contributor

Ahah! It is a jade problem. The file is being generated but files that start with an underscore are ignored by harp/jade.

@chalin
Copy link
Contributor Author

chalin commented Aug 25, 2016

Ah! Of course! Thanks @petebacondarwin.

Hmm, that will be an interesting issue to solve.

@wardbell @Foxandxss: it might be best to check with the angular folks to see if the two exported entities whose names start with an underscore are actually meant to be exported (my guess is that it is not the case).

@wardbell
Copy link
Contributor

Please follow up with the Angular team. They should not be exporting public API members with leading underscore. Therefore, this appears to be a solution looking for a non-existent problem.

@chalin
Copy link
Contributor Author

chalin commented Aug 29, 2016

Well, underscores for private members is a Dart convention, I'm not sure that it is 100% enforces in Angular 2 (TS).

@IgorMinar
Copy link
Contributor

+1 to what @wardbell said

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants