Comments (12)
Okay glad to hear! Doing this helped me really improve the project.
from react-google-apps-script.
Hey again,
Glad you've been interested in this project. Yes would love to have support for hot reloading. If you're able to help get it into this project I'd really appreciate it. I honestly don't know if it's a simple fix or if it would involve rewriting a lot of the project. When I started writing the local development piece of this project, fast-refresh or whatever it's called now was pretty new (still is kind of new), so I went with the older approach with Webpack Dev Server which just refreshes the app -- and that was hard enough! Here's some background on how it works right now:
- GAS-client: This is basically a wrapper of
google.script.run
that makes it easier to work with, but in development it proxies calls to the Google Apps Script environment through Google-Apps-Script-Webpack-Dev-Server - Google-Apps-Script-Webpack-Dev-Server: This is a fork of Webpack Dev Server, which is what provides the simple version of hot reloading, but listens for requests from gas-client and relays them to the Google Apps Script environment, as well as relays responses back to the development environment.
- React-Google-Apps-Script: This is the sample repo that has all the pieces in place
All these together allow not just hot reloading of the app, but also allows calls to the GAS server from the development environment, so you're not just working with UI.
I'd start with https://github.com/pmmmwh/react-refresh-webpack-plugin. To get it working you might need to update Google-Apps-Script-Webpack-Dev-Server, or this repo, or both.
Hope this is helpful,
Elisha
from react-google-apps-script.
Hi Elisha, thanks for the info. I will see if I can give it another shot at some point, I put a fair amount of time in trying to get that working with no luck.
from react-google-apps-script.
Hey Alex, think I actually have this working with the react-refresh. I actually ripped out Google-Apps-Script-Webpack-Dev-Server altogether, and it's faster and saves state I think. Will update in a bit with how to...
from react-google-apps-script.
Something like this. When saving, it makes the changes without refreshing the page, and notice the input state is not reset.
from react-google-apps-script.
See #98
from react-google-apps-script.
That looks amazing! I will check it out. Thanks for digging into this.
I think / don't externalize react during development due to issue with react-refresh
might be the issue (or one of the issues I hit), but I didn't know enough about it at the time to even begin to try to solve it.
from react-google-apps-script.
Yeah, that was definitely a big piece of the puzzle, among other things.
from react-google-apps-script.
I'm trying out this now. After implementing the changes, I hit this issue:
pmmmwh/react-refresh-webpack-plugin#343
So I then switched to version 0.5.0-beta.9
of @pmmmwh/react-refresh-webpack-plugin
, and got past that issue.
Now, when I save changes, I see the app being recompiled (in the Chrome javascript console), but I don't see my changes reflected in the addon. I'm going to double check my work and see if I missed anything.
from react-google-apps-script.
So I then switched to version
0.5.0-beta.9
of@pmmmwh/react-refresh-webpack-plugin
, and got past that issue.
Ah my mistake, thats what you used. Ignore that :)
from react-google-apps-script.
Ok I found a mistake or two I made merging those changes in (due to my previous attempts to get this working). It looks like its working great now, this is a huge improvement. nice work!
from react-google-apps-script.
With #98 support for hot reloading is now included in this project.
from react-google-apps-script.
Related Issues (20)
- Can we migrate to vite? HOT 4
- White (blank) sidebar in Chrome when using Station wallet Chrome extension HOT 12
- How to use shadcn/ui HOT 1
- Issue: app is not loaded when I deploy, but does work with HMR HOT 2
- I want to use fast refresh without https
- How to deploy a google workspace addon using this? HOT 6
- Is it possible to pass initial state to React root component? HOT 3
- Uncaught ReferenceError: react is not defined HOT 1
- Typescript support for custom functions HOT 14
- Seeing "Running script" with "Cancel" and "Dismiss" instead of "Working" when executing opening the sidebar HOT 2
- Support for NextJs HOT 4
- Uncaught ReferenceError: emotionReact is not defined at 9291 (userCodeAppPanel:2:53729) HOT 5
- JSdocs Autocomplete not working as expected HOT 9
- ReferenceError: TextEncoder is not defined : how to diagnose a solution HOT 3
- TypeScript support for TableCell.setBold() TableCell.setFontSize() HOT 1
- Solution for webapp react-router sync with google.script.history (Client-side API) HOT 3
- How to expose an Appscript ServerFunction to the user for attaching as a script? HOT 3
- How to create custom functions in V3 version? HOT 5
- [Q] Any breaking change while migrating from V2 webpack to V3 vite? HOT 2
- Close dialog in Development Mode using google.script.host.close() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-google-apps-script.