nuxt-payload-extractor icon indicating copy to clipboard operation
nuxt-payload-extractor copied to clipboard

Tests

Open TheAlexLichter opened this issue 6 years ago • 11 comments

Hey :wave:

I think some tests for the package would come handy :relaxed:

TheAlexLichter avatar Jan 12 '19 19:01 TheAlexLichter

@manniL Aggree. But if nuxt will have simillar core functionality, I can't be sure that this module will be demanded. And if nobody needs it, tests are useless... Let me finish commercial projects and then I'll return to this issue. Thanks for feedback!

DreaMinder avatar Jan 12 '19 19:01 DreaMinder

@DreaMinder I agree. When (at some time) "full static mode" would be part of the core then this module would be obsolete.

TheAlexLichter avatar Jan 12 '19 19:01 TheAlexLichter

Really great job on this module @DreaMinder, I plan to test it on nuxtjs.org to start working on the native implementation for Nuxt.js :)

atinux avatar Jan 23 '19 11:01 atinux

@Atinux OMG. I'll work on it this evening, minor fixes should be done

DreaMinder avatar Jan 23 '19 11:01 DreaMinder

Awesome :) The only bug I found right now is the payload.json that is empty everytime

atinux avatar Jan 23 '19 11:01 atinux

@Atinux I've fixed payload.json issue with temporary hack, see it works here: https://github.com/DreaMinder/nuxtjs.org

For some reason data fields inside of payload is array of objects. And nuxt-documentation project has data stored in second object. When I'll figure out why, I'll probably find a better solution. UPD: got it, it is so because of nested routes

DreaMinder avatar Jan 23 '19 21:01 DreaMinder

Hi! 👋 Awesome work!

As I tested the module today, I didn't noticed any issues with empty payload.json files. Even for nested routes.

Are there still known bugs? Is the package suitable for production?

robertpiosik avatar Feb 20 '19 22:02 robertpiosik

@robertpiosik Hi! Cool, glad you like it. Yes, bug with empty payload is fixed a month ago. There may be issues if you are using vuex to fetch data, or router base to make prefix for all URLs. And as there are no tests yet, compability issues may appear with new nuxt version.

I'd use this module for production if I'd need to. But so far, the only real project I know using it is https://tobias-thiele.de/ (https://github.com/DreaMinder/nuxt-payload-extractor/issues/2).

DreaMinder avatar Feb 20 '19 22:02 DreaMinder

I'll try to add some tests ! @Atinux you confirmed Nuxt will crawl all pages for generating routes ? Will this feature (extract payload) be released with ? The payload.json file is a real data saving !

edimitchel avatar Jun 14 '19 07:06 edimitchel

@edimitchel nice, thanks! But...

Will this feature (extract payload) be released with ?

after you and me faced nested-routes bug, I don't think it is a good idea. Because in current implementation, I don't see any way to solve it. Maybe it should be moved to core, where its possible to get nesting-level of current route... Or hooks API should be modified to do so if its possible.

DreaMinder avatar Jun 14 '19 08:06 DreaMinder

I suggested this question because a comment made by @Atinux on https://github.com/nuxt/rfcs/issues/22#issuecomment-499075927

  • Use our crawler in union with generate.routes (crawler already working on https://github.com/nuxt/nuxtjs.org/blob/master/modules/crawler/index.js) and move it inside @nuxt/generator

edimitchel avatar Jun 14 '19 08:06 edimitchel