Altinn / app-frontend-react

Altinn application React frontend
BSD 3-Clause "New" or "Revised" License
18 stars 31 forks source link

Developer tools #1021

Open olemartinorg opened 1 year ago

olemartinorg commented 1 year ago

Description

We're creating a platform used by developers to create apps. Let's give them tools.

I've had this marinating in the back of my head for a while, so when the opportunity arose to write a list of features I'd want on Slack, it's probably best to detail this in an issue as well.

Some nice-to have features

Inspiration

ivarne commented 1 year ago

❤️❤️❤️

olemartinorg commented 1 year ago

@ivarne

record a test case that can be replayed using a browser automator (Playwright, puppeteer, selenium or another solution) that verifies validations.

Very good point! 👏 I've been hinting at this thing in some slack messages earlier today, and I've tried to "sell" such a solution internally as well. It's probably time to create a proper issue detailing my thoughts on this, so I wrote #1040. Would love to hear your thoughts there as well! 🙏

My thoughts have been to support this in the upcoming Studio app-preview functionality (Studio could also take the result and save it to the app repo without you having to do it manually), but the recording would have to happen in app-frontend, so we could probably also expose that functionality in the developer tools.

bjosttveit commented 1 year ago

Could it be an idea to add a "console"? The "real console" gets a bit cluttered with random warnings and such. For example, expressions log pretty errors to the console if they fail to resolve, maybe we could have a cleaner console in the developer tools with only intentional logs?

olemartinorg commented 1 year ago

@bjosttveit I agree! But it might be a bit tedious to implement by ourselves (we have limited developer resources), so unless we find a ready-made react console we can use, I think we should have developers keep using the built-in console.

With that said, we should absolutely display errors/warnings regarding the app configuration. Having an interactive console might be a bit harder to get right.

bjosttveit commented 1 year ago

Yeah, maybe just a log, we dont need to be able to send commands really. Maybe hard to make it display things correctly?

olemartinorg commented 1 year ago

It would be needlessly difficult to parse the format we send off to the browser console just to colorize the output, but we could easily change the format and just display it in the devtools (we could even include a nudge animation and/or error counter to inform developers when errors occur). Our errors/warnings/messages to app-developers should preferably be displayed in the devtools instead of in the browser console.

We could even include a tool to copy the log for attaching to a bug report.. 😉