DreaMinder / nuxt-payload-extractor

Nuxt.js module that makes `nuxt generate` command to store html and payload separately.
MIT License
145 stars 18 forks source link

Tests #1

Open manniL opened 5 years ago

manniL commented 5 years ago

Hey :wave:

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

DreaMinder commented 5 years ago

@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!

manniL commented 5 years ago

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

atinux commented 5 years ago

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 :)

DreaMinder commented 5 years ago

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

atinux commented 5 years ago

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

DreaMinder commented 5 years ago

@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

robertpiosik commented 5 years ago

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?

DreaMinder commented 5 years ago

@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).

edimitchel commented 5 years ago

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 !

DreaMinder commented 5 years ago

@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.

edimitchel commented 5 years ago

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