Many updates for v2, see PR description #102
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linting
I tinkered with ESLint config to only apply TS linting to TS files, avoiding false positives for JS files
File generation
I moved the boot file to be generated into actual
boot
folder.I guess you put it into the "apollo" folder to automatically register it via the AE index file, but you can do so only if you have full control over the file, eg. if you don't expose it.
If you do expose it, it may need to be applied in a different order depending on what the dev does into it.
Otherwise you're just going against the boot files pattern and adding mental burden for the user to the process.
I also removed
extension
containing folder as we never used this convention on other official AEs AFAIK, what's the rationale behind it?I also set the typescript prompts to false by default, as only 25% of Quasar userbase uses TS right now. We can change this depending on next years community surveys.
Typings
I fixed some typings here and there, eg. you don't need
BootFileParams
if you useboot
wrapper.Old
extensions/apollo/index.d.ts
isn't needed anymore, as forcing TS to bring inquasar
typings intotsconfig.json
automatically imports all needed types.I had to disable lib check due to chain-webpack types conflicting with webpack5 ones. It's strange as we don't get this problem on generated projects, honestly couldn't understand which is the problem and why it happens there.
Deps
I updated all deps to latest version.
I removed "react" dep as importing stuff from '@apollo/client/core' instead of '@apollo/client' removes the need for it.
I removed "typescript" dep as '@quasar/app' already provides it.
Repo mangement
I added
yarn format
to apply Prettier formatting everywhere.I added
yarn build
to automatically clean the lib folder, generate the updated JS files versions and format them with Prettier. In this way we lose the newlines in generated JS files (until TS guys figure out a way to allow it) but a lot of repo management time and mental burden is removed.I added
yarn deploy
scripts to automatize the publishing process, in particular to avoid forgetting to generate JS files and using the wrong npm tag.Installation steps
I used
app.provide
into the boot file, this avoids the need to updateApp.vue
(which was needed when using Vue2 as there wasn't a global provide API).Left out / WIP
I also want to add tooling support for https://www.apollographql.com/docs/devtools/apollo-config/ and automatically scaffold an example one, as well as injecting
apollographql.vscode-apollo
into vscode suggested extensions files if presentSubscriptions via WebSocket need a particular setup, it could be asked at installation time or a guide could be integrated into the README
Let me know what do you think of the changes