|
| 1 | +# Vue Starter - Adobe Express Add-on |
| 2 | + |
| 3 | +A sample Adobe Express Add-on that demonstrates how to build an add-on using Vue.js and properly access the Adobe Express Add-on SDK. |
| 4 | + |
| 5 | +## What This App Does |
| 6 | + |
| 7 | +This starter sample demonstrates a best practice approach for integrating Vue.js with the Adobe Express Add-on SDK: |
| 8 | + |
| 9 | +1. **SDK Integration via Dependency Injection**: The app uses Vue's provide/inject pattern to make the Adobe Express SDK available throughout the component tree. |
| 10 | + |
| 11 | +2. **Asynchronous SDK Loading**: The Add-on UI SDK is loaded asynchronously and initialized before the Vue app is mounted, ensuring that the SDK is ready for use when components need it. |
| 12 | + |
| 13 | +3. **Simple Interactive UI**: A single button demonstrates reactive UI updates when clicked, displaying information about the loaded SDK. |
| 14 | + |
| 15 | +4. **Component Structure**: Follows Vue.js best practices with a clean separation of concerns between template, logic, and styling using Single-File Components. |
| 16 | + |
| 17 | +## Key Implementation Details |
| 18 | + |
| 19 | +The application implements the following pattern: |
| 20 | + |
| 21 | +1. **index.js**: Loads the SDK asynchronously using dynamic imports, makes it available via Vue's provide/inject system, and mounts the app. |
| 22 | + |
| 23 | +2. **App.vue**: Injects the SDK and uses it to display details in response to user interaction. |
| 24 | + |
| 25 | +## Overview |
| 26 | + |
| 27 | +This project showcases: |
| 28 | + |
| 29 | +- Vue.js integration with Adobe Express Add-ons |
| 30 | +- Single-file component (SFC) architecture |
| 31 | +- Proper SDK injection pattern using Vue's dependency injection |
| 32 | +- Asynchronous SDK initialization |
| 33 | +- Webpack build configuration for Vue.js |
| 34 | +- ES modules with proper import/export syntax |
| 35 | + |
| 36 | +## Technologies Used |
| 37 | + |
| 38 | +- HTML |
| 39 | +- CSS |
| 40 | +- JavaScript |
| 41 | +- Vue.js 3.x (Composition API) |
| 42 | +- Adobe Express Add-on SDK |
| 43 | +- Webpack 5 |
| 44 | +- ES Modules |
| 45 | + |
| 46 | +## Features |
| 47 | + |
| 48 | +- Reactive UI components with Vue.js |
| 49 | +- Adobe Express Add-on SDK integration via dependency injection |
| 50 | +- Button component that displays SDK information when clicked |
| 51 | +- Fully commented code for beginners to understand Vue.js concepts |
| 52 | + |
| 53 | +## Project Structure |
| 54 | + |
| 55 | +- `src/`: Source code |
| 56 | + - `App.vue`: Main Vue component with detailed comments explaining Vue concepts |
| 57 | + - `index.js`: Entry point that loads the SDK and mounts the Vue app |
| 58 | + - `index.html`: HTML template with the Vue mounting point |
| 59 | + - `manifest.json`: Add-on manifest defining the add-on properties |
| 60 | + |
| 61 | +## Getting Started |
| 62 | + |
| 63 | +### Prerequisites |
| 64 | + |
| 65 | +- Node.js 18.x or higher |
| 66 | +- npm 9.x or higher |
| 67 | +- Adobe Express account |
| 68 | + |
| 69 | +### Installation |
| 70 | + |
| 71 | +1. Clone the repository |
| 72 | +2. Install dependencies: |
| 73 | + ``` |
| 74 | + npm install |
| 75 | + ``` |
| 76 | + |
| 77 | +### Development |
| 78 | + |
| 79 | +Start the development server: |
| 80 | +``` |
| 81 | +npm run start |
| 82 | +``` |
| 83 | + |
| 84 | +This will launch a development server and open the add-on in your browser. |
| 85 | + |
| 86 | +### Building |
| 87 | + |
| 88 | +Build the add-on for production: |
| 89 | +``` |
| 90 | +npm run build |
| 91 | +``` |
| 92 | + |
| 93 | +### Packaging |
| 94 | + |
| 95 | +Create a distributable package: |
| 96 | +``` |
| 97 | +npm run package |
| 98 | +``` |
| 99 | + |
| 100 | +## Working with the Add-on |
| 101 | + |
| 102 | +1. After starting the development server, the add-on will appear in your browser |
| 103 | +2. Click the "Click me" button to see information about the Adobe Express Add-on SDK |
| 104 | +3. The button text will change to "Clicked" and the SDK details will be logged to the console |
| 105 | + |
| 106 | +## Learning from this Example |
| 107 | + |
| 108 | +This project is heavily commented to help beginners understand: |
| 109 | + |
| 110 | +1. **Vue.js Fundamentals**: Component structure, reactive data, event handling |
| 111 | +2. **Composition API**: Using `ref`, `onMounted`, and `inject` |
| 112 | +3. **SDK Integration**: Proper patterns for initializing and using the Adobe Express Add-on SDK |
| 113 | +4. **ES Module Usage**: Modern JavaScript import/export syntax |
| 114 | + |
| 115 | +## Customization |
| 116 | + |
| 117 | +You can use this sample as a starting point for your own Adobe Express Add-ons with Vue.js: |
| 118 | + |
| 119 | +1. Modify `App.vue` to create your own components and UI |
| 120 | +2. Add additional Vue components as needed |
| 121 | +3. Update the manifest.json to change your add-on's metadata |
| 122 | + |
| 123 | +## Troubleshooting |
| 124 | + |
| 125 | +- If you encounter module resolution issues, check that "type": "module" is correctly set in package.json |
| 126 | +- For webpack configuration issues, review webpack.config.js |
| 127 | +- If the SDK isn't available in your components, ensure you're using the inject pattern correctly |
| 128 | + |
| 129 | +## Resources |
| 130 | + |
| 131 | +- [Adobe Express Add-ons Documentation](https://developer.adobe.com/express/add-ons/) |
| 132 | +- [Vue.js Documentation](https://vuejs.org/guide/introduction.html) |
| 133 | +- [Vue Composition API Guide](https://vuejs.org/guide/extras/composition-api-faq.html) |
| 134 | +- [Webpack Documentation](https://webpack.js.org/concepts/) |
0 commit comments