Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

globalName - change __nuxt id as it was in NUXT2 #15132

Closed
3 of 4 tasks
53rg0 opened this issue Oct 10, 2022 · 19 comments · Fixed by nuxt/framework#8883
Closed
3 of 4 tasks

globalName - change __nuxt id as it was in NUXT2 #15132

53rg0 opened this issue Oct 10, 2022 · 19 comments · Fixed by nuxt/framework#8883

Comments

@53rg0
Copy link

53rg0 commented Oct 10, 2022

Describe the feature

Please, return globalName param, its very important for customers and developers for a lot of reasons!

Thank you!

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@manniL
Copy link
Member

manniL commented Oct 10, 2022

Its very important for customers and developers for a lot of reasons!

Can you provide some then? I, personally, always felt it more as a burden than something useful...

@53rg0
Copy link
Author

53rg0 commented Oct 11, 2022

Its very important for customers and developers for a lot of reasons!

Can you provide some then? I, personally, always felt it more as a burden than something useful...

First of all - security reason.
It is very important to protect the site from scripts that automatically scan technologies. Nuxt3 uses the Nitro server part and it is enough to find the __nuxt id in the code to already know what the site is running on. If any bugs are found in the future, scripts that scan websites will quickly find vulnerable ones.

Nuxt3 is great for me! I will definitely talk about this technology in my portfolio and will do my best to make as many people as possible learn about it.
Another thing is customers, especially very large ones, who very often have a requirement to remove any mention of other brands and their team includes those who check the project for such "Easter eggs". Already on the first demo with Nuxt 3, I received such a remark and knew that it could be removed, but later I realized that this was no longer possible.

Analysis of competitors. Often before development, an analysis of competitor solutions is carried out and we would not like to make it obvious to other developers what we use during the analysis. We don't mind talking about it in the portfolio, but we mind making it obvious.

Having this feature is very important, I don’t want to switch back to Nuxt 2 having a wonderful Nuxt 3 because of such a trifle, but still the last word is not with me, but with the clients.

@manniL
Copy link
Member

manniL commented Oct 11, 2022

First of all - security reason. It is very important to protect the site from scripts that automatically scan technologies. Nuxt3 uses the Nitro server part and it is enough to find the __nuxt id in the code to already know what the site is running on. If any bugs are found in the future, scripts that scan websites will quickly find vulnerable ones.

This sounds like security through obscurity. You will always be able to find out if a site was built with Nuxt, simply by scanning the .js/.mjs files and match the code vs. what Nuxt produces. Especially for built-in names.

@manniL
Copy link
Member

manniL commented Oct 11, 2022

Related: #12238

@53rg0
Copy link
Author

53rg0 commented Oct 11, 2022

Yes, but here you don’t even need to compare, you don’t need to write complex scripts, just press F12. Nuxt2 has the ability and everyone uses it for sure, but Nuxt3 does not, so if there is a __nuxt id in the code, then this is 100% nuxt3 framework.

In Nuxt2, everyone uses it, the feature is very important to return it. Moreover, it has already been implemented.

@53rg0
Copy link
Author

53rg0 commented Oct 11, 2022

Of course, for your own projects, this is not very important when you can decide for yourself what is needed and what is not. But when there is a requirement to "hide obvious traces of the engine" and I understand why there is such a requirement, then I have to choose another technology.

But I really 💚 Nuxt3, I hope my opinion (and many others) will be heard.

@ls-v
Copy link

ls-v commented Oct 11, 2022

Nuxt3 I will give it up if it doesn't have a globalName

@manniL
Copy link
Member

manniL commented Oct 11, 2022

Yes, but here you don’t even need to compare, you don’t need to write complex scripts, just press F12.

Okay, so the effort is basically pushing F12 vs. doing a string search for "Nuxt" in the .js assets. I would not consider this another magnitude of effort to be honest 👀

If there is a __nuxt id in the code, then this is 100% nuxt3 framework.

No, either Nuxt2 or Nuxt3 with quite a high chance.

In Nuxt2, everyone uses it, the feature is very important to return it. Moreover, it has already been implemented.

