You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by "calmdev (via GitHub)" <gi...@apache.org> on 2024/03/05 00:09:52 UTC
[D] Purpose of build directory? [incubator-answer]
GitHub user calmdev created a discussion: Purpose of build directory?
The project has a root `/build` directory with a README file.
I don't see it mentioned here: https://answer.apache.org/community/development
When I run:
```
make ui
```
I see it builds the frontend files under `/ui/build`, but when I use:
```
make build
```
I don't see UI changes after starting the built answer binary.
The modifications do appear when using ui dev server:
```
pnpm start
```
Am I missing a step – how do we get the UI changes into the build?
GitHub link: https://github.com/apache/incubator-answer/discussions/824
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev added a comment to the discussion: Purpose of build directory?
Ok, interesting. Thanks for the reply.
For example, I added an additional script tag to:
```
./ui/public/index.html
```
It's there when looking at the source served by the js dev server.
Then I build and I also see it in:
```
./ui/build/index.html
```
But after building a new binary I'm not seeing it in the html source when I run answer.
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674268
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
GitHub user LinkinStars added a comment to the discussion: Purpose of build directory?
Regardless of the question. I'm just wondering if `Custom Header` or `Footer` would meet your usage needs?
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674519
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev added a comment to the discussion: Purpose of build directory?
Yeah those are the steps I followed.
It's working for me now after resolving [this issue](https://meta.answer.dev/questions/D1aH2/E1YJ2?shareUserId=levi)
<img width="1710" alt="Screenshot 2024-03-05 at 7 41 04 AM" src="https://github.com/apache/incubator-answer/assets/461249/09686f69-dbd2-4503-a60b-a904a8b3a366">
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8679847
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev edited a comment on the discussion: Purpose of build directory?
Ok, interesting. Thanks for the reply.
For example, I added an additional script tag to:
```
./ui/public/index.html
```
It's there when looking at the source served by the js dev server.
Then I build and also see it in:
```
./ui/build/index.html
```
But after building a new binary I'm not seeing it in the html source when I run answer.
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674268
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev added a comment to the discussion: Purpose of build directory?
<img width="1697" alt="Screenshot 2024-03-04 at 10 24 38 PM" src="https://github.com/apache/incubator-answer/assets/461249/6b01f23a-aaa3-4ba4-a5df-ca228906759f">
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674347
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev added a comment to the discussion: Purpose of build directory?
Thanks, yeah I don't see it with the inspector or in the network console.
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674320
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
GitHub user LinkinStars added a comment to the discussion: Purpose of build directory?
🤔 🤔 🤔 That's strange, how did you build it? Just run `make ui` and `make build`?
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8675219
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
GitHub user LinkinStars added a comment to the discussion: Purpose of build directory?
Maybe you can try to use `Inspect` to check if the script exist. Don't use `View Page Source`.
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674303
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev edited a comment on the discussion: Purpose of build directory?
Out of curiosity I removed the script tag from:
```
./ui/public/index.html
```
Then used helmet to load the script on the page where I want to use it:
```jsx
// ./ui/src/pages/Questions/Detail/index.tsx
<HelmetProvider>
<Helmet>
<script src="https://unpkg.com/@antonz/codapi/dist/snippet.js" />
</Helmet>
{/* ... */}
</HelmetProvider>
```
This works and the script loads after all the other static js files on the page.
I still run into the issue where I don't see it after building the new answer binary 🤔
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674706
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev edited a discussion: Purpose of build directory?
The project has a root `/build` directory with a README file.
I don't see it mentioned here: https://answer.apache.org/community/development
When I run:
```
make ui
```
I see it builds the frontend files under `/ui/build`, but when I use:
```
make build
```
I don't see UI changes after starting the built answer binary.
The modifications do appear when using ui dev server:
```
pnpm start
```
Am I missing a step – how do we get UI modifications into the build?
I've also tried:
```
./answer build
```
Then running:
```
./new_answer run -C ./answer-data/
```
GitHub link: https://github.com/apache/incubator-answer/discussions/824
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
GitHub user LinkinStars added a comment to the discussion: Purpose of build directory?
> The project has a root `/build` directory with a README file.
Sorry, this folder is currently not in use.
> Am I missing a step – how do we get UI modifications into the build?
No. Your steps are correct.
1. `make ui` will build the frontend.
2. `make build` will build the binary that contains the frontend that you build in step 1.
> I don't see UI changes after starting the built answer binary.
>
> The modifications do appear when using ui dev server:
If you start using the 'pnpm start' command, these changes will only take effect when accessed through the 127.0.0.1:3000 port. Furthermore, they will also take effect when you repack the application by repeating the steps mentioned above.
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674151
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev added a comment to the discussion: Purpose of build directory?
I was trying to track it down and understand seen this [here](https://github.com/apache/incubator-answer/blob/main/internal/cli/build.go#L333):
```
func replaceNecessaryFile(b *buildingMaterial) (err error)
```
Looks relevant, but doesn't appear to be used anywhere so maybe not?
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674439
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev edited a discussion: Purpose of build directory?
The project has a root `/build` directory with a README file.
I don't see it mentioned here: https://answer.apache.org/community/development
When I run:
```
make ui
```
I see it builds the frontend files under `/ui/build`, but when I use:
```
make build
```
I don't see UI changes after starting the built answer binary.
The modifications do appear when using ui dev server:
```
pnpm start
```
Am I missing a step – how do we get UI modifications into the build?
GitHub link: https://github.com/apache/incubator-answer/discussions/824
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev edited a comment on the discussion: Purpose of build directory?
Left: Answer Binary
Right: JS Dev Server
<img width="1697" alt="Screenshot 2024-03-04 at 10 24 38 PM" src="https://github.com/apache/incubator-answer/assets/461249/6b01f23a-aaa3-4ba4-a5df-ca228906759f">
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674347
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
GitHub user LinkinStars added a comment to the discussion: Purpose of build directory?
> I was trying to track it down and understand seen this [here](https://github.com/apache/incubator-answer/blob/main/internal/cli/build.go#L333):
>
> ```
> func replaceNecessaryFile(b *buildingMaterial) (err error)
> ```
>
> Looks relevant, but doesn't appear to be used anywhere so maybe not?
This is dead code.
BTW, I've asked the frontend to help us look into this, so please wait.
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674461
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org
Re: [D] Purpose of build directory? [incubator-answer]
Posted by "calmdev (via GitHub)" <gi...@apache.org>.
GitHub user calmdev added a comment to the discussion: Purpose of build directory?
Out of curiosity I removed the script tag from:
```
./ui/public/index.html
```
Then used helmet to load the script on the page where I want to use it:
```jsx
// ./ui/src/pages/Questions/Detail/index.tsx
<HelmetProvider>
<Helmet>
<script src="https://unpkg.com/@antonz/codapi/dist/snippet.js" />
</Helmet>
{/* ... */}
</HelmetProvider>
```
This works and the script loads after all the other static js files.
I still run into the issue where I don't see it after building the new answer binary 🤔
GitHub link: https://github.com/apache/incubator-answer/discussions/824#discussioncomment-8674706
----
This is an automatically sent email for commits@answer.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@answer.apache.org