I can say for certain that quite a number of projects, also "larger"/"enterprise" projects, do not use it. 👀

But when there is a requirement to "hide obvious traces of the engine" and I understand why there is such a requirement, then I have to choose another technology.

If the requirement is to hide obvious traces of the framework/tech, then you might not use any framework - or something that compiles down to "pure" JS. You can always detect frameworks, even the basic ones like Vue.js, with ease. Everything in the frontend is human readable eventually ☺️

Anyway, I'm curious about more arguments except "don't make it too obvious we are using Nuxt"!

@53rg0
Copy link
Author

53rg0 commented Oct 11, 2022

I'm sure you won't mind seeing a big Nuxt3 project :)
Last argument is also very important, in addition, the ability to change the Id is also important for development

I really hope that this opportunity will be returned in the near future.

@manniL
Copy link
Member

manniL commented Oct 11, 2022

Last argument is also very important,

Which?

The ability to change the Id is also important for development

What influence does that have on app development?

@53rg0
Copy link
Author

53rg0 commented Oct 11, 2022

Last argument is also very important,

Which?

This one -> Anyway," I'm curious about more arguments except "don't make it too obvious we are using Nuxt"!"

The ability to change the Id is also important for development

What influence does that have on app development?

Flexibility. This creates some rules from which you must follow while writing styles. I don't understand why it was removed, it was a great opportunity that everyone used and now it will become a reason for refusal for many

@manniL
Copy link
Member

manniL commented Oct 11, 2022

This one -> Anyway," I'm curious about more arguments except "don't make it too obvious we are using Nuxt"!"

As shown above, it will not add meaningful protection or "disguise" in any way.

Flexibility. This creates some rules from which you must follow while writing styles.

Could you elaborate on that? Nobody forces you to use __nuxt? 🤔

I don't understand why it was removed, it was a great opportunity that everyone used and now it will become a reason for refusal for many

Making every variable that has nuxt in it "changable" is a huge maintenance burden and, as discussed multiple times now, does not bring any additional security.

@53rg0
Copy link
Author

53rg0 commented Oct 11, 2022

We are not asking for every, we are asking for the most obvious (еspecially when it is only one), especially when Nuxt 2 has it)
Many people prefer other engines because of this, as I said there are many reasons why people are waiting for the return of this feature

@53rg0
Copy link
Author

53rg0 commented Oct 12, 2022

Should we wait for globalName to appear?

@danielroe
Copy link
Member

I would be opposed to customising nuxt everywhere it appears in the codebase, as this greatly decreases stability and interoperability across the modules ecosystem, as @manniL has rightly said. Nothing along these lines is at all effective in terms of concealing what framework an app is built with.

But as for customising the ID of the root <div>, I think this might be reasonable, along with other customisations of this element, such as perhaps changing the HTML tag to which Nuxt mounts.

@53rg0
Copy link
Author

53rg0 commented Oct 12, 2022

I would be opposed to customising nuxt everywhere it appears in the codebase, as this greatly decreases stability and interoperability across the modules ecosystem, as @manniL has rightly said. Nothing along these lines is at all effective in terms of concealing what framework an app is built with.

But as for customising the ID of the root <div>, I think this might be reasonable, along with other customisations of this element, such as perhaps changing the HTML tag to which Nuxt mounts.

Thanks a lot for your answer! Look forward to :)

@weo3dev
Copy link

weo3dev commented Oct 15, 2022

We aren't asking for nuxt to be changed everywhere. We are literally asking for control to be given back to us where we had said control in Nuxt 2. Please give it back. It is useful to us, as developers, not only to satisfy the needs of our clients in terms of security and code compliance, but also is an anchor of flexibility that makes our lives easier in orders of magnitude. This is serious enough that I would rather go with Next or Angular rather than argue this point to death.

Please give back the control and flexibility we had with Nuxt2 when it has to do with root level app and HTML structure.

:: insert begging gif here ::

@53rg0
Copy link
Author

53rg0 commented Nov 9, 2022

Is it worth waiting for the ID change on release?

@danielroe
Copy link
Member

As you can see, there is an open PR to implement this.

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants